linre 发表于 2014-11-20 10:20:06

Nagios监控HP硬件状态

Nagios监控HP硬件状态一,监控思想
       可以使用两种模式,check_nrpe方式和SNMP方式,这里我们采用SNMP代理方式。
       两种方式都依赖HP的ProLiant Support Pack(PSP)软件包,有两种方式安装PSP包,一种tar包,一种RPM包,经过实践tar包很难安装,所以最终采用rpm包方式。
二,实施步骤
       1,到 http://downloads.linux.hp.com/SDR/getting_started.html 下载 add_repo.sh 脚本,并上传到HP服务器。

       2,用root用户登录,在服务器上执行以下命令:
             chmod 700 add_repo.sh
             ./add_repo.sh spp -d rhel -r 6Server -y hp.repo
(运行该脚本后会在/etc/yum.repos.d/生成一个hp.repo文件,
            -d   linux的发行版本,如 rhel、centos,
            -r    linux版本,如6server,
            -y   指定yum客户端的配置文件的名称,如hp.repo)

             yum -y installhp-health hpacucli hp-smh-templates hpacucli
      3,我们先命令行检测下:
             hpacucli ctrl all show config
             hpacucli ctrl slot=0 show config detail(阵列详细信息)
             上面命令执行正确,会出现以下信息:
            

      4,修改 snmpd.conf 配置文件,在文件最后加上以下内容,并修改公共字符串。
             vi /etc/snmp/snmpd.conf
         
             # Following entries were added by HP Insight Management Agents at
             dlmod cmaX /usr/lib64/libcmaX64.so
             rwcommunity hp 127.0.0.1
             rocommunity sou_shi 0.0.0.0
             rwcommunitysou_shi 127.0.0.1
             rocommunity sou_shi default    -V systemonly
             trapcommunity hp
             trapsink   localhost sou_shi

      5,重新启动SNMP服务
             /etc/init.d/snmpd restart

      6,启动HP检测服务
             /etc/init.d/hp-snmp-agents start
             /etc/init.d/hp-health start

      7,安装nagios服务端监控
             在nagios服务器端安装 check_hpasm-4.6.3.tar.gz,软件下载地址如下: http://labs.consol.de/lang/en/nagios/check_hpasm/
             tar -zxvf check_hpasm-4.6.3.tar.gz
             ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --with-degrees=celsius --enable-hpacucli --enable-hwinfo --enable-extendedinfo --enable-perfdata
             make && make install
             先用命令行进行测试:
             /usr/local/nagios/libexec/check_hpasm --hostname 192.168.1.224-C sou_shi

             如果命令行正确,会出现下面的信息:
            

   8,修改nagios配置文件
             commands.cfg 内容如下:
             ##############################hp_monitor########################

             define command {
                         command_name                check_hp_hardware
                         command_line                /usr/local/nagios/libexec/check_hpasm -H $HOSTADDRESS$ -C sou_shi
             }
   
             被监控主机 配置内容如下:               
            ##########################hp_monitor##################################

            define service {
                     use                              hp-service
                     host_name                  192.168.1.223
                     service_description       check_hp_hardware
                     check_command         check_hp_hardware
               }

   8,最终监控效果图
            

             异常状态图:
            

参考文献:
http://www.iyunv.com/thread-31607-1-1.html
http://www.iyunv.com/thread-31608-1-1.html
https://alteeve.ca/w/HP-Specific_Notes
http://www.it-slav.net/blogs/2010/03/02/monitor-hp-proliant-with-nagios-or-op5-monitor/
http://labs.consol.de/lang/en/nagios/check_hpasm/
http://www.iyunv.com/thread-31609-1-1.html


页: [1]
查看完整版本: Nagios监控HP硬件状态