Switch Interface status weathermap

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

feds
Posts: 12
Joined: Wed Jan 07, 2009 6:22 pm

Switch Interface status weathermap

Post by feds »

Hi, I have been looking through this forum trying to find a way to show interface link status on a weather map with no luck.

This is what I have so far.

I am setting a background image of a cisco 6513 chassis. I want to add nodes for each of the ports and have them display a green icon for up and a red icon for down.

I have been able to get it to show a green icon for the host being up (using TARGET cactihost feature, but I can't figure out how to get this working for an interface on a host.

I am graphing the ifOperStatus for each interface. I used this link to get that working http://forums.cacti.net/about17722.html

I am using the newest version of cacti and weathermap and am running on fedora 10.

Let me know if you require any other info.

Anyone that can help, I would be very thankful
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

If you have ifOperStatus in an rrd, it should work almost the same as cactihost:... except you need to know a bit about specifying the target.

Your ifOperStatus rrd file won't use traffic_in or traffic_out as the DS names in the file. You can learn more about that stuff here: http://www.network-weathermap.com/node/85

You'll end up with a target something like:
TARGET gauge:/var/www/html/cacti/rra/my_operstatus_234.rrd:ifOperStatus:-

You will need to do a similar custom scale to your cactihost: one, too, of course. (IIRC, 2=down and 1=up for ifOperStatus).
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!)
feds
Posts: 12
Joined: Wed Jan 07, 2009 6:22 pm

Post by feds »

Thank you for the info, I have the TARGET set correct now, and I'm not getting errors about that, but I am now getting errors about my icon missing.

Here is my conf file.

Code: Select all

BACKGROUND images/Visio-Cat6513.png

KEYPOS DEFAULT -1 -1 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 0 0   255 255 255
SCALE DEFAULT 1 10   140 0 255
SCALE DEFAULT 10 25   32 32 255
SCALE DEFAULT 25 40   0 192 255
SCALE DEFAULT 40 55   0 240 0
SCALE DEFAULT 55 70   240 240 0
SCALE DEFAULT 70 85   255 192 0
SCALE DEFAULT 85 100   255 0 0

SET key_hidezero_DEFAULT 1

# End of global section

# DEFAULT definitions:
NODE DEFAULT
        MAXVALUE 100
        ICON images/ports_{node:this:int_status}.png

LINK DEFAULT
        BANDWIDTH 100M


# End of DEFAULTS section

# Node definitions:
NODE node08046
#       ICON images/port_down.png
TARGET gauge:/usr/share/cacti/rra/computer_rm_bps_2000_int_status_8.rrd:int_status:-
        POSITION 155 228


# End of NODE section

# Link definitions:

# End of LINK section

# That's All Folks!
Here is the error:

01/07/2009 07:45:41 PM - WEATHERMAP: Poller[0] [Map 1] test.conf: ICON images/ports_[UNKNOWN].png does not exist, or is not readable. Check path and permissions.
Am I using the wrong syntax for the {node} command? It tried using the following:

{node:this:state}
{node:this:ifOperStatus}

Any idea?

Thanks[/quote][/code]
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

The value in the rrd will be a number. I think operstatus is either 1 for up or 2 for down. So, you need scale where 1 and 2 are different colours.

SCALE ifstatus 0 1.5 255 0 0
SCALE ifstatus 1.5 2.5 0 255 0

and then 'USESCALE ifstatus in' in your default node. Now the node label will change colour. To change the icon, the easiest way is to use the same SCALE again:

SCALE ifstatus 0 1.5 255 0 0 images/down.png
SCALE ifstatus 1.5 2.5 0 255 0 images/up.png

Then in the node, you can use 'ICON {node:this:inscaletag}' which will contain the text 'tag' from the SCALE line that matches for that node .

You could also create icons called state_1.png and state_2.png and use 'ICON images/state_{node:this:bandwidth_in}.png' and skip the special scale.
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!)
feds
Posts: 12
Joined: Wed Jan 07, 2009 6:22 pm

Post by feds »

Thank you so much....I go it working!!
feds
Posts: 12
Joined: Wed Jan 07, 2009 6:22 pm

Post by feds »

One small question, I am getting errors in my log that say file port_1.866666.png does not exist

I am using the port_{node:this:bandwidth_in}.png icon, this happens for one or two polling cycles then it picks up the correct number.

Anyone know how to fix this, I tried changing my graph template so it used last instead of average but it didn't help.

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

Post by Howie »

I think you need to change your rrd definition to absolute instead of gauge. Something like that - check the rrdtool docs. It's rrdtool averaging values that causes this.

You could use {node:this:bandwidth_in:%d} to force it to an integer, but I think it always rounds down, so you'll still get the wrong value, but no error.
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!)
feds
Posts: 12
Joined: Wed Jan 07, 2009 6:22 pm

Post by feds »

Thanks I have used the %d as I'm not too worried about the 1 or 2 polling cycles with a wrong icon. Just didn't want a blank spot on my weather map and an error in the log.
User avatar
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Post by zoemu »

is where did you get bandwidth _in is it in you rra
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

bandwidth_in is what weathermap calls the 'in' channel of the TARGET regardless of what the rrd file (or any other kind of target) is called. See the 'advanced topics' section in the manual about 'special tokens' for more...
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
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Post by zoemu »

Thank you....

Will try it on Monday

Z :wink: :wink:
User avatar
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Post by zoemu »

Iv'e try bandwidth_in but the node is not being displayed

his is my config:

BACKGROUND images/Single switch.PNG
WIDTH 48
HEIGHT 48

KEYPOS DEFAULT -1 -1 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 0 0 192 192 192
SCALE DEFAULT 0 1 255 255 255
SCALE DEFAULT 1 10 140 0 255
SCALE DEFAULT 10 25 32 32 255
SCALE DEFAULT 25 40 0 192 255
SCALE DEFAULT 40 55 0 240 0
SCALE DEFAULT 55 70 240 240 0
SCALE DEFAULT 70 85 255 192 0
SCALE DEFAULT 85 100 255 0 0


# End of global section


# TEMPLATE-only NODEs:

NODE DEFAULT
MAXVALUE 100
ICON /cacti/plugins/weathermap/images/ports_{node:this:bandwidth_in}.png


# TEMPLATE-only LINKs:
LINK DEFAULT
BANDWIDTH 100M



NODE node06293
INFOURL /cacti/graph.php?rra_id=all&local_graph_id=248
OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=248
TARGET gauge:/cacti/rra/72/425.rrd:int_status: POSITION 30 30


# regular LINKs:


# That's All Folks!
Help Please!!!, head against the wall!!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Before you hit your head on anything READ THE LOGS.

You didn't put a return after the POSITION for the node, so weathermap doesn't know where to put the node. There would be an error for that.

and you need a '-' for the end of the TARGET, so there are two DS names:

Code: Select all

TARGET gauge:/cacti/rra/72/425.rrd:int_status:-
there would be an error for that too.
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
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Post by zoemu »

Thank you, Thank you..... It's Finally going...

One more question.... Explorer is showing "done with errors"

at Line 107
print "<script type=\"text/javascript\" src=\"overlib.js\"><!-- overLIB (c) Erik Bosrup --></script> \n";
in weathermap-cacti-plugin.php

it seems to be complaining about my OVERLIBGRAPH settings wich is not working.. if I run the overlib link in a separate page it displays the image correctly......

Thank you again for your patience,
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

zoemu wrote:Thank you, Thank you..... It's Finally going...

One more question.... Explorer is showing "done with errors"

at Line 107
print "<script type="text/javascript" src="overlib.js"><!-- overLIB (c) Erik Bosrup --></script> \n";
If IE is saying this, then it's not line 107 in the PHP, but line 107 in the *output* from the PHP - i.e. the HTML source. Do a View Source and look at line 107 of that... IE sometimes gets the line number a bit wrong though.

My guess would be that you have a node or link with a name that contains characters that aren't valid in a CSS id.
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!)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests