小乔 发表于 2019-1-13 13:39:52

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(阵列详细信息)
               上面命令执行正确,会出现以下信息:
              
   http://s3.运维网.com/wyfs02/M02/53/97/wKioL1RsCcqw5cJAAAFrOicQJeE982.jpg
        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
  
               如果命令行正确,会出现下面的信息:
               http://s3.运维网.com/wyfs02/M02/53/99/wKiom1RsCWHidQ7fAAUBjHdb-W4503.bmp
  
        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://s3.运维网.com/wyfs02/M02/53/97/wKioL1RsCh2RI7llAAC99hDYkBo617.jpg
  
               异常状态图:
              http://s3.运维网.com/wyfs02/M02/53/99/wKiom1RsCbfySdTIAAB9hoLxqRQ987.jpg
  
  参考文献:
               http://kyle.xlau.org/posts/nagios-plugin-for-HP.html
               http://labs.consol.de/lang/en/nagios/check_hpasm/
               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://downloads.linux.hp.com/SDR/getting_started.html
               http://2528332.blog.运维网.com/2518332/972291
               http://www.linuxde.net/2013/07/14885.html
  
  
  
              
  




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