[Nagiosplug-help] check_snmp string handling issue and perfdata

Dánial Olsen DOL at ft.fo
Tue Sep 28 14:17:22 CEST 2010

> 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.

That's true:
./check_snmp  -H -o . -w 50 -c 60 -vvv 
/usr/local/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] .
iso. = STRING: "53.00"
Processing oid 1 (line 1)
  oidname: iso.
  response:  = STRING: "53.00"
SNMP OK - "53.00" |

> 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.

A "treat string as integer" option would be desirable in this case.
Until then I'll keep an 1.4.14 version of check_snmp around for this particular check.


More information about the Help mailing list