Page 1 of 2

check_snmp Plugin timed out while executing system

Posted: Mon Dec 07, 2015 10:32 pm
by cg28oh
Trouble with Nagios Plugins v2.1.1

When a service check_snmp timeouts with no reponse, Nagios produces CRITICAL - Plugin timed out while executing system call alert. It should show the timeout alert. I'm not able to find what is producing this error. Playing with the timeout and retries have no impact.

CentOS 7 complied from source.

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 12:58 am
by Box293
Can you run check_snmp with the -v argument and post the results here please (including the full command executed).

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 7:43 am
by cg28oh
./check_snmp -H xx.xx.xx.xx -C COMM -o sysName.0 -v
/usr/bin/snmpget -Le -t 3 -r 5 -m ALL -v 1 [authpriv] xx.xx.xx.xx:161 sysName.0
CRITICAL - Plugin timed out while executing system call

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 10:25 am
by hsmith
Is this with all SNMP checks, or just a single one?

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 11:37 am
by cg28oh
When the host is down or the snmp timeout. The hosts I'm monitoring are on high latency links (radio), typical response time is 1 to 2 seconds but can go upwards to 5 to 10 seconds. I would expect that there would be a UNKNOWN No SNMP response received before timeout snmp alert and not the CRITICAL - Plugin timed out while executing system call.

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 11:39 am
by hsmith
I believe the plugin has a ten second timeout by default. Can you try using -t 30 in your check to see if it helps?

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 12:13 pm
by cg28oh
No change when there is a timeout. However when specifying the -t 30, a -t 7 is passed to the snmpget?

# ./check_snmp -t 30 -C COMM -H xx.xx.xx.xx -o sysName.0 -vvv
/usr/bin/snmpget -Le -t 7 -r 5 -m ALL -v 1 [authpriv] xx.xx.xx.xx:161 sysName.0
CRITICAL - Plugin timed out while executing system call

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 12:28 pm
by hsmith
That's pretty strange. Can you try a few other values? I don't have a host with SNMP set up in my lab environment currently, and will be in a meeting for the next couple hours. Try something like 60s, 90s for timeout.

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 1:37 pm
by cg28oh
Changing the -t still produced the Plugin timed out. Now it seems that if I set the check_snmp -t in multiples of 4, it will send 1 to the snmpget binary.

check-snmp -t 1-4 = /usr/bin/snmpget -Le -t 1
check-snmp -t 5-9 = /usr/bin/snmpget -Le -t 2
check-snmp -t 10-14 = /usr/bin/snmpget -Le -t 3
check-snmp -t 15-19 = /usr/bin/snmpget -Le -t 4

so on... so on...

Re: check_snmp Plugin timed out while executing system

Posted: Tue Dec 08, 2015 4:51 pm
by hsmith
First I tried

Code: Select all

[root@xi libexec]# ./check_snmp -H 172.16.0.200 -o sysName.0 -vvv
/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 [authpriv] 172.16.0.200:161 sysName.0
SNMPv2-MIB::sysName.0 = STRING: potus
Processing oid 1 (line 1)
  oidname: SNMPv2-MIB::sysName.0
  response: STRING: potus
SNMP OK - potus |
Looks good, so I tried

Code: Select all

[root@xi libexec]# ./check_snmp -H 172.16.0.200 -o sysName.0 -vvv -t 10
/usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 1 [authpriv] 172.16.0.200:161 sysName.0
SNMPv2-MIB::sysName.0 = STRING: potus
Processing oid 1 (line 1)
  oidname: SNMPv2-MIB::sysName.0
  response: STRING: potus
SNMP OK - potus |
Still looks good...

Code: Select all

[root@xi libexec]# ./check_snmp -H 172.16.0.200 -o sysName.0 -vvv -t 50000
/usr/bin/snmpget -Le -t 50000 -r 5 -m ALL -v 1 [authpriv] 172.16.0.200:161 sysName.0
SNMPv2-MIB::sysName.0 = STRING: potus
Processing oid 1 (line 1)
  oidname: SNMPv2-MIB::sysName.0
  response: STRING: potus
SNMP OK - potus |
It all looks fine. Let's compare versions:

Code: Select all

[root@xi libexec]# ./check_snmp -V
check_snmp v2.0.3 (nagios-plugins 2.0.3)