#360 check_snmp: fix for multiple non numeric OIDs

Bugfix (123)
Martin Rohrbach

Patch against Plugin Version (-V output): v1.4.15 (nagios-plugins 1.4.15)
Plugin Name: check_snmp
Example Plugin Commandline: -u a,b,c,d,e (see below)
Tested on operating system: SLES 11 SP 1 (Linux #1 SMP 2011-02-25 13:36:59 +0100 x86_64 x86_64 x86_64 GNU/Linux)
Tested on architecture: x86_64
Tested with compiler: gcc

When multiple OIDs are specified and the first one is numeric while another one is not, an error is encountered because is_numeric is not reset in the loop. The fix does just that.

bash# ./check_snmp -V
check_snmp v1.4.15 (nagios-plugins 1.4.15)
bash# uname -a
Linux kobarid #1 SMP 2011-02-25 13:36:59 +0100 x86_64 x86_64 x86_64 GNU/Linux

bash# ./check_snmp -H mary.unix.db.de -C nasfiler -o .,. -w @1:2, -c @4:6,
No valid data returned
bash# ./check_snmp_numeric_fix -H mary.unix.db.de -C nasfiler -o .,. -w @1:2, -c @4:6,
SNMP OK - 3 "The system's global status is normal. " | iso.


  • Andy Brist
    Andy Brist


    I have been unable to reproduce this issue. We do not have a netapp device in house, but I have been attempting to reproduce the behavior with other OIDs.

    . --> returns an integer
    . --> returns a DisplayString

    I have attempted to use OIDs with similar returns (same type, nearly same output) and have yet to encounter this error. Do you still have this issue with the check_snmp plugin and you netapp device?