Trouble with Graphing snmp data

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

Trouble with Graphing snmp data

Post by zedstar »

Hi all,

Im having a slight problem with collecting snmp data and graphing it with rrdtool under cacti. I am collecting data via a script and using MIB krTotUsedSwapSpace.0 which gives me swap usage on a box. in the cron printout i can see that it is using 6836208 kb of swap and have setup the graph to display this, alas this is not showing up and all i get is a blank graph even though the data is updating in the cron printout.

Any ideas? (yes i have selected a color ;)

thanks guys !
Flux
Posts: 39
Joined: Fri Nov 01, 2002 12:37 pm

Post by Flux »

Just out of curiousity, are your default graphs (the ones that came with Cacti) displaying anything?

Flux :o
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

Post by zedstar »

this is something everyone here should understand, cacti needs to be operating system configured. It wont just work out of the box, I have had to modify the scripts and cacti setup specifically for solaris for things to work. Using the internal scripts (which reside in the php code) will look at the local machine, you need to create your custom scripts or edit the ones in ~cacti/scripts directory and modify them for the OS cacti is sitting on and call it from the cacti web page.

In answer to your question though, yes some of the graphs do display.
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

rrdtool

Post by zedstar »

So can anyone help me with rrdtool not displaying properly? I am really confused as it doesnt really make sense why this particular graph isnt displaying properly(and how the others are retrieving the Y axis value).


Here is the cron printout which is showing the correct output for my swap space usage.

perl /var/apache/htdocs/orca/cacti/scripts/snmp_swap_space.pl ldnroemcr1.uk.ml.com:7777 public krTotUsedSwapSpace.0 9658488


Here is a link to the graphs which are currently being displayed. Please ignore the cpu wait time and and traffic analysis for the moment.

Image
Image
Image


What really gets me is how in gods name can u set the Y axis value? where is rrdtool getting this "m" value and the amount being displayed? how are figures like 9658488 relating to 334.5m ?


Really confused here and could do with some help...


I hope you guys can help!

thanks


Z :roll:
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Are you sure that you set your Data Source as GAUGE? If it is set to COUNTER then only used space changes are presented on the graph.

- bulek
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

Post by zedstar »

Absolutley no difference what so ever. Believe me I have tried all sorts of configurations.

rrdtool is my bain.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Ok then... can you make rrddump on your rrd file? Double check that DS is GAUGE and look what values are stored in the file.

- bulek
sachar
Posts: 14
Joined: Sun Apr 21, 2002 9:52 pm

Post by sachar »

I think the only way to get the snmp output to a bit of an human readable format is to create a CDEF: CDEF:cdefa=a,1024,* \

About the not displaying part, if you create a gprint for that DS, does it return a NAN value? If so I'm having the same problem with some diskspace SNMP data:

http://www.raxnet.net/board/viewtopic.php?t=1150
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

rrdtool and NAN values

Post by zedstar »

Guys,


Yep I am having NAN values in the rrd database. Thus I imagine rrdtool cannot graph but why is this? The actual cron printout shows 85578 (+/-).Do i have to do some other jiggery pokery for it to work? Do I need a special CDEF to work this out? Does a CDEF work over the result in the database before the graph is generated? (me thinks about reading from start again).

<!-- Round Robin Database Dump -->
<rrd>
<version> 0001 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1041646505 </lastupdate> <!-- 2003-01-04 02:15:05 GMT -->

<ds>
<name> ldnroemcr1_swapused </name>
<type> GAUGE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+00 </max>

<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 0.0000000000e+00 </value>
<unknown_sec> 5 </unknown_sec>
</ds>

<!-- Round Robin Archives -->
<rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds -->
<xff> 5.0000000000e-01 </xff>

<cdp_prep>
<ds><value> NaN </value> <unknown_datapoints> 0 </unknown_datapoints></ds>
</cdp_prep>
<database>
<!-- 2003-01-02 00:20:00 GMT / 1041466800 --> <row><v> NaN </v></row>
<!-- 2003-01-02 00:25:00 GMT / 1041467100 --> <row><v> NaN </v></row>


Check this out though....

Here i have a database for the number of mutex spin locks i have on a system.

<!-- Round Robin Database Dump -->
<rrd>
<version> 0001 </version>
<step> 300 </step> <!-- Seconds -->
<lastupdate> 1041870903 </lastupdate> <!-- 2003-01-06 16:35:03 GMT -->

<ds>
<name> ldnroemcr1_mutex </name>
<type> ABSOLUTE </type>
<minimal_heartbeat> 600 </minimal_heartbeat>
<min> 0.0000000000e+00 </min>
<max> 1.0000000000e+00 </max>

<!-- PDP Status -->
<last_ds> UNKN </last_ds>
<value> 2.1601416486e-01 </value>
<unknown_sec> 0 </unknown_sec>
</ds>

<!-- Round Robin Archives -->
<rra>
<cf> AVERAGE </cf>
<pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds -->
<xff> 5.0000000000e-01 </xff>

<cdp_prep>
<ds><value> NaN </value> <unknown_datapoints> 0 </unknown_datapoints></ds>
</cdp_prep>
<database>
<!-- 2003-01-04 14:40:00 GMT / 1041691200 --> <row><v> 2.2560784314e-02 </v></row>


so I am receiving results but they dont relate to the actual snmp get results which are like so "19.4117647058824" . What am i doing wrong.

RRD masters in da house?
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Now it's much more clear :)

First of all in both cases you have set minimum value to 0 and maximum value to 1. This causes any value outside of 0-1 to be discarded. Your values are much bigger so... most of them are not stored in rrd file.

Now one thing more about your mutex counter. You used ABSOLUTE as a DS type. This means you are measuring rate of changes in number of spin locks. Additionaly this type of DS assumes the counter is reset after every read attempt. I think you should use GAUGE instead (I assume it is oscilating number rather than constantly growing value).

- bulek
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

Post by zedstar »

and guess what......CACTI is the one causing the issue. Everyone try this, update your cacti data source and change it to lets say "GAUGE", now dump out the data and see what it says... yes you guessed it its still "ABSOLUTE" (even though I told it to update the file). Something fishy is going on, I sometimes find that when i change something and go back to its options its gone back to what it was before i changed it. Very odd...

I`m wondering about creating the database from fresh
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

This issue has been discussed here. Normaly you are taking care of permissions to update rrd files for your cron user. In case of modification rrd file definition (like changing type or min/max values) you need to give the same rights to your apache/httpd user. You will be able succesfully update your DS when you provide proper access rights to your web server user.

- bulek
zedstar
Posts: 8
Joined: Mon Dec 23, 2002 3:55 am

Post by zedstar »

Bulek

you have been a great help, appreciate your time. I`m just getting frustrated with the thing and missing key points :( . However now that the data sources are updating I am still unable to receive 1) correct Y values for my data source even though graphs are being plotted (for mutex locks) and 2) have correct data in my rrd database (still getting NAN values) for my memory used values in this case 85188 +/- .

how does Unit Exponent Value affect the Y axis values? the only examples i can find it setting 3 for k values and -6 for u (micro).

hope you can help me.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

ad. 1) You wrote you can't get correct values. I would need more details... graph example, why do you think it's not correct, what are expected values?

ad. 2) I'm affraid I need to look at dump of your rrd file again after the changes you made. Also copy/paste here an rrd update line from rrd.log.

As far as I understand exponent value multiplies Y by 10^x (where x is the exponent value). So 10^3 is k (kilo) and 10^-6 is u (micro). THis should work similar for other values like G, m, etc.

- bulek
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests