[Nagiosplug-help] check_snmp help

Subhendu Ghosh sghosh at sghosh.org
Thu Dec 18 16:17:01 CET 2003


On Wed, 17 Dec 2003, Tom Diehl wrote:

> Hi all,
> I am trying to use check_snmp to check disk space. The example
> in checkcommands is
> /usr/lib/nagios/plugins/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o .1.3.6.1.4.1.2021.9.1.7.$ARG2$,.1.3.6.1.4.1.2021.9.1.9.$ARG2$ -w $ARG3$:,:$ARG4$ -c $ARG5$:,:$ARG6$ -u 'kB free (','% used)' -l 'disk space'

These oids are from the net-snmp project's snmp agent and their private 
MIB.  It works on most if not all *nixes. Does not work on windows afaik.

> 
> when I look at the mib for the machine I am trying to test
> I do not have the oid listed above.
> For disk checks I have the following oid's
> HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: A:\
> HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: C:\ Label:  Serial Number ac2a1db5
> HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: D:\
> HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: E:\ Label:  Serial Number ec31976f
> HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: Virtual Memory
> HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 0 Bytes
> HOST-RESOURCES-MIB::hrStorageAllocationUnits.2 = INTEGER: 4096 Bytes
> HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 0 Bytes
> HOST-RESOURCES-MIB::hrStorageAllocationUnits.4 = INTEGER: 4096 Bytes
> HOST-RESOURCES-MIB::hrStorageAllocationUnits.5 = INTEGER: 65536 Bytes
> HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 0
> HOST-RESOURCES-MIB::hrStorageSize.2 = INTEGER: 4982150
> HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 0
> HOST-RESOURCES-MIB::hrStorageSize.4 = INTEGER: 767607
> HOST-RESOURCES-MIB::hrStorageSize.5 = INTEGER: 9264
> HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 0
> HOST-RESOURCES-MIB::hrStorageUsed.2 = INTEGER: 1174945
> HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 0
> HOST-RESOURCES-MIB::hrStorageUsed.4 = INTEGER: 420126
> HOST-RESOURCES-MIB::hrStorageUsed.5 = INTEGER: 2269
> 
> The above values seem to be 
> hrStorageSize * hrStorageAllocationUnits = total disk size and
> hrStorageUsed * hrStorageAllocationUnits = disk used.

right now check_snmp does not support calculations on retrieved oids.

in contrib dir you will find a check_disk_snmp.pl which does the 
calculation, but it only support SNMPv3 (there is no v3 support from 
Microsoft as yet).  You could modify this to add v1/v2c support...

> 
> So my question is how can I feed this to check_snmp to get 
> a disk space check out of nagios that is useful?
> 
> If there is a doc I am missing a pointer would be appreciated.
> 
> Can someone please tell me what I am missing??
> 
> ................Tom

-- 

-sg





More information about the Help mailing list