Page 1 of 1

NAGIOS SNMP TRAP

Posted: Wed Apr 24, 2013 2:07 pm
The following Nagios SNMP trap works great on the command line:

[root@bo-bb objects]# /usr/local/nagios/libexec/check_snmp -H 10.167.148.113 -o .1.3.6.1.4.1.232.3.2.5.1.1.6 -P 1 -n SNMP OK - 2 | iso.3.6.1.4.1.232.3.2.5.1.1.6.0.0=2

I'm trying to incorporate that command into a Nagios check.

I have the following in the commands file:

define command{
command_name HP_PowerSupply_Degraded
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -P $ARG2$ -n
}

So ARG1 is the OID - .1.3.6.1.4.1.232.3.2.5.1.1.6
and ARG2 is the _p variable - 1

I have the following monitoredhost.cfg file:

define service{
use generic-service
host_name monitoredhost
service_description Power Supply Health
check_command check_snmp!.1.3.6.1.4.1.232.3.2.5.1.1.6!1
}

When the command runs I get

No OID specified

But I specify the OID in the check_command line above.

Any advice or help would be greatly appreciated.

Re: NAGIOS SNMP TRAP

Posted: Wed Apr 24, 2013 2:45 pm
by scottwilkerson
change service to

Code: Select all

define service{
use generic-service
host_name monitoredhost
service_description Power Supply Health
check_command HP_PowerSupply_Degraded!.1.3.6.1.4.1.232.3.2.5.1.1.6!1
}

Re: NAGIOS SNMP TRAP

Posted: Wed Apr 24, 2013 3:41 pm
Perfect, that worked. But where did you get "HP_PowerSupply_Degraded" from? I have an entire list such as harddrives, fans, CPU, etc. to check. I'm not clear on where you got that and how I can get the rest of the details I need such a fan, CPU, etc..

Thanks much!!

Re: NAGIOS SNMP TRAP

Posted: Wed Apr 24, 2013 3:58 pm
by scottwilkerson
I got it from the command_name you showed in your first post
[email protected] wrote:define command{
command_name HP_PowerSupply_Degraded
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -P $ARG2$ -n
}