[Nagiosplug-help] check_snmp string handling issue and perfdata

Ton Voon 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  
> regarding
> 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 .1.3.6.1.4.1.30155.2.1.2.1.5.3
> SNMPv2-SMI::enterprises.30155.2.1.2.1.5.3 = STRING: "53.00"
>
>
> Version 1.4.15:
> ./check_snmp  -H 10.0.0.2 -o .1.3.6.1.4.1.30155.2.1.2.1.5.3 -w 50 -c  
> 60
> SNMP OK - "53.00" |
>
>
> Version 1.4.14:
> ./check_snmp-old  -H 10.0.0.2 -o .1.3.6.1.4.1.30155.2.1.2.1.5.3 -w  
> 50 -c 60
> SNMP WARNING - *53* | iso.3.6.1.4.1.30155.2.1.2.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  
numerically.

Ton





More information about the Help mailing list