Nagios snmp_get CRITICAL – Plugin timed out while executing system call

[adinserter name=”Posts”]

I started up a new Naemon (Nagios fork) server, and I came across this error while monitoring a Cisco switch.

chris@machine:/usr/lib/nagios/plugins$ ./check_snmp -H 192.168.1.62 -C public -o sysUpTime.0
CRITICAL - Plugin timed out while executing system call

I researched a bit, and found lots of unresolved forum and mailing list threads about the same issue. It wasn’t until I found this blog post which came up with a workaround. Their workaround was to use the OID “iso.3.6.1.2.1.1.3.0” instead of the string “sysUpTime.0”.

So in other words, the “Plugin timed out” problem is caused by snmpget (the program called by check_snmp) not knowing how to interpret the string, “sysUpTime.0” into an OID. I think the better, alternate way of fixing the problem is to give snmpget some MIB files which allow snmpget to translate sysUpTime.0 into an OID.

First, you have to download a MIB tree for your device, or a generic MIB which defines sysUpTime.0. I copied all the MIBs I had on another server to this new one, and I found quite a few that reference sysUpTime.

chris@machine:/opt/mibs$ grep -r 'sysUpTime' .
./IF-MIB.txt:            "The value of sysUpTime at the time of the last creation or
./IF-MIB.txt:            "The value of sysUpTime at the time the interface entered
./IF-MIB.txt:            "The value of sysUpTime on the most recent occasion at which
./IF-MIB.txt:            "The value of sysUpTime at the time of the last change of
./rfc1213.mib:          sysUpTime OBJECT-TYPE
./rfc1213.mib:                      "The value of sysUpTime at the time the interface
./SNMPv2-MIB.txt:sysUpTime OBJECT-TYPE
./SNMPv2-MIB.txt:            "The value of sysUpTime at the time of the most recent
./SNMPv2-MIB.txt:            "The value of sysUpTime at the time this conceptual
./SNMPv2-MIB.txt:    OBJECTS { sysDescr, sysObjectID, sysUpTime,
./SNMPv2-TC.txt:            "The value of the sysUpTime object at which a specific
./SNMPv2-TC.txt:            If sysUpTime is reset to zero as a result of a re-
./SNMPv2-TC.txt:            initialization, the sysUpTime object will reach 2^^32-1 and

Any of these MIB files should do the trick, and they can be found from various sites on the internet.

The last step is to configure snmpget (from the Net-SNMP package) to use the MIB files we downloaded. For all my MIB files, I created a directory, /opt/mibs. Next, I edited the /etc/snmp.conf file, using the mibdirs directive I found usin man snmp.conf

chris@portal:/opt/mibs$ cat /etc/snmp/snmp.conf
# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled by default. If you added the MIBs you can reenable
# loading them by commenting out the following line.
mibs :
mibdirs /opt/mibs

That’s about it; there’s no Daemon to reload. Now, when I run xxxxxx, I get expected output.

chris@machine:/usr/lib/nagios/plugins$ ./check_snmp -H 192.168.1.62 -C public -o sysUpTime.0
SNMP OK - Timeticks: (1060772489) 122 days, 18:35:24.89 | 

Hope that helps you. Have a great day!

Leave a Reply

Your email address will not be published.