[Nagiosplug-help] Post-processing with check_snmp possible?

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Wed Sep 19 13:03:11 CEST 2007


Hello,

we got a bunch of environment sensors for our data center
for which I just have defined new services.
Thanks to check_snmp and a MIB supplied by the vendor
this was pretty straight forward and works well.

However, while studying the MIB I came accross another OID
to fetch a temperature reading at a higher resolution.
But because this OID is of type Integer it only can be fetched
multiplied by 10, which means that the fetched result needs to be
devided by 10 to arrive at the real value.

Let me show you the differences of two ordinary snmpgets.

$ snmpget -m SPAGENT-MIB -v1 -OQve sensor_r04
sensorProbeTempDegree.0
24

$ printf "scale=2;%d/10\n" $(snmpget -m SPAGENT-MIB -v1 -OQve
sensor_r04 sensorProbeTempDegreeRaw.0)|bc
23.60

I wonder if this devision by 10, as in the second snmpget, can be
accomplished as some sort
of post-processing by check_snmp on the fly?
>From its help screen however this doesn't seem to be so.

Of course I could script some wrapper around check_snmp,
but then I guess I would be better off to discard check_snmp
altogether 
and write a custom Perl plugin with Net::SNMP or some other handy
module.

Another option probably would be to raise the warn and crit
thresholds by factor 10?

$ check_snmp -H sensor_r04 -o sensorProbeTempDegree.0 -w 15:40 -c
5:55 -m SPAGENT-MIB 
SNMP OK - 24 | SPAGENT-MIB::sensorProbeTempDegree.0=24  
 
$ check_snmp -H sensor_r04 -o sensorProbeTempDegreeRaw.0 -w 15:40
-c 5:55 -m SPAGENT-MIB 
SNMP CRITICAL - *236* |
SPAGENT-MIB::sensorProbeTempDegreeRaw.0=236  
 
$ check_snmp -H sensor_r04 -o sensorProbeTempDegreeRaw.0 -w
150:400 -c 50:550 -m SPAGENT-MIB 
SNMP OK - 236 | SPAGENT-MIB::sensorProbeTempDegreeRaw.0=236  





More information about the Help mailing list