check_snmp failure

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Basti1508
Posts: 2
Joined: Mon Mar 05, 2018 5:20 am

check_snmp failure

Post by Basti1508 »

Hi,

I am currently trying to query a gude Power Control Board via SNMP. Not that special yet. But check_snmp just runs into a timeout.

See this:
#> check_snmp -H myhost -p 1234 -o iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12 -C public -P 2c -v
/usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 2c [authpriv] myhost:1234 iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12
CRITICAL - Plugin timed out while executing system call
So I tried to execute the shown command:
#> /usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 2c -c public myhost:1234 iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12
iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12 = INTEGER: 1
Mhh.. strange. So I looked through the code. I found the execve call where the snmpget command is executed.
In the trace I can see this:
[pid 13503] execve("/usr/bin/snmpget", ["/usr/bin/snmpget", "-Le", "-t", "10", "-r", "5", "-m", "ALL", "-v", "2c", "-c", "public", "myhost:1234", "iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12"], [/* 23 vars */]) = 0
It's still stuck there.

If I take the command out of the trace and execute it everything works fine.
#> /usr/bin/snmpget -Le -t 10 -r 5 -m ALL -v 2c -c public myhost:1234 iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12
iso.3.6.1.4.1.28507.38.1.3.1.2.1.3.12 = INTEGER: 1
I'm really out of ideas how to debug this further.

Thanks in advance
Sebastian
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp failure

Post by tgriep »

What OS and release are you running the plugin from?
Can you run the plugin with the -V and post the version number?

Code: Select all

./check_snmp -V
If the check times out, it could cause that error so try running the plugin with a longer timeout.
For 30 seconds, add this.

Code: Select all

 -t 30
Be sure to check out our Knowledgebase for helpful articles and solutions!
Basti1508
Posts: 2
Joined: Mon Mar 05, 2018 5:20 am

Re: check_snmp failure

Post by Basti1508 »

This is the Version
check_snmp v2.2.1 (nagios-plugins 2.2.1)
Yesterday I got a bit further in debugging. The problem seems to be somewhere in reading the snmp mibs.

If I do the check with '1.3.6...' instead of 'iso.3.6' everything works fine. I've also tried to sepcify the -m '' option. This also fixes the Problem.

But I still don't get why I can execute the command shown by check_snmp by hand, but not troughout the check itself.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_snmp failure

Post by scottwilkerson »

Basti1508 wrote:But I still don't get why I can execute the command shown by check_snmp by hand, but not troughout the check itself.
do you mean with snmpget?

check_snmp isn't an arg for arg wrapper, they are different and you may need to specify a base mib doing it the other way
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked