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 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 compatbable HP Proliant G series. The current stable relase 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.
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
1
2
|
chmod +x check_hp
./check_hp -H {you HP server IP} -C mycommunitystring
|
- Let’s download the packages, check http://downloads.linux.hp.com/SDR/repo/mcp/debian/pool/non-free/ for latest versions.123456cd /rootmkdir hp-agentscd hp-agentswget http://downloads.linux.hp.com/SDR/repo/mcp/debian/pool/non-free/hp-health_10.0.0.1.3-4._amd64.debwget 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.1apt-get install snmpd snmp lib32gcc1 libc6-i386 libsnmp30
- Now install the two(2) agents. Start with hp-health first, then install hp-snmp-agent12dpkg -i hp-health*.debdpkg -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.conf123456dlmod cmaX /usr/lib/libcmaX64.sorocommunity mycommunitystring 10.10.10.10trapcommunity mycommunitystringtrapsink 10.10.10.10 mycommunitystringsyscontact Jimmah <jim@thejimmahknows.com>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 OID1234567891011<code>OID 1.3.6.1.2.1.1.4 == SysContactOID 1.3.6.1.2.1.1.6 == SysLocation</code></code><pre></li><li>The dlmod cmaX is something the hpsnmpconfig script adds. I believe it allows the SNMPd to communictate with hp-snmp-agent</li><li>One last thing in the snmpd.conf file. Depnding on what Distro you are using and version of snmpd, look for the line<strong> udp:127.0.0.1:161</strong> and change it to <strong>udp:161.</strong> For somereason, SNMP queries won't work unless this is changed.</li></ul></li><li>Now, restart all services involved.<pre><code>/etc/init.d/hp-health restart/etc/init.d/hp-snmp/agent restart/etc/init.d/snmpd restart
- Let’s test. Must be done on server 10.10.10.10, or whatever IP you used.12snmpbulkwalk -v2c -c 'sysmonr' 10.11.1.35 .1.3.6.1.2.1.1.4snmpbulkwalk -v2c -c 'sysmonr' 10.11.1.35 .1.3.6.1.2.1.1.6
- The above commands should output you sysContact and sysLocation
- Let’s also test the hp-snmp-agent OIDs, to make sure it is properly integrating123snmpwalk -v2c -c 'mycommunitystring' {your HP server} .1.3.6.1.4.1.232.2.2.4.2.0snmpwalk -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)
- Let’s download the packages, check http://downloads.linux.hp.com/SDR/repo/mcp/debian/pool/non-free/ for latest versions.
Комментарии
Отправить комментарий