NAGIOS SNMP TRAP

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
[email protected]
Posts: 2
Joined: Wed Apr 24, 2013 1:51 pm

NAGIOS SNMP TRAP

Post by [email protected] »

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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NAGIOS SNMP TRAP

Post 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
}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
[email protected]
Posts: 2
Joined: Wed Apr 24, 2013 1:51 pm

Re: NAGIOS SNMP TRAP

Post by [email protected] »

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!!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NAGIOS SNMP TRAP

Post 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
}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked