Oct 14

setup Nagios check_hpasm for hp servers

It is equally important to monitor hardware components of the servers specially cpu, RAM , fans etc while monitoring it’s application component.
Fortunately hp server provides more flexibility to monitor it’s hardware component compare to other vendors. This article guides you how to monitor
HP Proliant server hardware component using Nagios plugin called check_hpasm with SNMP. Same can be accomplished using nrpe plugin, but it doesn’t demonstrate here.

Configuration is divided into 2 sections. First section guides how to configure remote monitoring server which is going to be monitored by Nagios.
Last section is for Nagios Server. Let’s look at how to setup Nagios check_hpasm for hp servers .

Remote Server :-

IP :
OS : Centos 7.1

1) Install snmp

yum install net-snmp net-snmp-utils

2) Configure HP Repo

Please refer this for more details :-  http://downloads.linux.hpe.com/SDR/project/mcp/

—-This is for Centos 7.1, modify below repo according to your server. Refer above URL.
vim /etc/yum.repos.d/mcp.repo

name=Management Component Pack

3) Install HP health and HP snmp agent

yum install hp-health
yum install hp-snmp-agents

4) configure HP snmp agent

type following on linux terminal with root privileges.

here use following read only community string :- ROComm34ss
This community string will use Nagios server when it is retrieving snmp data from remote server which we do configuration at the moment.

5) Start snmp services

chkconfig hp-snmp-agents on
service hp-snmp-agents start
service snmpd start

Monitoring Server :-

This is the Nagios monitoring server.

1) Install Nagios

please refer this article, if don’t install nagios yet.

2) Install check_hpasm


Download latest version or

3) Compile and install check_hpasm

Assuming nagios plugin directory is /usr/lib64/nagios/plugins.

./configure –prefix=/usr/lib64/nagios/plugins –with-nagios-user=nagios –with-nagios-group=nagios –enable-perfdata
make install

4) Confgure remote monitoring server setting

open or create *.cfg file for remote server.
vim /usr/local/nagios/etc/servers/test_svr.cfg

define service{
use                     generic-service
host_name               TEST_SVR
service_description     Server Information
check_command           check_hpasm
contact_groups          sysadmin
normal_check_interval   15; Check the service every x minutes under normal conditions
retry_check_interval    2;5; Re-check the service every x minutes until a hard state can be determined

5) Add check_hpasm commands.cfg

vim /usr/local/nagios/etc/objects/commands.cfg

define command {
command_name    check_hpasm
#command_line   $USER1$/check_hpasm $HOSTADDRESS$ -C $ARG1$
command_line   $USER1$/check_hpasm -H -C ‘ROComm34ss’

6) Test connection

/usr/local/nagios/libexec/check_hpasm -H -C ‘ROComm34ss’

snmp port should be opened at remote server.

7) Restart Nagios

Below is sample output of the Nagios which indicate memory error of the HP server.Nagios check_hpasm











Skip to comment form

  1. cristinaxbmc

    Thanks for your article, i have a problema after adding the HP repository. When i try yum, i get the next error:

    failure: repodata/repomd.xml from mcp: [Errno 256] No more mirrors to try.
    http://downloads.linux.hp.com/repo/mcp/CentOS/7.0/x86_64/10.0/repodata/repomd.xml: [Errno 14] HTTP Error 502 – Bad Gateway

    Could you help me?

    Thanks in advance.

    1. admin

      Thanks for comment !

      HP changed the repo url . this url (downloads.linux.hpe.com) should be changed into “downloads.linux.hpe.com”
      New HP Repo url :- http://downloads.linux.hpe.com/SDR/project/mcp/

      I updated the tutorial for new HP repo.

      1. cristinaxbmc

        Great tutorial! I changed the baseurl of the repo with baseurl=http://downloads.linux.hpe.com/repo/mcp/centos/7.2/x86_64/current because it has installed Centos 7.2. Now i can monitoring the hardware of my HP Prolian 360 :)

        1. admin

          Glad to hear that :)

Leave Your Thought Here