Mark Syms
Mark Syms

Reputation: 11

Nagios: snmpget works but check_snmp times out

I'm trying to get Nagios to extract some SNMP information from my ADSL router but it doesn't want to work.

If I run snmpget as follows then it instantly returns the expected value

$> snmpget -c public 192.168.11.1 iso.3.6.1.2.1.1.3.0 -v1

iso.3.6.1.2.1.1.3.0 = Timeticks: (23054300) 2 days, 16:02:23.00

but if I run the equivalent check with the Nagios check_snmp tool it times out

$> /usr/lib/nagios/plugins/check_snmp -H localhost -C public -o iso.3.6.1.2.1.1.3.0 --protocol=1

CRITICAL - Plugin timed out while executing system call

Interestingly, I run the snmpget command without specifying the protocol version then it also times out. So, I wonder whether check_snmp is actually honouring the --protocol=1 parameter.

I've also tried querying the local snmpd service on the server and that behaves in the same way so it's not a question of firewalls or routing.

Upvotes: 1

Views: 7187

Answers (2)

Kenneth Nelson
Kenneth Nelson

Reputation: 11

Same problem, here was my fix:

Changed out the word iso for 1 (iso.3.6.1.2.1.1.3.0 -> 1.3.6.1.2.1.1.3.0). I used this command to do it:

/usr/lib/nagios/plugins/check_snmp -H localhost -C public -o 1.3.6.1.2.1.1.3.0 --protocol=1

Upvotes: 1

Bruno9779
Bruno9779

Reputation: 1669

This is old, but anyway:

the check_snmp command lacks the -m and the -p flags.

-m, --miblist=STRING

If you want to use mib files you need to specify which one to use or:

-m all

You also need to specify the protocol:

-P 2c

Upvotes: -1

Related Questions