Page 1 of 1

check_snmp plugin perdata output error

Posted: Sat Jan 30, 2016 1:56 pm
by Seb06
Hi to all,

I have strange issue when i'm using check_snmp plugin with -u option.

Nagios Core 4.1.1
Nagios plugin 2.1.1
Ubuntu 14

Command : check_snmp!-C public -o BSS-RCP-MIB::storage-load.0 -u % -c 1:100
Nagios service :
Status Information: SNMP OK - 12 %
Performance Data: BSS-RCP-MIB::storage-load.0=12;;1:100%;;100;
No RRD file created, error in perfdata format % is after the critical threshold and not after the value.

Command : check_snmp!-C public -o BSS-RCP-MIB::storage-load.0 -c 1:100
Nagios service :
Status Information: SNMP OK - 1
Performance Data: BSS-RCP-MIB::storage-load.0=1;;1:100;;100;
RRD file created, correct perfdata output

Does someone already seen this? or better does someone have a solution.

Best regards

Sebastien

Re: check_snmp plugin perdata output error

Posted: Mon Feb 01, 2016 10:36 am
by rkennedy
Can you run the check_snmp command over the CLI, and post the full command and output for us to look at?

As well, what happens if you place the % in quotes?

Code: Select all

check_snmp!-C public -o BSS-RCP-MIB::storage-load.0 -u "%" -c 1:100

Re: check_snmp plugin perdata output error

Posted: Tue Feb 02, 2016 12:48 pm
by Seb06
Thank you for your answer rkennedy

I'm not at my office this week, I will test this weekend.

Regards

Seb

Re: check_snmp plugin perdata output error

Posted: Tue Feb 02, 2016 4:19 pm
by tmcdonald
We will keep this open until you return. Please post back only once you have additional information for us.

Re: check_snmp plugin perdata output error

Posted: Sat Feb 06, 2016 3:41 am
by Seb06
Hi rkennedy,

I just do the test and unfortunately I have the same result

Code: Select all

check_snmp!-C public -o BSS-RCP-MIB::cpu-load-idle.1 -u "%" -w 8:100 -c 2:100
Perfdata output with error with "%" at the wrong place
BSS-RCP-MIB::cpu-load-idle.1=87;8:100;2:100%;100;100;

It looks like a bug

Seb

Re: check_snmp plugin perdata output error

Posted: Sun Feb 07, 2016 10:35 pm
by Box293
Can you execute these commands and post back the output:

Code: Select all

./check_snmp -H xxx.xxx.xxx.xxx -C public -o BSS-RCP-MIB::storage-load.0 -u % -v

Code: Select all

./check_snmp -H xxx.xxx.xxx.xxx -C public -o BSS-RCP-MIB::storage-load.0 -u % -c 1:100 -v

Code: Select all

/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 -c public xxx.xxx.xxx.xxx:161 BSS-RCP-MIB::storage-load.0 -D all
Replace xxx.xxx.xxx.xxx with the correct IP.

Re: check_snmp plugin perdata output error

Posted: Sun Feb 07, 2016 10:50 pm
by Seb06

Code: Select all

./check_snmp -H xxx.xxx.xxx.xxx -C public -o BSS-RCP-MIB::storage-load.0 -u % -v
Answer :

Code: Select all

/usr/bin/snmpget -Le -t 3 -r 5 -m ALL -v 1 [authpriv] 192.168.2.100:161 BSS-RCP-MIB::storage-load.0
BSS-RCP-MIB::storage-load.0 = INTEGER: 1
SNMP OK - 1 % | BSS-RCP-MIB::storage-load.0=1%

Code: Select all

./check_snmp -H xxx.xxx.xxx.xxx -C public -o BSS-RCP-MIB::storage-load.0 -u % -c 1:100 -v
Answer :

Code: Select all

/usr/bin/snmpget -Le -t 3 -r 5 -m ALL -v 1 [authpriv] 192.168.2.100:161 BSS-RCP-MIB::storage-load.0
BSS-RCP-MIB::storage-load.0 = INTEGER: 0
SNMP CRITICAL - *0* % | BSS-RCP-MIB::storage-load.0=0;;1:100%;;100;

Code: Select all

/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 -c public xxx.xxx.xxx.xxx:161 BSS-RCP-MIB::storage-load.0 -D all
Answer : see attachement

Re: check_snmp plugin perdata output error

Posted: Mon Feb 08, 2016 4:26 pm
by tgriep
I verified that using the -u "units" option for check_snmp version 2.1.1 outputs the unit in the wrong location in the performance data.
Running the same check command using version 2.0.3 puts the unit in the correct location.
I will fill on a bug report for this.

Re: check_snmp plugin perdata output error

Posted: Mon Feb 08, 2016 5:32 pm
by Box293
Nice troubleshooting @tgriep.

@Seb06 as a temporary workaround you could compile plugins 2.0.3 and just copy the check_snmp binary over the 2.1.1 version to work around your issue.