温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Nagios监控HP硬件状态

发布时间:2020-06-03 02:35:50 来源:网络 阅读:814 作者:crazy_charles 栏目:移动开发

Nagios监控HP硬件状态

一,监控思想

       可以使用两种模式,check_nrpe方式和SNMP方式,这里我们采用SNMP代理方式。

       两种方式都依赖HPProLiant 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的发行版本,如 rhelcentos

              -r    linux版本,如6server 

              -y   指定yum客户端的配置文件的名称,如hp.repo 

 

             yum -y install  hp-health hpacucli hp-smh-templates hpacucli 

        3,我们先命令行检测下:

             hpacucli ctrl all show config

             hpacucli ctrl slot=0 show config detail(阵列详细信息)

             上面命令执行正确,会出现以下信息:

             

 Nagios监控HP硬件状态

        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

             rwcommunity  sou_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

 

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

             Nagios监控HP硬件状态

 

        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,最终监控效果图

             Nagios监控HP硬件状态

 

             异常状态图:

            Nagios监控HP硬件状态

 

参考文献:

             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.51cto.com/2518332/972291

             http://www.linuxde.net/2013/07/14885.html

 

 

 

             


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI