snmp disk percentages
Alan Silver
silver at biostat.wisc.edu
Wed Apr 13 16:25:56 CEST 2005
Hi all:
I have been using nagios for a few years now and I was just going
through my configs and changing the way I do things.
Suffice it to say, I have been trying to use some of the new plugins
that allow you to grab the disk percentage used for a filesystem via
snmp. And I have been coming up with percentages which are slightly
different than what df -k is saying (2-5%). Here are a few examples.......
BTW, I have tried these perl scripts on a solaris 8 box running nagios
1.2 and a redhat enterprise linux 4 box running 2.0b2. Both instances
gave me the same "inaccurate" answers.
So, here is some info for you to look at:
Here is the df of the box I would like to monitor, call it gilead
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t0d0s0 962134 181392 723014 21% /
I used
[root at gandalf contrib]# ./check_snmp_disk_monitor.pl -H gilead -C mejis
-s -m /
Disk OK - 19% used on /|/,985225216,185745408
[root at gandalf contrib]# ./check_snmp_storage.pl -H gilead -C mejis -m
/ -r -w 80 -c 81
/ : 19 %used (177MB/940MB) (< 80) : OK
[root at gandalf contrib]# ./disk_by_snmp gilead mejis 1 30 40
Disk usage: 177 MB used, 762 MB (81%) free.
If I use straight snmp to walk gilead, I can see:
.iso.org.dod.internet.private.enterprises.ucdavis.dskTable.dskEntry.dskPercent.1
= INTEGER: 20
(which is also slightly off when compared with df -k)
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageDescr.1
= STRING: /
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageAllocationUnits.1
= INTEGER: 1024 Bytes
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.1
= INTEGER: 962134
.iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.1
= INTEGER: 181392
So, I guess my issue with how these scripts are calculating disk
percentage based on the disk used / disk alloted. Which may not be
completely accurate with how much percentage is still usable for the
user. Does anyone know of a script which goes after the
.iso.org.dod.internet.private.enterprises.ucdavis.dskTable.dskEntry.dskPercent
oid instead of trying to calculate from disk used/disk allocated? I
have used check_snmp in the past. But since different partitaion are
indexed different on my hosts, I was hoping someone had a nice perl
program which took care of the index issue for me
Thanks
alan
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list