Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Get precise scale used color in spite of scale tag tips

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
Spawn



Joined: 01 Aug 2008
Posts: 5

PostPosted: Fri Aug 01, 2008 5:34 pm    Post subject: Get precise scale used color in spite of scale tag tips Reply with quote

Hi,

What I need to do is to colorize some variable relative to correspondant scale.

Code:
SCALE DEVICE_STATUS 0 0.5 192.192.192 #C0C0C0
SCALE DEVICE_STATUS 0.5 1.5 255 0 0 #FF0000
SCALE DEVICE_STATUS 1.5 2.5 0 0 255 #0000FF
SCALE DEVICE_STATUS 2.5 3.5 0 255 0 #00FF00

SCALE DEVICE_AVAILABILITY 0 50 255 0 0          255 255 0
SCALE DEVICE_AVAILABILITY 50 100 255 255 0      0 255 0

SCALE DEVICE_LATENCY 0 8       0 255 0        255 255 0
SCALE DEVICE_LATENCY 8 100   255 255 0      255 0 0

NODE MY_DEVICE
   SET device_id 15       

   LABEL {node:this:cacti_description}
        TARGET cactihost:{node:this:device_id}
        USESCALE DEVICE_STATUS
### NOTES contains colored Value of relative Node Variables :
        NOTES
### Status is OK, because it is based on "inscaletag", and relative to the only four possible colors of SCALE DEVICE_STATUS
Status: <font color="{node:this:inscaletag}"> {node:this:state} </font>
### Availability isn't OK, because I can't manage to get the availability color relative to SCALE DEVICE_AVAILABILITY
Availability: <font color="XXXXXXX"> {node:this:cacti_availability}% </font>
###Idem
Latency : <font color="YYYYYY"> {node:this:cacti_curtime:%.1f}ms </font>


Could we replace XXXXX by something like :
Code:
{node:this:cacti_availability:inscalecolor_DEVICE_AVAILABILITY}


Is it possible to retrieve the exact color of the current Node Availability refering to the specified Scale DEVICE_AVAILABILITY?

The only way I succeeded was to create a child node, using scale DEVICE_AVAILABILITY, and targeting his parent node cacti_availability (using
Code:
{node:parent:cacti_availability}

But it doesn't permit to use the children color to colorize some parent text!...

PS : In that subject, I want Latency and Availability colorized by the real color of the scale, and not a fixed value like the upon SCALE DEVICE_STATUS (using a scale Tag to transmit 4 Colors in HEXA value).

Thanks for your help!
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2133
Location: United Kingdom

PostPosted: Sun Aug 03, 2008 11:27 am    Post subject: Reply with quote

Interesting idea. Yes, that's fairly easy to implement. I'll try to add it to the next 0.96 early-test release.
Back to top
Spawn



Joined: 01 Aug 2008
Posts: 5

PostPosted: Tue Aug 05, 2008 3:40 am    Post subject: Reply with quote

Thanks a lot!

So, to be continued...
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2133
Location: United Kingdom

PostPosted: Tue Aug 05, 2008 4:08 am    Post subject: Reply with quote

Spawn wrote:
Thanks a lot!

So, to be continued...


Yep. I'll PM you when the next test version is about.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group