check_snmp not working but snmpget works

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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_snmp not working but snmpget works

Post by abrist »

Could you run the check with very verbose mode? (-vvv):

Code: Select all

/usr/local/nagios/libexec# ./check_snmp -P 1 -C COMMUNITY -H 192.168.1.1 -vvv -o iso.3.6.1.2.1.31.1.1.1.16.1
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Kerflumpre
Posts: 30
Joined: Fri Apr 22, 2011 6:50 pm

Re: check_snmp not working but snmpget works

Post by Kerflumpre »

Code: Select all

root@nagios:/usr/local/nagios/libexec# ./check_snmp -P 1 -C COMMUNITY -H 192.168.1.1 -vvv -o iso.3.6.1.2.1.2.2.1.9.10001
/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 [authpriv] 192.168.1.1:161 iso.3.6.1.2.1.2.2.1.9.10001
CRITICAL - Plugin timed out while executing system call
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_snmp not working but snmpget works

Post by slansing »

Please run the exact command that was requested (including the OID) and show the output.
Kerflumpre
Posts: 30
Joined: Fri Apr 22, 2011 6:50 pm

Re: check_snmp not working but snmpget works

Post by Kerflumpre »

My mistake. I didn't see the OID was different. Same result.

Code: Select all

root@nagios:/usr/local/nagios/libexec# ./check_snmp -P 1 -C COMMUNITY -H 192.168.1.1 -vvv -o iso.3.6.1.2.1.31.1.1.1.16.1
/usr/bin/snmpget -Le -t 1 -r 5 -m ALL -v 1 [authpriv] 192.168.1.1:161 iso.3.6.1.2.1.31.1.1.1.16.1
CRITICAL - Plugin timed out while executing system call
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_snmp not working but snmpget works

Post by sreinhardt »

Let's get a tcpdump and see if it is actually sending an snmp request, and a few other things.

tcpdump port 161
send a check or two
Are there additional lines of output after the tcpdump command?

ls /usr/bin/snmpget -l
./check_snmp -V
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: check_snmp not working but snmpget works

Post by rhassing »

tcpdump is a very good idea Spencer
Rob Hassing
Image
Kerflumpre
Posts: 30
Joined: Fri Apr 22, 2011 6:50 pm

Re: check_snmp not working but snmpget works

Post by Kerflumpre »

the check_snmp shows nothing in the tcpdump.

The snmpget shows this:

Code: Select all

16:51:30.106087 IP 192.168.1.2.60241 > 192.168.1.1.snmp:  C=COMMUNITY GetRequest(31)  31.1.1.1.16.1
16:51:30.108329 IP 192.168.1.1.snmp > 192.168.1.2.60241:  C=COMMUNITY GetResponse(32)  31.1.1.1.16.1=2
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: check_snmp not working but snmpget works

Post by rhassing »

I think there is something wrong with the package you installed.
Are you familiar with compiling from source?
Rob Hassing
Image
Kerflumpre
Posts: 30
Joined: Fri Apr 22, 2011 6:50 pm

Re: check_snmp not working but snmpget works

Post by Kerflumpre »

Yes. That's what I did from the start. Sorry, I said it was a package. I had a brain fart. I've recompiled again and even tried the 1.5 plugins.
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: check_snmp not working but snmpget works

Post by rhassing »

Are you using a 32 or 64 bit system?
Rob Hassing
Image
Locked