[Nagiosplug-devel] [ nagiosplug-Bugs-3573832 ] check_snmp - integer parsing

SourceForge.net noreply at sourceforge.net
Tue Oct 2 21:16:26 CEST 2012

Bugs item #3573832, was opened at 2012-10-02 09:13
Message generated for change (Comment added) made by porjo38
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parsing problem
Group: Release (specify)
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Ian (porjo38)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_snmp - integer parsing

Initial Comment:
Plugin Version: check_snmp v1.4.16 (nagios-plugins 1.4.16)
Plugin Name: check_snmp
Operating System: Centos Linux 5
Architecture: Intel 32bit
Compiler: gcc

I am monitoring the power supply status on an APC PDU device. The snmp query returns integer 1 when status is good and integer 2 when status bad.

In order to test this with check_snmp I'm attempting to set a '-c' value that will make the check fail. I would expect that setting '-c 1' should result in CRITICAL and yet it doesn't:

./check_snmp -H -o . -C netben -c 1 -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] .
iso. = INTEGER: 1
SNMP OK - 1 | iso.

I've found that if I use '-c 2:2', I get the result I would expect....but yet that makes no sense!?

./check_snmp -H -o . -C netben -c 2:2 -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] .
iso. = INTEGER: 1
SNMP CRITICAL - *1* | iso. 


>Comment By: Ian (porjo38)
Date: 2012-10-02 12:16

Looking at the source code I realised that I was simply misunderstanding
the way the threshold range checking works. I've been using Nagios for
years and never realised this!! 

This page (linked from the check_snmp man page) explains it well:



You can respond by visiting: 

More information about the Devel mailing list