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.
NAGIOS SNMP TRAP
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NAGIOS SNMP TRAP
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
}-
[email protected]
- Posts: 2
- Joined: Wed Apr 24, 2013 1:51 pm
Re: NAGIOS SNMP TRAP
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!!
Thanks much!!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NAGIOS SNMP TRAP
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
}