Icon Scale

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
KyRoo
Cacti User
Posts: 51
Joined: Fri Oct 19, 2007 10:19 am

Icon Scale

Post by KyRoo »

Hi All,

Ive found an example how to display up down status on a weathermap.
I've seen that, if down you can display a dirrent icon that when it up, ...

I'm wondering if this can be done in some kind of scale.

like when the value is 0 get a red smily
when it is between 1 and 50 give a green smily
when it is between 50 and 75 a yellow smily
when it is between 75 and 100 a red one again
(this is an example, i cant to do this with other ranges and more pics)

Thanks,
kyRoo
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Icon Scale

Post by Howie »

KyRoo wrote:Hi All,

Ive found an example how to display up down status on a weathermap.
I've seen that, if down you can display a dirrent icon that when it up, ...

I'm wondering if this can be done in some kind of scale.

like when the value is 0 get a red smily
when it is between 1 and 50 give a green smily
when it is between 50 and 75 a yellow smily
when it is between 75 and 100 a red one again
(this is an example, i cant to do this with other ranges and more pics)

Thanks,
kyRoo
You can do this two ways, depending on which version of weathermap you have.

In 0.91+, you can use 'inscalekey' to find which line in a scale the item hit.

Code: Select all

SCALE goodbad 0 0 255 0 0
SCALE goodbad 0 50 0 255 0
SCALE goodbad 50 75 255 255 0
to define a scale with the bands you want to use.
(the colours here don't actually matter - if you don't want the label to change colour, set all the colours to white)

Then you can use

Code: Select all

NODE blah
   USESCALE goodbad
    ICON images/status_{node:this:inscalekey}.png
Now, inscalekey contains a value like 0_0, 0_50, 50_75 (the top and bottom values of the scale line that was matched, with an _ in between). There's also a outscalekey. So you need icons called status_0_0.png etc.

In 0.95+, it's a bit nicer. There's a thing called a scale tag.

Code: Select all

SCALE goodbad 0 0 255 0 0  images/redicon.png
SCALE goodbad 0 50 0 255 0 images/greenicon.png
SCALE goodbad 50 75 255 255 0 images/yellowicon.png

NODE blah
   USESCALE goodbad
    ICON {node:this:inscaletag}
You can use the tag for anything, not just icons. So if you wanted a comment to appear alongside only busy links, you could do that with this method too.

Hope that lot makes a bit of sense. It's a few steps, but especially in 0.95 it's fairly painless.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Jem
Posts: 35
Joined: Tue Apr 12, 2005 4:36 pm
Contact:

Post by Jem »

Well still some troubles :(

My configuration is the following:

Code: Select all

SCALE goodbad 0 33 255 0 0  images/chip_ok.png
SCALE goodbad 33 66 0 255 0 images/chip_warning.png
SCALE goodbad 66 100 255 255 0 images/chip_critical.png

...

# Node definitions:
NODE MYHOST
        USESCALE goodbad
        ICON {node:this:inscalekey}
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=2001
        OVERLIBGRAPH /cacti/graph_image.php?...local_graph_id=2001
        TARGET gauge:/cacti/rra/myhost_5min_cpu_2591.rrd:5min_cpu:-
        POSITION 298 257
But when the map is being generate I have this error in my Cacti log file:

Code: Select all

11/04/2008 03:06:02 PM - WEATHERMAP: Poller[0] [Map 17] Sandbox: ICON 0_33 does not exist, or is not readable. Check path and permissions.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Jem wrote:Well still some troubles :(
Replying to two different threads for the same problem is one of them...

Jem wrote: My configuration is the following:

Code: Select all

SCALE goodbad 0 33 255 0 0  images/chip_ok.png
SCALE goodbad 33 66 0 255 0 images/chip_warning.png
SCALE goodbad 66 100 255 255 0 images/chip_critical.png

...

# Node definitions:
NODE MYHOST
        USESCALE goodbad
        ICON {node:this:inscalekey}
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=2001
        OVERLIBGRAPH /cacti/graph_image.php?...local_graph_id=2001
        TARGET gauge:/cacti/rra/myhost_5min_cpu_2591.rrd:5min_cpu:-
        POSITION 298 257
But when the map is being generate I have this error in my Cacti log file:

Code: Select all

11/04/2008 03:06:02 PM - WEATHERMAP: Poller[0] [Map 17] Sandbox: ICON 0_33 does not exist, or is not readable. Check path and permissions.
Sorry, that should be inscaletag, not inscalekey. :oops:
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Jem
Posts: 35
Joined: Tue Apr 12, 2005 4:36 pm
Contact:

Post by Jem »

Yes sorry, for responding on the other topic, but as it was the same configuration, I screwed up by responding to the thread... sorry. :oops:

It's working fine now, thank a lot !
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests