Idiot lights

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Idiot lights

Post by colejv »

My latest thing has been creating idiot lights, these are small (10pxX10px) images I created with KIconEdit, the intent is that the light up red when room temperature rises above 90 Fahrenheit, power drops below 1VAC, wireless access point or ip based security system fails to respond to ping, I am also displaying current room temp along the usual host status and bandwidth usage. Overlib shows the APC graphs for room temp/input voltage, Bandwidth stats for the AP and ping latency for the security system.



I think this is all of the relative code (assuming you are using .96 if not insert the template code in each node )

Code: Select all

#Scales

SCALE cactiupdown 0.5 1.5   255 0 0
SCALE cactiupdown 1.5 2.5   0 0 255
SCALE cactiupdown 2.5 3.5   0 255 0

SCALE cactitemp 0 0   255 255 255
SCALE cactitemp 0 90   0 255 0
SCALE cactitemp 90 100   255 0 0

SCALE cactipower 0 1  255 0 0
SCALE cactipower 0 250   0 255 0

# DEFAULT definitions:
NODE DEFAULT
        OVERLIBWIDTH 650
        OVERLIBHEIGHT 266
        TARGET cactihost:{node:this:cacti_id}
        USESCALE cactiupdown in

NODE wireless
        ICON /usr/local/share/cacti/plugins/weathermap/configs/wifi.png
        USEICONSCALE cactiupdown in

NODE lock
        ICON /usr/local/share/cacti/plugins/weathermap/configs/lock.png
        USEICONSCALE cactiupdown in

NODE temp
        ICON /usr/local/share/cacti/plugins/weathermap/configs/temp.png
        USEICONSCALE cactitemp in

NODE power
        ICON /usr/local/share/cacti/plugins/weathermap/configs/power.png
        USEICONSCALE cactipower in

NODE UPStemp
        LABEL {node:this:bandwidth_in:%8.0lf}F
        LABELOUTLINECOLOR none
        LABELBGCOLOR none
        USESCALE none in


#nodes

NODE somewherecomm
        LABEL somewhere Commons
        POSITION 1140 13
        SET cacti_id 54

NODE somewherecommUPS
        TEMPLATE temp
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=248
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=248
        TARGET gauge:/usr/local/share/cacti/rra/somewhere_com_ups_check_tempprobe_437.rrd:check_tempProbe:-
        POSITION somewherecommUPStemp 35 0

NODE somewherecommUPStemp
        TEMPLATE UPStemp
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=248
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=248
        TARGET gauge:/usr/local/share/cacti/rra/somewhere_com_ups_check_tempprobe_437.rrd:check_tempProbe:-
        POSITION somewherecomm -35 18


NODE somewherecommpower
        TEMPLATE power
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=248
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=248
        POSITION somewherecommUPS 10 0
        TARGET gauge:/usr/local/share/cacti/rra/somewhere_com_ups_voltin_qry_432.rrd:voltin_qry:-

NODE somewherecommwap
        TEMPLATE wireless
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=435
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=435
        POSITION  somewherecommpower 10 0
        SET cacti_id 240

NODE somewherecommlock
        TEMPLATE lock
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=381
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=381
        POSITION somewherecommwap 10 0
        SET cacti_id 202
I can post the png files if anyone is interested.
Attachments
excerpt.PNG
excerpt.PNG (1.52 KiB) Viewed 13175 times
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

that's pretty sweet. I can't wait to try it out.

I'm running weathermap in my office on a 25" LCD as a system monitor, the more info i can display, the better informed I am.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Nice :-)

This is the sort of thing that I want to make easier with the templates stuff. Some way to have the relative position refer to a 'last non-relative' node or similar would mean that you could lose all the position lines into the template too. (still thinking about that - I like to use relative positions for 'main' nodes, too, so it's not quite that simple. Maybe something to mark a node as 'major' or something?)

Even as it stands, you could use SET graph_id 235 and then move the INFOURL and OVERLIBGRAPH to the templates, too.

The current editor doesn't really deal well with this kind of 'cleverness' though, sadly.
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!)
Dano
Posts: 3
Joined: Tue Sep 09, 2008 8:35 pm
Location: NC

Post by Dano »

I'd like the PNG files. I think I'll give this a try. Thanks for post.
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

Here they are
Attachments
power.png
power.png (131 Bytes) Viewed 12797 times
wifi.png
wifi.png (140 Bytes) Viewed 12797 times
lock.png
lock.png (102 Bytes) Viewed 12797 times
temp.png
temp.png (102 Bytes) Viewed 12797 times
shanecentre
Posts: 9
Joined: Tue Oct 02, 2007 10:53 am

Re: Idiot lights

Post by shanecentre »

When I use your config with my APC UPS I get the temp back in Celsius instead of Fahrenheit, not unexspected because the data comes from the UPS in C.

Can you use math in the target or node label to convert from C to F?

Sorry if this is a basic question (I'm new to Weathermap) but I've looked though the lists here and the Weathermap site as well as to docs and the closest I've come is some information about scaling. But that doesn't seem to be what I'm looking for.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Well, C= ((F - 32) ÷ 9) x 5

So you could do:

TARGET scale:0.55555555556:yourrrdfile.rrd - static:17.77777777778:17.77777777778

I've never tried that, but it *looks* like it would work :-) It's early in the morning and I've had no sleep and no coffee though...


(17.77777777778 is 32 * 5 /9)
(0.5555555 is 5/9)
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!)
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

What you are seeing on my example is an external temp probe on a ap9619 that is actually read in Fahrenheit, the OID for it (1.3.6.1.4.1.318.1.1.10.2.3.2.1.4) reads either in Fahrenheit or Celsius depending on the settings under System->Preferences using the APC web interface. I have noticed the internal sensors ignore this setting,I considered creating a CDEF in cacti to handle this (that way the graphs would display Fahrenheit as well) but decided against it.

On my maps in the areas that I don't have the external sensors I have an additional scale/setup that displays them in Celsius so I know what I am looking at and no-one panics when they see Temps in the 90's.
runlikeanantelope
Cacti User
Posts: 63
Joined: Thu Feb 15, 2007 12:08 pm

Post by runlikeanantelope »

Excellent Idea!!

I've incorporated this for a Policy-Map we run. At a certain time of the day, we kick in a policy that limits a certain subnet to the amount of bandwidth they get on our ISP link. I graph the QOS OID's to show me both how much traffic exceeded from the policy, and the Subnet 1 vs. Subnet 2 which during the limit, shows a flatline of the restricted subnet.

I've incorporated your idea to show me a "green lock" under the border router when the policy is enforced, but not limiting traffic, and a "red lock" when the policy is enforced and traffic is being exceeded (or dropped). I can also hover over the lock to show me the graph of how much traffic is being dropped.

Did you create those *.png icons yourself, or do you have a link for other ones? I think a Police Badge might be more appropriate than a lock in my situation :)
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

I created them myself, I could not find Icons/pngs that looked decent once I reduced them to the size I wanted
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

One good place to look for those kinds of things is the wingdings/webdings fonts. There are a lot of symbol fonts out there on the web, with interesting monochrome symbols for things.
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!)
MU-IT
Cacti User
Posts: 113
Joined: Tue Nov 06, 2007 12:07 pm

Post by MU-IT »

Howie wrote:Well, C= ((F - 32) ÷ 9) x 5

So you could do:

TARGET scale:0.55555555556:yourrrdfile.rrd - static:17.77777777778:17.77777777778

I've never tried that, but it *looks* like it would work :-) It's early in the morning and I've had no sleep and no coffee though...


(17.77777777778 is 32 * 5 /9)
(0.5555555 is 5/9)
Howie, it looks good, i just can't figure out where to put it where it works :D . The device ignores any C or F settings on the APCUPS that's for sure. I have the CDEF in place, but it only cares when it's making its graphs, the data in the db is in C.
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

Using my example above, I think he meant like this for Celsius to Fahrenheit

Code: Select all

NODE somewherecommUPS
        TEMPLATE temp
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=248
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=248
        #TARGET gauge:/usr/local/share/cacti/rra/somewhere_com_ups_check_tempprobe_437.rrd:check_tempProbe:-
        TARGET scale:1.8:/usr/local/share/cacti/rra/somewhere_com_ups_check_tempprobe_437.rrd:check_tempProbe:check_tempProbe + static:32:32
        POSITION somewherecommUPStemp 35 0 
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

colejv wrote:Using my example above, I think he meant like this for Celsius to Fahrenheit

Code: Select all

NODE somewherecommUPS
        TEMPLATE temp
        INFOURL /cacti/graph.php?rra_id=all&local_graph_id=248
        OVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=120&graph_width=650&local_graph_id=248
        #TARGET gauge:/usr/local/share/cacti/rra/somewhere_com_ups_check_tempprobe_437.rrd:check_tempProbe:-
        TARGET scale:1.8:/usr/local/share/cacti/rra/somewhere_com_ups_check_tempprobe_437.rrd:check_tempProbe:check_tempProbe + static:32:32
        POSITION somewherecommUPStemp 35 0 
Yes, that looks about right. I always think of F as the 'wrong' one you are trying to get away from :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
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

Howie,

I'm seeing an odd issue with following the example for converting C to F on the target line of the config.

Here's an excerpt of my config

Code: Select all

NODE BE_SVR_MB
        TEMPLATE UPStemp
        INFOURL /graph.php?rra_id=all&local_graph_id=519
        OVERLIBGRAPH /graph_image.php?rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300&local_graph_id=519
        TARGET scale:1.8:/var/www/html/rra/62/625.rrd:mb_temp_qry:mb_temp_qry + static:32:32
        POSITION 250 250
Which is pretty similar to the previous examples, but when the map is created, it displays the correct values, but I continually get errors in the log:

Code: Select all

08/11/2009 12:00:34 PM - WEATHERMAP: Poller[0] WARNING: [Map 8] test.conf: ReadData: NODE HOST, target: scale:1.8:/var/www/html/rra/62/625.rrd:mb_temp_qry:mb_temp_qry + static:32:32 on config line 40 was not recognised as a valid TARGET [WMWARN08]
I'd like to try to resolve this so that cacti stops kvetching about errors on the maps. I've tried to enclose the target value in double quotes per the documentation but when that is done, the map only displays zeros for that target.

Any ideas?
[b]Cacti Version[/b] - 0.8.7d
[b]Plugin Architecture[/b] - 2.4
[b]Poller Type[/b] - Cactid v
[b]Server Info[/b] - Linux 2.6.18-128.1.6.el5
[b]Web Server[/b] - Apache/2.2.3 (CentOS)
[b]PHP[/b] - 5.2.9
[b]MySQL[/b] - 5.0.45-log
[b]RRDTool[/b] - 1.3.0
[b]SNMP[/b] - 5.3.2.2
[b]Plugins[/b]PHP Network Managing v0.6.1, Global Plugin Settings v0.6,thold v0.4.1,XMLPort v0.3.5,CactiCam v0.1.5,NetTools v0.1.5,pollperf v0.32,RRD Cleaner v1.1,sqlqueries v0.2,superlinks v0.8,syslog v0.5.2,update v0.4,discovery v0.9,zond v0.34a,hostinfo v0.2,Bloom v0.6.5,mactrack v1.1,weathermap v0.96a,mobile v0.1
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests