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 http://downloads.linux.hp.com/SDR/repo/mcp/debian/pool/non-free/ for latest versions

cd /root 
mkdir hp-agents 
cd hp-agents 
wget http://downloads.linux.hp.com/SDR/repo/mcp/debian/pool/non-free/hp-health_10.0.0.1.3-4._amd64.deb 
wget http://downloads.linux.hp.com/SDR/repo/mcp/debian/pool/non-free/hp-snmp-agents_10.0.0.1.23-21._amd64.deb

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/libcmaX64.so 
rocommunity mycommunitystring 10.10.10.10 
trapcommunity mycommunitystring 
trapsink 10.10.10.10 mycommunitystring 
syscontact Jimmah <jim@techjockey.net> 
syslocation Somewhere,Someplace
    • Pretty much, what we’ve done is set 10.10.10.10 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 1.3.6.1.2.1.1.4 == SysContact
      OID 1.3.6.1.2.1.1.6 == 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:127.0.0.1:161 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 10.10.10.10, or whatever IP you used.
        snmpbulkwalk -v2c -c 'sysmonr' 10.11.1.35 .1.3.6.1.2.1.1.4 
        snmpbulkwalk -v2c -c 'sysmonr' 10.11.1.35 .1.3.6.1.2.1.1.6
        • 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} .1.3.6.1.4.1.232.2.2.4.2.0
        snmpwalk -v2c -c 'mycommunitystring' {your HP server} .1.3.6.1.4.1.232.6.2.9.3.1.4
        • 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)

Optional

To take it a step further, I recommend downloading this Nagios script, and executing it against the HP Server you just set up. https://exchange.nagios.org/directory/Plugins/Hardware/Server-Hardware/HP-%28Compaq%29/check_hp/details

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