使用Centreon监控HP惠普服务器硬件状态

本文所涉及插件及安装包下载地址:https://github.com/zhangrj/check_hpasm-hpasm-hphealth

一、工作原理概述

通过在惠普服务器安装hpasm/hp-health软件 (HP Advanced Server Management)监控服务器硬件状态,包括 硬盘、CPU、电源、风扇、温度和内存模块,nagios插件通过snmp协议获取这些信息。

二、安装nagios插件check_hpasm

直接拷贝文件check_hpasm至/usr/local/nagios/libexec/或者/usr/lib/nagios/plugins/。

三、安装hpasm/hp-health

hpasm在较新版本中被拆分为hp-health+hp-snmp-agents,可以认为hpasm=hp-health + hp-snmp-agents。

1、在suse9中,可安装hpasm,过程如下:

szmrc1:~ # rpm -ivh hpasm-7.2.0-198.sles9.i586.rpm 
Preparing...                ########################################### [100%]
   1:hpasm                  ########################################### [100%]
Please read the Licence Agreement for this software at

         /opt/compaq/hpasm/hpasm.license

By not removing this package, you are accepting the terms
of the "License for HP Value Added Software".
==============================================================================
NOTE: In order to activate the software contained in this package, you must
      type 'hpasm activate' as 'root' user.
      You may subsequently reset your agent configuration by typing
      '/etc/init.d/hpasm configure' or '/etc/init.d/hpasm reconfigure'.
==============================================================================
The hpasm RPM has installed successfully.

根据提示输入hpasm activate激活软件,然后输入/etc/init.d/hpasm configure完成相关配置。

2、在suse11中,可安装hp-health+hp-snmp-agents,过程如下:

SZMRC8:~ # rpm -ivh hp-health-10.30-1752.14.sles11.x86_64.rpm hp-snmp-agents-10.00-2654.35.sles11.x86_64.rpm net-snmp-5.4.2.1-8.12.6.1.x86_64.rpm perl-SNMP-5.4.2.1-8.12.6.1.x86_64.rpm 
warning: hp-health-10.30-1752.14.sles11.x86_64.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID b1275ea3
warning: hp-snmp-agents-10.00-2654.35.sles11.x86_64.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 5ce2d476
Preparing...                ########################################### [100%]
   1:hp-health              ########################################### [ 25%]
Please read the Licence Agreement for this software at

         /opt/hp/hp-health/hp-health.license

By not removing this package, you are accepting the terms
of the "HP Proliant Essentials Software End User License Agreement".
  Using Proliant High Performance
        IPMI based System Health Monitor
  Using standard Linux IPMI device driver
Starting ipmi drivers:                                                done
  Starting Proliant High Performance
  IPMI based System Health Monitor (hpasmxld): 
                                                                      done
  
Starting HP Advanced Server Recovery Daemon                           done
The hp-health RPM has installed successfully.
   2:net-snmp               ########################################### [ 50%]
Updating etc/sysconfig/net-snmp...
   3:hp-snmp-agents         ########################################### [ 75%]
Please read the Licence Agreement for this software at

         /opt/hp/hp-snmp-agents/hp-snmp-agents.license

By not removing this package, you are accepting the terms
of the "HP Proliant Essentials Software End User License Agreement".
==============================================================================
NOTE: In order to activate the software contained in this package, you must
      type '/sbin/hpsnmpconfig' as 'root' user.
      Once configuration is completed start the agents by typing
      /etc/init.d/hp-snmp-agents start
==============================================================================
   4:perl-SNMP              ########################################### [100%]

根据提示键入/sbin/hpsnmpconfig配置hp-snmp客户端,然后键入/etc/init.d/hp-snmp-agents启动客户端,不在赘述。

四、测试插件

在采集机上,测试check_hpasm能否正确获取监控数据,过程如下:

[root@centreon libexec]# ./check_hpasm --help
查看用法
[root@centreon libexec]# ./check_hpasm -H *.*.*.* -C snmp_community
OK - System: 'proliant bl460c g6', S/N: 'CNG001S3QZ', ROM: 'I24 10/01/2009', hardware working fine, da: 1 logical drives, 2 physical drives

如果不能取得数据,在排除网络不通的情况下,最可能的原因是161端口已被占用,导致snmpd使用了端口1611。在测试插件时指定端口为1611,观看能否取得监控数据。

正常情况下端口使用情况:

szmrc4:~ # netstat -ntplu|grep snmp
tcp        0      0 0.0.0.0:199             0.0.0.0:*               LISTEN      12323/snmpd         
udp        0      0 127.0.0.1:25375         0.0.0.0:*                           12323/snmpd         
udp        0      0 0.0.0.0:161             0.0.0.0:*                           12323/snmpd         
udp        0      0 0.0.0.0:162             0.0.0.0:*                           12942/snmpagent     
udp        0      0 0.0.0.0:163             0.0.0.0:*                           12942/snmpagent 

默认161端口无法获取数据时的端口使用情况:

szmrc5:/etc # netstat -nutpl|grep snmp
tcp        0      0 0.0.0.0:199             0.0.0.0:*               LISTEN      9822/snmpd          
udp        0      0 127.0.0.1:25375         0.0.0.0:*                           9822/snmpd          
udp        0      0 0.0.0.0:161             0.0.0.0:*                           14790/snmpagent     
udp        0      0 0.0.0.0:162             0.0.0.0:*                           14790/snmpagent     
udp        0      0 0.0.0.0:1611            0.0.0.0:*                           9822/snmpd

测试插件时指定端口为1611:

[root@centreon libexec]# ./check_hpasm -H *.*.*.* -C snmp_community --port 1611
OK - System: 'proliant bl460c g6', S/N: 'CNG001S3QZ', ROM: 'I24 10/01/2009', hardware working fine, da: 1 logical drives, 2 physical drives

五、Centreon中新建command

comand类型为check,Command Line为:

$USER4$/check_hpasm -H $HOSTADDRESS$  -C $ARG1$ --port $ARG2$ --perfdata=long

Argument Descriptions 描述如下:

ARG1 : snmp_community_string

其中$USER4$表示check_hpasm插件所在路径。如果snmp使用的端口为1611或其他,则Command Line改为:

$USER4$/check_hpasm -H $HOSTADDRESS$  -C $ARG1$ --port $ARG2$ --perfdata=long

Argument Descriptions 描述如下:

ARG1 : snmp_community_string
ARG2 : 1611

六、添加service

为被监控host添加service,check command选择第五步中新建的command,填入相关信息。

之后照例重启监控引擎,configuration-monitoring engines,选择poller, 
Restart Monitoring Engine 的method选择restart,勾选前四项,点击Export即可。

 本文链接:http://www.icoder.top/blog/?p=805

Zabbix监控HP服务器硬件信息:HP服务器硬件管理方面提供了自己管理工具hpacucli,通过该工具可以查看HP服务器的RAID信息,服务器硬盘等信息。 rpm -ivh hpacucli-9.40-12.0.x86_64.rpm hpacucli ctrl all show config 查看服务器RAID信息,硬盘是否正常。 通过hpacucli ctrl all show config detail命令可以详细地查看RAID和硬盘的信息。 HP官方还有一个hpasmcli管理工具,可以很详细查看服务器CPU,内存,处理器,电源等的温度信息。 1)安装hpasmcli工具(下载地址:HP hpasmcli管理工具) rpm -ivh hp-health-9.40-1602.44.rhel6.x86_64.rpm 通过hpasmcli -s 'show'查看类似于help的帮助信息,监控的时候要重点关注 DIMM(内存)、FANS(风扇)、POWERSUPPLY(电源模块)、SERVER(系统)、CPU、TEMP(温度)等信息。 [root@monitor ~]# hpasmcli -s 'show'Invalid Arguments Zabbix监控总结起来有两种思路:第一就是server通过agentd方式获取数据,这种方式需要定义UserParameter参数,即KEY。第二就是server通过trapper的方式获取数据,即agentd将数据主动sender给server或者proxy。我这里是通过第二种traper的方式监控的。第一种方式server有时候会取不到数据,became not supported: Received value [] is not suitable for value type [Numeric (unsigned)] and data type [Decimal], 会产生上面的错误。 首先查看我监控的脚本,由于是通过traper的思路进行监控,log_file文件依次定义了要监控服务器的主机名(hostname),监控项key以及监控的值。 各种脚本网上都有,这儿主要是工具
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

洒满阳光的午后

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值