Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jun 28, 2017 10:37 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Tue Apr 22, 2008 1:46 am 
Offline
Cacti User

Joined: Fri May 25, 2007 1:18 pm
Posts: 89
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 22, 2008 2:00 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
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:
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 22, 2008 3:00 am 
Offline
Cacti User

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 22, 2008 3:32 pm 
Offline
Cacti User

Joined: Fri May 25, 2007 1:18 pm
Posts: 89
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 22, 2008 3:51 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 5:07 am 
Offline

Joined: Thu Mar 27, 2008 10:45 am
Posts: 12
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:
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 7574 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 5:14 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
What does the SCALE look like? That's what decides the colours...

_________________
Weathermap 0.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 5:53 am 
Offline

Joined: Thu Mar 27, 2008 10:45 am
Posts: 12
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:
SCALE DEFAULT 0 75   0 255 0   255 255 0
SCALE DEFAULT 76 100   255 255 0   255 0 0


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 6:09 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 6:42 am 
Offline

Joined: Thu Mar 27, 2008 10:45 am
Posts: 12
Solved again! (Found the MAXVALUE to set the values the same way as BANDWIDTH)

Thanks!

/Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 1:05 pm 
Offline

Joined: Fri Feb 17, 2006 10:31 am
Posts: 48
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:
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 1:08 pm 
Offline
Cacti Guru User
User avatar

Joined: Thu Sep 16, 2004 5:53 am
Posts: 5111
Location: United Kingdom
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:
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.98 is out! & QuickTree 0.2. Superlinks is over there now.
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!)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 1:28 pm 
Offline

Joined: Fri Feb 17, 2006 10:31 am
Posts: 48
Quote:
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 12, 2008 1:55 pm 
Offline

Joined: Fri Feb 17, 2006 10:31 am
Posts: 48
This works for me now too:
Code:
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 20, 2008 5:12 am 
Offline

Joined: Thu Jun 05, 2008 3:36 am
Posts: 23
Location: France
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group