Graphing vmstat page operations

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

Moderators: Developers, Moderators

Post Reply
tman
Cacti User
Posts: 97
Joined: Thu Oct 14, 2004 4:14 pm

Graphing vmstat page operations

Post by tman »

I want to use Cacti to graph specific vmstat information from net-snmp hosts. It seems that the counters I want to graph are listed in the mib tree, but there are no values associated with them, i.e. all other counters in this part of the tree return values except these.

memoryPagesPerSec .1.3.6.1.4.1.2021.4.10
memoryPagesOutputPerSec .1.3.6.1.4.1.2021.4.9
memoryPagesInputPerSec .1.3.6.1.4.1.2021.4.8
memoryPageFaultsPerSec .1.3.6.1.4.1.2021.4.7

So the question is, has anyone done this in Cacti already with these specific OID's, and if not, does net-snmp have to be compiled in a certain way to expose these values via snmp? If I can get these OID's to return values, I'm happy to build the graph.
bbice
Cacti User
Posts: 71
Joined: Mon May 13, 2002 6:53 pm

Re: Graphing vmstat page operations

Post by bbice »

tman wrote:memoryPagesPerSec .1.3.6.1.4.1.2021.4.10
memoryPagesOutputPerSec .1.3.6.1.4.1.2021.4.9
memoryPagesInputPerSec .1.3.6.1.4.1.2021.4.8
memoryPageFaultsPerSec .1.3.6.1.4.1.2021.4.7

So the question is, has anyone done this in Cacti already with these specific OID's, and if not, does net-snmp have to be compiled in a certain way to expose these values via snmp? If I can get these OID's to return values, I'm happy to build the graph.
I'm not getting anything on those OIDs either, and I compiled net-snmp from source and thought I'd enabled pretty much everything that was supported on my platform (linux x86 on this machine). They probably only return values on certain platforms. As I recall, at a previous job when I wanted to graph paging, I wrote a quickie script that ran vmstat, grep and awk to cull out just the values I wanted, then configured net-snmp to run my script (telling it which value I wanted to get). I think I used the "exec" statement in the snmpd.conf file to call the script.

Then I used the MIB OIDs for the "extensible" part of the net-snmp mib tree which mapped to calling my script to get the values and fed those OIDs into cacti as data templates.

This (scripts 'n net-snmp's exec command) works pretty well for getting single variables from a machine to graph. I had scripts to do all sorts of things that net-snmp would call, such as getting the internal temp from an APC UPS from a log file, or counting the number of spam rejections on a mail proxy or counting the number of clearcase licenses in use -- all sorts of stuff.

If you have a whole batch of data you want to make available via net-snmp, using a smarter script and net-snmp's "pass" function is better (net-snmp will pass an entire mib tree to your script and let your script handle the query). There are some good examples of this if you poke around in the plugins/scripts forum. I made one myself recently to count the number of messages in the various postfix queues (which I unashamedly based on a similar script someone else posted that reported on the number of messages, bounced, deferred, relayed, delivered, etc). :-)

Brent
gsaray101
Cacti User
Posts: 233
Joined: Thu May 17, 2007 9:18 am

linux paging activity

Post by gsaray101 »

I also would like to graph paging activity on linux systems but I dont see any oid refering to paging. If you have that pass through script available, can you post it?

thanks,

mike
bbice
Cacti User
Posts: 71
Joined: Mon May 13, 2002 6:53 pm

Post by bbice »

I'm using these OIDs to monitor paging:
io_recvd: .1.3.6.1.4.1.2021.11.58.0
io_sent: .1.3.6.1.4.1.2021.11.57.0

As to the script, I don't have it handy, but it was something along
these lines:
#!/bin/bash
# si.bash get swap in
vmstat 1 2 |tail -1 |awk '{print $7 }'

#!/bin/bash
#so.bash get swap out
vmstat 1 2 |tail -1 |awk '{print $8 }'

I think my script was a little fancier -- I could pass it a parameter
that told it which column of output I wanted (for which variable I wanted
that vmstat prints). I b'lieve I also used the iostat command for some
stuff (on a Solaris system).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests