Page 1 of 1

check_snmp returning status Unknown "No OIDs specified"

Posted: Tue Nov 23, 2010 10:40 am
by jbuhrmann
I have just installed Nagios on Ubuntu server 10.04 LTS using the quickstart instructions. All the localhost checks are working. I am trying to add monitoring for a cisco switch. The ping check is working, but when I try to monitor a port or system uptime I get a service status of Unknown and status information of "No OIDs specified".

here is the service configuration
define service{
use generic-service
host_name myswitch
service_description PortCheck
check_command check_snmp!-C xxx -o 1.3.6.1.2.1.2.2.1.8.1 -r 1 -m RFC1213-MIB
}

When I run check_snmp from command line it returns properly

/usr/local/nagios/libexec/check_snmp -H 172.22.2.10 -C xxx -o 1.3.6.1.2.1.2.2.1.8.1 -r 1 -m RFC1213-MIB
SNMP OK - 2 | RFC1213-MIB::ifOperStatus.1=2

It is returning a value of 2 meaning the port is down which is what is expected, but when you view the service from the web interface it shows as status Unknown.

I have the following snmp packages installed on the server:
i libnet-snmp-perl - Script SNMP connections
i A libsnmp-base - SNMP (Simple Network Management Protocol)
i libsnmp-dev - SNMP (Simple Network Management Protocol)
i libsnmp-info-perl - Object Oriented Perl5 Interface to Network
i libsnmp-mib-compiler-perl - a MIB Compiler supporting SMIv1 and SMIv2
i libsnmp-multi-perl - Perform SNMP operations on multiple hosts
i libsnmp-perl - SNMP (Simple Network Management Protocol)
i libsnmp-session-perl - Perl support for accessing SNMP-aware devi
i A libsnmp15 - SNMP (Simple Network Management Protocol)
i snmp - SNMP (Simple Network Management Protocol)
i snmpd - SNMP (Simple Network Management Protocol)

Strangely I get the same result in the web interface even if I put the wrong community string into the service configuration whereas the command line reports back an error like:
External command error: Timeout: No Response from 172.22.2.10:161.
Again, as expected.

Not seeing anything in syslog. What am I missing?

Re: check_snmp returning status Unknown "No OIDs specified"

Posted: Tue Nov 23, 2010 11:45 am
by jbuhrmann
As a further test I installed Nagios on a separate server following the same guide. This time the server is an Ubuntu 8.04 LTS server. I am getting the same results. check_snmp works from the command line, but gives me No OIDs specified from the web interface.

Re: check_snmp returning status Unknown "No OIDs specified"

Posted: Thu Dec 02, 2010 2:55 pm
by jbuhrmann
I ran a further test by installing on a CentOS 5.5 server and got the same result so I did some further testing with the community string. Our comm string had an ! in it. I knew this was a special character in the linux world and I tried to escape it by putting the community string in single quotes in the nagios config, but it didn't like it in either format. When we added a community string with no special characters it worked just fine.

The thing that threw me all along was that it worked fine running the check_snmp command line script and only failed in the web format.

Hope this helps someone else who might run into the same problem.

Case closed.