Linux — HP Proliant SNMP Agent setup

I wanted to put together a quick post on configuring the hp-snmp-agent and hp-health agents on HP ProLiant servers using Linux. I stumbled across the need for this while working on a project to implement Icinga to monitor server hardware via SNMP.

First things first, check that you are running a compatible HP ProLiant G series. The current stable release of both hp-snmp-agent and hp-helath only work with G5+. This is important to keep in mind because I ran into this issue when trying to install both agents on a G4 Proliant. The dpkg install would fail because it cannot start the hp-health agent under a G4 Proliant. I am installing the agents ontop of Debian 7.

Let’s download the packages, check for latest versions

cd /root 
mkdir hp-agents 
cd hp-agents 

You will need snmp, snmpd, and some other library files before install the packages.

apt-get install snmpd snmp lib32gcc1 libc6-i386 libsnmp30

Now install the two(2) agents. Start with hp-health first, then install hp-snmp-agent

dpkg -i hp-health*.deb 
dpkg -i hp-snmp-agents*.deb

If dpkg complains about any missing packages, just do a apt-get -f install should take care of that.

Now, we need to reconfigure snmpd. We can do this 1 of 2 ways. Either use the /sbin/hpsnmpconfig script, or edit the /etc/snmpd/snmpd.conf file directly. I’ll edit the snmpd.conf directly, so edit /etc/snmp/snmpd.conf

dlmod cmaX /usr/lib/ 
rocommunity mycommunitystring 
trapcommunity mycommunitystring 
trapsink mycommunitystring 
syscontact Jimmah <> 
syslocation Somewhere,Someplace
    • Pretty much, what we’ve done is set as a trap destination, and an allowed poller(can perform SNMP walks/queries)
    • We’ve also set a custom community string mycommunitystring, this is usually public by default
    • Setting sysContact and sysLocation, which are RFC standard SNMP OID
      OID == SysContact
      OID == SysLocation
    • The dlmod cmaX is something the hpsnmpconfig script adds. I believe it allows the SNMPd to communicate with hp-snmp-agent
    • One last thing in the snmpd.conf file. Depending on what Distro you are using and version of snmpd, look for the line udp: and change it to udp:161. For some reason, SNMP queries won’t work unless this is changed.
      1. Now, restart all services involved.
        /etc/init.d/hp-health restart 
        /etc/init.d/hp-snmp/agent restart 
        /etc/init.d/snmpd restart
      2. Let’s test. Must be done on server, or whatever IP you used.
        snmpbulkwalk -v2c -c 'sysmonr' . 
        snmpbulkwalk -v2c -c 'sysmonr' .
        • The above commands should output you sysContact and sysLocation
      3. Let’s also test the hp-snmp-agent OIDs, to make sure it is properly integrating
        snmpwalk -v2c -c 'mycommunitystring' {your HP server} .
        snmpwalk -v2c -c 'mycommunitystring' {your HP server} .
        • The first test should output the Proliant Product Platform, such as “ProLiant DL380 G6”
        • The second, should output the status as an integer of the Power Supplies. (1 = other, 2 = ok, 3 = degraded, 4=failed)


To take it a step further, I recommend downloading this Nagios script, and executing it against the HP Server you just set up.

chmod +x check_hp 
./check_hp -H {you HP server IP} -C mycommunitystring