|
|
| Author |
Message |
rothchild
Joined: 22 Jan 2007 Posts: 18 Location: Illinois - USA
|
Posted: Mon May 14, 2007 7:46 am Post subject: Use of multiple Targets |
|
|
| I would like to trigger a change of icon color by using a change in any of a group of targets. What I'm attempting is to have our campus buildings on a weathermap that if any of the switches inside those buildings fail it would cause the building icon to change colors. I tried using multiple sources but because weathermap aggregates the targets, more than half need to be down before the building icon changes colors. I am running 0.9 of weathermap. Thanks for any help! |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Mon May 14, 2007 8:46 am Post subject: Re: Use of multiple Targets |
|
|
| rothchild wrote: | | I would like to trigger a change of icon color by using a change in any of a group of targets. What I'm attempting is to have our campus buildings on a weathermap that if any of the switches inside those buildings fail it would cause the building icon to change colors. I tried using multiple sources but because weathermap aggregates the targets, more than half need to be down before the building icon changes colors. I am running 0.9 of weathermap. Thanks for any help! |
Just change the SCALE - make it so that only the value for "all up" shows as green. For example, if you were using the cactihost: DS plugin, 'up' is 3, so for a set of 10 switches, that would be 30 for an all-good network, and anything else is bad. You can then use a SCALE like:
| Code: |
SCALE aggregated 0 29 255 0 0
SCALE aggregated 30 30 0 255 0
SCALE aggregated 31 100 255 0 0
NODE summarylabel
TARGET cactihost:2 cactihost:4 cactihost:5 [etc]
USESCALE aggregated
|
I haven't actually tried that, but it should do what you want (I think!). To do it with an icon image is harder though. |
|
| Back to top |
|
 |
rothchild
Joined: 22 Jan 2007 Posts: 18 Location: Illinois - USA
|
Posted: Mon May 14, 2007 2:55 pm Post subject: |
|
|
Thanks, that works great. I instead change the label color instead of changing the icon, much less work . |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2162 Location: United Kingdom
|
Posted: Mon May 14, 2007 3:09 pm Post subject: |
|
|
| rothchild wrote: | Thanks, that works great. I instead change the label color instead of changing the icon, much less work . |
Cool, glad it worked It sounded believable...
In 0.91, it's not so hard to do the icon as well... there is a new variable called inscalekey (and outscalekey). It contains the internal 'key' used to name the SCALE line that would be used to colour the label. The key is minvalue_maxvalue, so you could have three icon files: building_0_29.png building_30_30.png building_31_100.png and a line like ICON building_{node:this:inscalekey}.png and it should change the icon appropriately. I haven't really tested this thing very much, but that is what it's intended for. So you then have two copies of your red building icon, and one of your green icon as those three. If you want to get really tricky, you can even have 'alert levels' this way, depending on how many things are down. |
|
| Back to top |
|
 |
|