[Nagiosplug-help] check_snmp string handling issue and perfdata
tonvoon at gmail.com
Tue Sep 28 13:56:53 CEST 2010
On 28 Sep 2010, at 12:22, Dánial Olsen wrote:
> Something has changed between 1.4.14 and 1.4.15 in check_snmp
> handling of string values.
> Among other things I use check_snmp for reading temperature on my
> Soekris boxes
> (running sensorsd on OpenBSD 4.6).
> snmpget -v 2c -c public 10.0.0.2 .184.108.40.206.4.1.30220.127.116.11.1.5.3
> SNMPv2-SMI::enterprises.3018.104.22.168.1.5.3 = STRING: "53.00"
> Version 1.4.15:
> ./check_snmp -H 10.0.0.2 -o .22.214.171.124.4.1.30126.96.36.199.1.5.3 -w 50 -c
> SNMP OK - "53.00" |
> Version 1.4.14:
> ./check_snmp-old -H 10.0.0.2 -o .188.8.131.52.4.1.30184.108.40.206.1.5.3 -w
> 50 -c 60
> SNMP WARNING - *53* | iso.220.127.116.11.1.3018.104.22.168.1.5.3=53
> As can be seen from the output above, version 1.4.15 displays OK
> instead of
> WARNING and outputs no performance data.
> Version 1.4.14 displays the expected behaviour, the warning works and
> performance data is there.
You'll find that that OID location says it is returning a string
value, rather than a numeric value. Adding -v -v -v should show this.
The code was tightened because it was trying to do threshold checks
against string values (which happened to be converted to a number ok),
which doesn't make sense.
I guess a flag would be required to say "force this string value into
a numeric (float?) value" and do the comparison. But I think the
default behaviour for a string returned type should be to not compare
More information about the Help