[SOLVED] Creating stand alone values CPU,packetloss,latency?

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

cdnvballer
Cacti User
Posts: 89
Joined: Fri May 25, 2007 1:18 pm

Post by cdnvballer »

Hi,

can someone clear this up for me?
I'm have the Advanced Ping templates working and I'd like to add a node with Average Latency value to my weathermap.
I have the following in my node's config:

NODE node1208821722
LABEL Latency
INFOURL http://myserver/cacti/graph.php?rra_id= ... ph_id=1996
OVERLIBGRAPH http://myserver/cacti/graph_image.php?l ... _width=300
TARGET gauge:/srv/www/htdocs/cacti/rra/gw1_rtr_loss_2059.rrd:loss:avg
POSITION 145 143

the OVERLIBGRAPH part works fine, but I have no idea how to reference the avg latency value from my rrd and then put that into the Label.
Can someone pls help? I'm all confused :(

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

Post by Howie »

OK. Once again:

1) In the TARGET, those loss and avg on the end must be the names of DS in your rrd file - check by either looking at the cacti.log for Weathermap complaining that they are not, or by running 'rrdtool info yourfile.rrd'.

2) The weathermap rrd plugin uses those DS names as the 'in' and 'out' value for your link or node (nodes have an in and out value too).

3) So regardless of what the rrd DS are called, the string for the label (if you want the 'in' value) will always be: {node:this:bandwidth_in} or {node:this:inpercent} (if you want a percentage of BANDWIDTH/MAXVALUE instead).

In your TARGET line, the latency is the out value (I assume avg is latency), so that would be:

Code: Select all

NODE node1208821722 
LABEL Latency  {node:this:bandwidth_out}ms
INFOURL http://myserver/cacti/graph.php?rra_id=all&local_graph_id=1996 
OVERLIBGRAPH http://myserver/cacti/graph_image.php?local_graph_id=1996&rra_id=0&graph_nolegend=true&graph_height=100&graph_width=300 
TARGET gauge:/srv/www/htdocs/cacti/rra/gw1_rtr_loss_2059.rrd:loss:avg 
POSITION 145 143 
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!)
cdnvballer
Cacti User
Posts: 89
Joined: Fri May 25, 2007 1:18 pm

Post by cdnvballer »

thanks it makes sense now, after I looked at the cacti log :)
cdnvballer
Cacti User
Posts: 89
Joined: Fri May 25, 2007 1:18 pm

Post by cdnvballer »

one last question:

the latency values being reported are pretty lenghty..
any way I can round them to 2-3 digits to the right of the decimal place?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

cdnvballer wrote:one last question:

the latency values being reported are pretty lenghty..
any way I can round them to 2-3 digits to the right of the decimal place?
Yes. This is the bit that's apparently not documented :oops:

{node:this:bandwidth_in:%.2f} will give you 2 decimal places
{node:this:bandwidth_in:%d} will give you an integer

That last part is optional, and gives you control over the formatting of the number. It uses the same tokens as printf() does in C, php, perl etc...

There's one other option: %k, which uses weathermap's kilo/mega/giga/milli formatting. e.g. 12300212 -> 12.3M and 0.0034 -> 3.4m
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!)
thomasj
Posts: 12
Joined: Thu Mar 27, 2008 10:45 am

Post by thomasj »

Hi!

Have been busy with other stuff for a couple of weeks but gave this a new try today.

Can someone explain why node03871 in the picture is red and the others are green. Here are the config for these four.

Code: Select all

NODE node00576
        LABEL {node:this:bandwidth_out:%d} NonUnicast/s
        TARGET gauge:/var/www/cacti/rra/r-adm-stadshus_nonunicast_out_536.rrd:-:nonunicast_out
        POSITION 212 399

NODE node03161
        LABEL {node:this:bandwidth_in:%d} NonUnicast/s
        TARGET gauge:/var/www/cacti/rra/r-adm-stadshus_nonunicast_out_536.rrd:nonunicast_in:-
        POSITION 149 484

NODE node03502
        LABEL {node:this:bandwidth_out:%d} Unicast/s
        TARGET gauge:/var/www/cacti/rra/r-adm-stadshus_unicast_in_537.rrd:-:unicast_out
        POSITION 174 427

NODE node03871
        LABEL {node:this:bandwidth_in:%d} Unicast/s
        TARGET gauge:/var/www/cacti/rra/r-adm-stadshus_unicast_in_537.rrd:unicast_in:-
        POSITION 128 511
Attachments
node.jpg
node.jpg (16.92 KiB) Viewed 10058 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

What does the SCALE look like? That's what decides the colours...
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!)
thomasj
Posts: 12
Joined: Thu Mar 27, 2008 10:45 am

Post by thomasj »

This is what the scale looks like. Since SCALE is the same for all four and the second one is even higher than the bottom one i did not think it had anything to do with that.

Code: Select all

SCALE DEFAULT 0 75   0 255 0   255 255 0
SCALE DEFAULT 76 100   255 255 0   255 0 0
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Nothing else changes the colours...

I think what it is is that the default setup for nodes is to use the 'in' value to colour the node (it has to use one or the other). The one that is red is the only one with a large 'in' value. The other large value is on the 'out' side.

If you don't want them to change colour at all, then set use USESCALE none.

If you want them all to change colour the same way, then use USESCALE DEFAULT out on the ones that have an 'out' value but no 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!)
thomasj
Posts: 12
Joined: Thu Mar 27, 2008 10:45 am

Post by thomasj »

Solved again! (Found the MAXVALUE to set the values the same way as BANDWIDTH)

Thanks!

/Thomas
laamidd
Posts: 48
Joined: Fri Feb 17, 2006 10:31 am

Post by laamidd »

For Windows, I had to use the full path to the .rrd. That was my problem it seems. Everything that should have worked, does now.

Code: Select all

NODE AtlanticCityWClatency        
	LABEL Latency {node:this:bandwidth_out:%.2f} ms 
	TARGET gauge:D:\cacti8.7b\rra\atlantic_city_wc_-_10_6_12_5_loss_159.rrd:-:avg
Thanks,
Bob
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

laamidd wrote:For Windows, I had to use the full path to the .rrd. That was my problem it seems. Everything that should have worked, does now.

Code: Select all

NODE AtlanticCityWClatency        
	LABEL Latency {node:this:bandwidth_out:%.2f} ms 
	TARGET gauge:D:\cacti8.7b\rra\atlantic_city_wc_-_10_6_12_5_loss_159.rrd:-:avg
Thanks,
Bob
And you weren't getting any errors about non-existent files? That's weird. Oh well.
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!)
laamidd
Posts: 48
Joined: Fri Feb 17, 2006 10:31 am

Post by laamidd »

And you weren't getting any errors about non-existent files? That's weird. Oh well.
Nope. I just had time to look at this again and it jumped out at me when I looked at Thomasj's code. He has the path to the file, so I tried that and it's all good now.

Thanks again,
Bob
laamidd
Posts: 48
Joined: Fri Feb 17, 2006 10:31 am

Post by laamidd »

This works for me now too:

Code: Select all

NODE testnode
   LABEL testnode
   POSITION 89 182
   TARGET gauge:D:\cacti8.7b\rra\atlantic_city_wc_-_10_6_12_5_loss_159.rrd:-:avg
 
NODE testnodeLatency
  POSITION testnode 0 30
  LABEL Latency {node:testnode:bandwidth_out} ms
The result is on the left side of the map. What's on the right, is from the code from my last post. Sorry for the big .png, but I can't manipulate photos on the web at work.

Image

Thanks,
Bob
Lonlie
Posts: 23
Joined: Thu Jun 05, 2008 3:36 am
Location: France

Post by Lonlie »

Hello,

I read all messages, but i have a problem with the CPU. I don't konw how do you do to recover this. I wrote :

NODE test
LABEL {node:this:name} %
TARGET C:/Apache2.2/htdocs/cacti/rra/lol_traffic_in_36.rrd
POSITION 212 399

I don't know for "name" what I should write.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests