Print the "Gauge" value to map

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Print the "Gauge" value to map

Post by davebyrne »

Hi all,

We have a number of Cisco devices that I would like to monitor temperatures of on a map and display for our NOC team.

Currently, I am using nodes and the TARGET line like below to show the different chassis modules and device temperatures underneath each place holder node

Code: Select all

NODE MAI-CORE-ROU2
        LABEL MAI-CORE-ROU2
        ICON images/Router.png
        POSITION 400 400

NODE MOD2-Earl-Out-MAI-CORE-ROU2
        LABEL MOD2-Earl-Out
        TARGET gauge:/var/www/cacti/rra/mai-core-rou2_cisc_mai_mod2_earou_1990.rrd:cisc_mai_mod2_earou:cisc_mai_mod2_earou
        POSITION 397 500
The only issue is, although the second node with the TARGET does indeed change its colour dependant on the scale, I cannot come up with a way for the map to print the actual data value along with this. Even if it involves making another node and pulling it from the RRD again, that's fine. But after running through the weathermap documentation quite a bit, I cant see this as a feature.

Am I missing something? Or is this actually not possible? It seems silly because the map at that point clearly knows the data value, to be able to match it to the scale, I just want to print it next to the chassis module name.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Print the "Gauge" value to map

Post by Howie »

You don't actually need two nodes to do that. You can have a label and an icon, and LABELOFFSET S, and weathermap will handle it for you. If you are very picky about the positioning of the label, you can also use pixel offsets for it.

To add the value itself, add {node:this:bandwidth_in} to the label.

If you want to add another node, and have it refer to that same value, you can do that too: LABEL {node:MAI-CORE-ROU2:bandwidth_in}
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!)
davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Re: Print the "Gauge" value to map

Post by davebyrne »

Howie wrote:You don't actually need two nodes to do that. You can have a label and an icon, and LABELOFFSET S, and weathermap will handle it for you. If you are very picky about the positioning of the label, you can also use pixel offsets for it.

To add the value itself, add {node:this:bandwidth_in} to the label.

If you want to add another node, and have it refer to that same value, you can do that too: LABEL {node:MAI-CORE-ROU2:bandwidth_in}
Perfect! Thankyou, I will admit I did see that in the docs, but misinterpreted how to implement it. Thankyou!!
davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Re: Print the "Gauge" value to map

Post by davebyrne »

Howie wrote:You don't actually need two nodes to do that. You can have a label and an icon, and LABELOFFSET S, and weathermap will handle it for you. If you are very picky about the positioning of the label, you can also use pixel offsets for it.

To add the value itself, add {node:this:bandwidth_in} to the label.

If you want to add another node, and have it refer to that same value, you can do that too: LABEL {node:MAI-CORE-ROU2:bandwidth_in}
A quick follow up question. Occasionally some of the values printed by {node:this:bandwidth_in} are not displayed as floationg point numbers, like 38.9999967*c. This breaks the format of my map somewhat as the box is wildly longer than its expected to be.

But on the next refresh the value is 39*c.. Any reason for the change in data value? And as a fix, is there any way to round the value of {node:this:bandwidth_in} to X decimal places?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Print the "Gauge" value to map

Post by Howie »

That's a side-effect of rrdtool. You are getting the average value of the last 5 minutes. Even if the actual measurement is an integer, if it changes from 2 to 3 halfway through the 5-minute polling period, the average value that weathermap gets will be 2.5

You can format the value for bandwidth_in in a number of ways, including forcing it to an integer {node:this:bandwidth_in:%d}

This is all here in the manual: http://network-weathermap.com/manual/0. ... formatting
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!)
davebyrne
Posts: 12
Joined: Tue Jun 13, 2017 3:23 pm

Re: Print the "Gauge" value to map

Post by davebyrne »

Ignore me... I'm a fool.

{node:this:bandwidth_in:%d}

forces data point to integer
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests