check_snmp_load bug

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

check_snmp_load bug

Post by rajasegar »

Please check on this. I recall posting about this sometime back.

Code: Select all

[nagios@nagiosprodxi1 debug]$ /usr/local/nagios/libexec/check_snmp_load.pl -H 10.11.11.111  -C testing --v2c -w 70% -c 90% -f
Argument "v6.0.1" isn't numeric in numeric lt (<) at /usr/local/nagios/libexec/check_snmp_load.pl line 685.
12 CPU, average load 0.0% < 70% : OK | cpu_prct_used=0%;70;90
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_snmp_load bug

Post by Box293 »

What version is your plugin?

Code: Select all

./check_snmp_load.pl -V
check_snmp_load version : 1.3.2
It seems to work fine on mine:

Code: Select all

/usr/local/nagios/libexec/check_snmp_load.pl -H centos01 -C public  --v2c -w 70% -c 90% -f
1 CPU, load 1.0% < 70% : OK | cpu_prct_used=1%;70;90
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: check_snmp_load bug

Post by rajasegar »

Box293 wrote:What version is your plugin?

Code: Select all

./check_snmp_load.pl -V
check_snmp_load version : 1.3.2
It seems to work fine on mine:

Code: Select all

/usr/local/nagios/libexec/check_snmp_load.pl -H centos01 -C public  --v2c -w 70% -c 90% -f
1 CPU, load 1.0% < 70% : OK | cpu_prct_used=1%;70;90

Code: Select all

./check_snmp_load.pl -V
check_snmp_load version : 1.3.2
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_snmp_load bug

Post by Box293 »

What type of device is 10.11.11.111 ?

If it's a Linux server, can you please post the /etc/snmp/snmpd.conf file please?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: check_snmp_load bug

Post by rajasegar »

I think the never version of the SNMP returns V6.0.1 instead of the integer it is expecting.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: check_snmp_load bug

Post by rajasegar »

Box293 wrote:What type of device is 10.11.11.111 ?

If it's a Linux server, can you please post the /etc/snmp/snmpd.conf file please?
It is a windows box. As updated before it is the version related issue.
I have patched a custom version which bypasses this issue before

Check this line and you will understand the problem /usr/local/nagios/libexec/check_snmp_load.pl line 685
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp_load bug

Post by tgriep »

Edit the check_snmp_load.pl file find and replace the following line

Code: Select all

if (Net::SNMP->VERSION < 4) {
with

Code: Select all

if (Net::SNMP->VERSION lt 4) {
Try that to see if that fixes it for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
rajasegar
Posts: 1018
Joined: Sun Mar 30, 2014 10:49 pm

Re: check_snmp_load bug

Post by rajasegar »

tgriep wrote:Edit the check_snmp_load.pl file find and replace the following line

Code: Select all

if (Net::SNMP->VERSION < 4) {
with

Code: Select all

if (Net::SNMP->VERSION lt 4) {
Try that to see if that fixes it for you.
It does but coding wise comparing string (v6.0.1) to integer (4) is not a best practice even though perl seems to accept this.
Anyway this will do for now.

Thanks. Please close this case.
5 x Nagios 5.6.9 Enterprise Edition
RHEL 6 & 7
rrdcached & ramdisk optimisation
Locked