{"id":2186,"date":"2015-08-19T11:20:32","date_gmt":"2015-08-19T15:20:32","guid":{"rendered":"https:\/\/infotechguy.net\/?p=2186"},"modified":"2025-02-22T11:32:01","modified_gmt":"2025-02-22T16:32:01","slug":"linux-hp-proliant-snmp-agent-setup","status":"publish","type":"post","link":"https:\/\/infotechguy.net\/?p=2186","title":{"rendered":"Linux &#8212; HP Proliant SNMP Agent setup"},"content":{"rendered":"<p>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 <a href=\"https:\/\/www.icinga.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">Icinga<\/a> to monitor server hardware via SNMP.<\/p>\n<p>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.<\/p>\n<p>Let&#8217;s download the packages, check\u00a0<a href=\"http:\/\/downloads.linux.hp.com\/SDR\/repo\/mcp\/debian\/pool\/non-free\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/downloads.linux.hp.com\/SDR\/repo\/mcp\/debian\/pool\/non-free\/<\/a>\u00a0for latest versions<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cd \/root \nmkdir hp-agents \ncd hp-agents \nwget http:\/\/downloads.linux.hp.com\/SDR\/repo\/mcp\/debian\/pool\/non-free\/hp-health_10.0.0.1.3-4._amd64.deb \nwget http:\/\/downloads.linux.hp.com\/SDR\/repo\/mcp\/debian\/pool\/non-free\/hp-snmp-agents_10.0.0.1.23-21._amd64.deb<\/pre>\n<pre class=\"lang:default decode:true\"><\/pre>\n<p>You will need snmp, snmpd, and some other library files before install the packages.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">apt-get install snmpd snmp lib32gcc1 libc6-i386 libsnmp30<\/pre>\n<p>Now install the two(2) agents. Start with hp-health first, then install hp-snmp-agent<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dpkg -i hp-health*.deb \ndpkg -i hp-snmp-agents*.deb<\/pre>\n<p><!--more--><\/p>\n<p>If dpkg complains about any missing packages, just do a<strong> apt-get -f install<\/strong> should take care of that.<\/p>\n<p>Now, we need to reconfigure snmpd. We can do this 1 of 2 ways. Either use the<strong>\u00a0\/sbin\/hpsnmpconfig script<\/strong>, or edit the <strong>\/etc\/snmpd\/snmpd.conf<\/strong> file directly. I&#8217;ll edit the snmpd.conf directly,<strong><em> so edit \/etc\/snmp\/snmpd.conf<\/em><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">dlmod cmaX \/usr\/lib\/libcmaX64.so \nrocommunity mycommunitystring 10.10.10.10 \ntrapcommunity mycommunitystring \ntrapsink 10.10.10.10 mycommunitystring \nsyscontact Jimmah &lt;jim@techjockey.net&gt; \nsyslocation Somewhere,Someplace<\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Pretty much, what we&#8217;ve done is set 10.10.10.10 as a trap destination, and an allowed poller(can perform SNMP walks\/queries)<\/li>\n<li>We&#8217;ve also set a custom community string <em>mycommunitystring<\/em>, this is usually public by default<\/li>\n<li>Setting sysContact and sysLocation, which are RFC standard SNMP OID<br \/>\n<strong>OID 1.3.6.1.2.1.1.4 == SysContact<\/strong><br \/>\n<strong> OID 1.3.6.1.2.1.1.6 == SysLocation<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>The<strong> dlmod cmaX<\/strong> is something the hpsnmpconfig script adds. I believe it allows the SNMPd to communicate with hp-snmp-agent<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>One last thing in the snmpd.conf file. Depending 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 some reason, SNMP queries won&#8217;t work unless this is changed.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Now, restart all services involved.\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/etc\/init.d\/hp-health restart \n\/etc\/init.d\/hp-snmp\/agent restart \n\/etc\/init.d\/snmpd restart<\/pre>\n<\/li>\n<li>Let&#8217;s test. Must be done on server 10.10.10.10, or whatever IP you used.\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">snmpbulkwalk -v2c -c 'sysmonr' 10.11.1.35 .1.3.6.1.2.1.1.4 \nsnmpbulkwalk -v2c -c 'sysmonr' 10.11.1.35 .1.3.6.1.2.1.1.6<\/pre>\n<ul>\n<li>The above commands should output you <strong>sysContact<\/strong> and <strong>sysLocation<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Let&#8217;s also test the hp-snmp-agent OIDs, to make sure it is properly integrating\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">snmpwalk -v2c -c 'mycommunitystring' {your HP server} .1.3.6.1.4.1.232.2.2.4.2.0\nsnmpwalk -v2c -c 'mycommunitystring' {your HP server} .1.3.6.1.4.1.232.6.2.9.3.1.4<\/pre>\n<ul>\n<li>The first test should output the Proliant Product Platform, such as &#8220;ProLiant DL380 G6&#8221;<\/li>\n<li>The second, should output the status as an integer of the Power Supplies. (1 = other, 2 = ok, 3 = degraded, 4=failed)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<hr \/>\n<h3>Optional<\/h3>\n<p>To take it a step further, I recommend downloading this Nagios script, and executing it against the HP Server you just set up.<a href=\"https:\/\/exchange.nagios.org\/directory\/Plugins\/Hardware\/Server-Hardware\/HP-%28Compaq%29\/check_hp\/details\" target=\"_blank\" rel=\"noopener noreferrer\">\u00a0https:\/\/exchange.nagios.org\/directory\/Plugins\/Hardware\/Server-Hardware\/HP-%28Compaq%29\/check_hp\/details<\/a><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chmod +x check_hp \n.\/check_hp -H {you HP server IP} -C mycommunitystring<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":4240,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[137],"class_list":["post-2186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-snmp"],"_links":{"self":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/2186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2186"}],"version-history":[{"count":1,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/2186\/revisions"}],"predecessor-version":[{"id":4193,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/posts\/2186\/revisions\/4193"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=\/wp\/v2\/media\/4240"}],"wp:attachment":[{"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infotechguy.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}