Gentoo Wiki



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 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.

Note: You should have snmpd running on the same box. If you don't, you'll need to find some help on setting that up.

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 . /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
 #description: Dell SNMP Agent startup/shutdown script
 #  Edited for Gentoo


 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" = "" ]
                echo 'MegaRAID driver not loaded.'
                echo 'percagent will not be loaded.'
                mknod ${snmpagtdir}/$megadevice c $megamajor 0 2>/dev/null
                start-stop-daemon --start --exec $agent
                pidof $agent > $PIDFILE
        eend ${retval}

        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.


The check_megaraid nagios plugin is currently at 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$ARG1$ -c 1:1

 define command{
        command_name check_perc_battery_omsm
        command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $USER5$ \
        -o$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$ARG1$ -c 1:1

I hope some of this helps!

--Joyo222 16:49, 19 July 2006 (UTC)

External Links

Retrieved from ""

Last modified: Fri, 05 Sep 2008 08:33:00 +0000 Hits: 1,312