Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Weathermap 0.9pre1 node value differs from graphed value

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
SeanW



Joined: 28 Nov 2006
Posts: 24
Location: Winnipeg, Canada

PostPosted: Wed Mar 21, 2007 4:05 pm    Post subject: Weathermap 0.9pre1 node value differs from graphed value Reply with quote

I'm trying to display a load balancer along with the current session count beside it. I've also done an OVERLIBGRAPH for the node so that I can see the historical session usage:

Code:
NODE lb2
        LABEL LB2
        INFOURL http://cacti/cacti/graph_view.php?action=tree&tree_id=4&leaf_id=140
        OVERLIBGRAPH http://cacti/cacti/graph_image.php?action=view&local_graph_id=874&rra_id=1
        TARGET /usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:5_Sec_Avg:- /usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:-:5_Sec_Avg
        POSITION 340 318
        USESCALE LBSCALE

NODE lb2_sessions
        LABEL {node:lb2:bandwidth_out:} Sessions
        POSITION lb2 90 0


However the number of sessions differs greatly between what's in the graph and what's displayed on the node. I grabbed the rrd name from the graph's debug output so I know it's the right RRD.

Am I using the TARGET and LABEL correctly?

Thanks,

Sean



weathermap1.jpg
 Description:
screen shot showing difference between displayed values
 Filesize:  31.88 KB
 Viewed:  846 Time(s)

weathermap1.jpg


Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2135
Location: United Kingdom

PostPosted: Wed Mar 21, 2007 4:47 pm    Post subject: Re: Weathermap 0.9pre1 node value differs from graphed value Reply with quote

SeanW wrote:
I'm trying to display a load balancer along with the current session count beside it. I've also done an OVERLIBGRAPH for the node so that I can see the historical session usage:

Code:
NODE lb2
        LABEL LB2
        INFOURL http://cacti/cacti/graph_view.php?action=tree&tree_id=4&leaf_id=140
        OVERLIBGRAPH http://cacti/cacti/graph_image.php?action=view&local_graph_id=874&rra_id=1
        TARGET /usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:5_Sec_Avg:- /usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:-:5_Sec_Avg
        POSITION 340 318
        USESCALE LBSCALE

NODE lb2_sessions
        LABEL {node:lb2:bandwidth_out:} Sessions
        POSITION lb2 90 0


However the number of sessions differs greatly between what's in the graph and what's displayed on the node. I grabbed the rrd name from the graph's debug output so I know it's the right RRD.

Am I using the TARGET and LABEL correctly?

Thanks,

Sean


Nearly!

A few little things: you may want to have either {node:lb2:bandwidth_out} or {node:lb2:bandwidth_out:%k}. Technically, the loose : on the end is not really valid, although apparently it works at the moment Adding %k to the end will format the number with a K,M,G etc as appropriate (like your graph does). In fact it'd be %0.2k to match your graph's format with 2 decimal places.

Most importantly though, your rrd is a GAUGE rather than the normal interface byte-counters, so you need to use a slightly different TARGET line:
Code:

TARGET [b]gauge:[/b]/usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:5_Sec_Avg:- /usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:-:5_Sec_Avg


The gauge: tells the RRD data source plugin NOT to multiply the result by 8, as it would otherwise do (to convert a byte counter into bits/second).

And that should do it
Back to top
SeanW



Joined: 28 Nov 2006
Posts: 24
Location: Winnipeg, Canada

PostPosted: Thu Mar 22, 2007 7:52 am    Post subject: Fixed! Reply with quote

Howie wrote:

Most importantly though, your rrd is a GAUGE rather than the normal interface byte-counters, so you need to use a slightly different TARGET line:
Code:

TARGET [b]gauge:[/b]/usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:5_Sec_Avg:- /usr/share/cacti/rra/xxx_5_sec_avg_1065.rrd:-:5_Sec_Avg



That worked, thanks! (Since I was using bandwidth_out I had to do it on the second RRD, but it was the gauge: that did it)

Howie wrote:

The gauge: tells the RRD data source plugin NOT to multiply the result by 8, as it would otherwise do (to convert a byte counter into bits/second).


Can't this be extracted from the RRD itself?

Code:

# rrdtool info xxx.rrd | grep type
ds[5_Sec_Avg].type = "GAUGE"


On another note, tracing through lib/datasources/WeatherMapDataSource_rrd.php was helpful, and also lead me to notice some of the other plugins you have there like SNMP and external!

Thanks again,

Sean
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 2135
Location: United Kingdom

PostPosted: Thu Mar 22, 2007 8:01 am    Post subject: Re: Fixed! Reply with quote

SeanW wrote:

Can't this be extracted from the RRD itself?

Code:

# rrdtool info xxx.rrd | grep type
ds[5_Sec_Avg].type = "GAUGE"



That's true, but it doesn't tell you if the source data was from an SNMP Interface octet counter or not, which is what you really need to know. Since what most people do with weathermap is map networks from such data, it's the default.

SeanW wrote:


On another note, tracing through lib/datasources/WeatherMapDataSource_rrd.php was helpful, and also lead me to notice some of the other plugins you have there like SNMP and external!

Thanks again,

Sean


Those two are a little untested, but I'd be interested in feedback on them. I have found that PHP's SNMP is a little patchy. For example, it is sometimes possible to get numeric data out of a gauge oid, but not always. Having said that, this week I've been playing in cacti's snmp.php, trying to debug something, so possibly I'll improve the SNMP plugin based on that.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group