Page 1 of 1

nagios core "No OIDs specified " error

Posted: Sat Jul 21, 2012 9:51 pm
by mattau
Hi, I keep getting the "No OIDs specified" error in the web interface. I have tried everything

using ubuntu 11.04 with nagios core 3.2.3

manually I goto /usr/lib/nagios/plugins ./check_snmp -H 172.16.1.2 -C home -P 1 -o sysDescr.0
P OK - Cisco IOS Software

so that works fine

i do an smnpget - that also works fine

-the issue is nagios web interface never works, it just keeps saying no oid specified when I have specified it in the configuration!

I have outlined the command in
/etc/nagios-plugins/config/
define command{
command_name check_snmp_router
command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -P '$ARG2$' -o '$ARG3$'
}

then in the main conft int /etc/nagios3/objects/switch.cfg

define service{
use generic-service ; Inherit values from a template
host_name Cisco Router
service_description check system
check_command check_snmp_router!-C home -P 1 -o sysDescr.0
}

am I missing something? I have watched various youtube vids and it looks as simple as that yet I cant get it to work!

Re: nagios core "No OIDs specified " error

Posted: Mon Jul 23, 2012 10:03 pm
by jsmurphy
Arguments in the service check_command are seperated by using the exclamation mark... so essentially you are passing all of them in $ARG1$ which means what you are actually executing is:

Code: Select all

/usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '-C home -P 1 -o sysDescr.0' -P '' -o ''
If you change your service check_command to:

Code: Select all

check_command check_snmp_router!home!1!sysDescr.0
Then it should execute as you expect. Alternatively you could also change your command definition to:

Code: Select all

/usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' '$ARG1$'

Re: nagios core "No OIDs specified " error

Posted: Wed Jul 25, 2012 8:08 am
by mattau
just wanted to say thanks so much! I got it working

it all makes sense with the $ARG1$ being everything after the hostaddress variable. by using your 3rd example I got it all to work.

appreciate the help : )

Re: nagios core "No OIDs specified " error

Posted: Wed Jul 25, 2012 6:12 pm
by jsmurphy
You're welcome, glad you got it working!