I want to monitor the power supplies from an HP DL380G8, but only have access to the ILO4.
So i look for the snmp adress for the powersupply via ILO4 and HP DL380. (and a “little try and error”).
I wrote a little plugin: check_my_ps
(copy it to: /usr/lib64/nagios/plugins/)
# check powersupply with snmp through ILO4
# v 1.0 21.06.2013 J.H.
# $1 = HostIP
PSUHealth=`snmpget -v 2c -c public $1 .220.127.116.11.18.104.22.168.22.214.171.124 | grep “INTEGER: 2″`
if [[ $? -ne 0 ]] ; then
echo “ERROR:Power Supply Problem – visit https://$1 for more information.”
echo “OK: Powersupplies ok”
in /etc/nagios/objects add entry to commands.cfg:
command_line $USER1$/check_my_ps $HOSTADDRESS$
in /etc/nagios/objects add entry to <servername.cfg>
service_description Power Supply
It works in my enviroment, maybe it doesn’t work in yours. Take it as a sample for own plugins.
Nagios Core 3.4.3, CentOS release 6.4 (Final)