check_snmp

Matthew Richardson matthew-ln at itconsult.co.uk
Tue Nov 6 21:12:23 CET 2007


I am doing a number of very similar checks on HP kit using SNMP.  The
parameter used is "-s 2", which gives UP provided the value returned is 2.

Some examples may assist:-

# hp specific snmp checks
define command {
	command_name			check_snmp_hp_power
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.9.1.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_health
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.1.3.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_correctablememory
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.3.2.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_asr
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.5.17.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_thermal
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.6.1.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_tempsensors
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.6.3.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_tempvalue
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.6.8.1.4.0.$ARG2$ -w $ARG3$ -c $ARG4$ -t 45
}
define command {
	command_name			check_snmp_hp_fans
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.6.4.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_cpufans
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.6.2.6.5.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_drivearray
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.3.1.3.0 -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_arraycontroller
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.3.2.2.1.1.6.$ARG2$ -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_logicaldrivestatus
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.3.2.3.1.1.4.$ARG2$.$ARG3$ -s 2 -t 45
}
define command {
	command_name			check_snmp_hp_physicaldrivestatus
	command_line			$USER1$/check_snmp -H $HOSTADDRESS$
-C $ARG1$ -o 1.3.6.1.4.1.232.3.2.5.1.1.6.$ARG2$.$ARG3$ -s 2 -t 45
}

These checks are quite basic, insofar as they provide no additional
information if the service is not UP.  They work perfectly well for
attracting one's attention though.

Best wishes,
Matthew

 ------
>From: "Mark Duffy" <mark.duffy at TEWV.NHS.UK>
>To: <Nagios-users at lists.sourceforge.net>
>Cc: 
>Date: Tue, 6 Nov 2007 12:19:36 -0000
>Subject: [Nagios-users] check_snmp

>Afternoon all,
>
>I am currently trying to get my head round doing checks with SNMP. 
>
>I have so far managed to get Nagios to display the required data but it is showing the array as Critical or Warning unless I set the -w & -c levels to 2 (which is status OK), I somehow feel this is not right. How do I go about adding more than one variable to the critical level for example Critical levels would be 3 & 4 and a warning would be 1 ( normally set as -w 1)
>
>Here is the check I am currently running and the workaround to get an OK status for a variable of 2:
>
>define command{
>	command_name	check_cpq_array
>	command_line	$USER1$/check_snmp -H $HOSTADDRESS$ -o 1.3.6.1.4.1.232.3.2.2.1.1.6.4 -C public -w 2 -c 2
>	}
>
>I think I have confused myself and probably the rest of you in this e-mail, if so I apologize.
>
>Regards,
> 
>Mark Duffy
> 
>Tees, Esk And Wear Valleys NHS Trust
>Flatts Lane Centre
>Flatts Lane
>Normanby
>Middlesbrough
>TS6 0SZ
>Tel: 01642 283548

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list