Percsnmpd_and_check_megaraid
Contents |
Using percsnmpd
percsnmpd is an SNMP agent written by Dell to retrieve information about the status of the LSI Logic Megaraid controller and RAID arrays. It can currently be found at http://linux.dell.com/storage.shtml by downloading the lin_apps tarball (search for lin_apps on that page). All of the other tools in lin_apps are unfortunately in RPM format, but percsnmpd can be installed directly.
Installing percsnmpd
To install, unpack the tarball and just run their install script. It will create an /etc/percsnmp directory and place all needed files under that dir. It will also generate a percsnmpd.conf (in at least 3 different places) that can be thrown away once you copy the following line from it into your snmpd.conf:
| Code: copy into /etc/snmp/snmpd.conf |
# For percsnmp pass .1.3.6.1.4.1.3582 /usr/sbin/percmain |
The Init Script
The init script must be totally re-written to jive with Gentoo. Here is the script that I re-wrote to take advantage of Gentoo's runscript. Please add comments or fixes for anything you see that can be done better:
| File: /etc/init.d/percsnmpd |
#!/sbin/runscript
#description: Dell SNMP Agent startup/shutdown script
# Edited for Gentoo
snmpagtdir="/etc/percsnmp"
megadevice="megasnmp"
agent="/usr/sbin/percagent"
PIDFILE="/var/lock/percagent.lock"
depend() {
need snmpd
use net
}
start() {
local retval=0
ebegin "Starting percsnmpd"
[ -r ${snmpagtdir}/$megadevice ] && rm ${snmpagtdir}/$megadevice
megamajor=`cat /proc/devices|awk '/megadev/{print$1}' `
#Check for error
if [ "$megamajor" = "" ]
then
echo 'MegaRAID driver not loaded.'
echo 'percagent will not be loaded.'
retval=1
else
mknod ${snmpagtdir}/$megadevice c $megamajor 0 2>/dev/null
start-stop-daemon --start --exec $agent
pidof $agent > $PIDFILE
retval=0
fi
eend ${retval}
}
stop(){
ebegin "Stopping percsnmp agent"
start-stop-daemon --stop --pidfile $PIDFILE
rm -f ${snmpagtdir}/$megadevice 2>/dev/null
eend $?
}
|
Finalizing the installation
After you've edited your /etc/snmp/snmpd.conf file and copied the above script into /etc/init.d/percsnmpd, there's only the following steps left:
$ /etc/init.d/snmpd restart $ rc-update add percsnmpd default $ /etc/init.d/percsnmpd start
That's it. You should then be able to test the plugin against the host.
check_megaraid
The check_megaraid nagios plugin is currently at http://www.ibiblio.org/john/megaraid/. It doesn't appear to be actively maintained.
Plus - the return time is incredibly slow (esp. for a nagios plugin) - about 3 seconds to get a response from the percagent on the localhost. I'm not sure if this the fault of the agent or the plugin, but I'll do some testing w/ this.
The plugin is written in Perl and is useful for checking your RAID status on any Dell server using Megaraid drivers. It will probably gain some speed if re-written in C. I'm going to take a look at the code & see if I can't find a way to make some improvements.
Checking megaraid status in Windows
There are several ways to do this, but the way I'm currently doing it is just by using the check_snmp plugin. You must also have OpenManage and either Array Manager or Storage Management installed on the target.
| File: /etc/nagios/commands/command.cfg |
define command{
command_name check_perc_controller_omsm
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $USER5$ \
-o 1.3.6.1.4.1.674.10893.1.20.130.1.1.5.$ARG1$ -c 1:1
}
define command{
command_name check_perc_battery_omsm
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $USER5$ \
-o 1.3.6.1.4.1.674.10893.1.20.130.15.1.4.$ARG1$ -c 1:1
}
# This uses the older Array Manager
define command{
command_name check_perc_controller_am
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $USER5$ \
-o 1.3.6.1.4.1.674.10893.1.1.130.1.1.5.$ARG1$ -c 1:1
}
|
I hope some of this helps!
--Joyo222 16:49, 19 July 2006 (UTC)
External Links
http://www.ibiblio.org/john/megaraid/
http://linux.dell.com/storage.shtml
http://www.nagios.org/
Browse categories > Applications > Monitoring
Browse categories > Applications > System > RAID management
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and real estate agent tools.
