@cdmonkey
2015-11-03T08:49:02.000000Z
字数 2925
阅读 1363
Nagios
对于服务器的硬件检测,目前业界主要有如下两种方案:
服务器官方提供的专用工具:HP-hpacucli、DELL-OMSA etc.
智能平台管理接口:IPMI,Intelligent Platform Management Interface
对服务器进行IPMI管理,则需要被检测的系统具有支持智能平台管理接口的硬件设备。
OMSA Repository:http://linux.dell.com/repo/hardware/latest/
check_openmanage Manual:http://folk.uio.no/trondham/software/check_openmanage.html
http://www.tuicool.com/articles/AbABZrY
http://linux.dell.com/repo/hardware/omsa.html
插件check_openmanage是“Nagios”上用来检测戴尔服务器(包括PowerEdge系列及部分PowerVault系列服务器)的硬件健康状况的插件。该插件通过使用运行于被监控节点上的“OpenManage Server Administrator(OMSA)”软件来取得监测信息。该插件可以使用SNMP或NRPE的方式收集监测信息。该插件可以获得服务器的存储、内存、电源及处理器温度等信息,并且对任何部件故障或正常参数以外的操作,给出警告信息。

http://zh.community.dell.com/techcenter/systems-management/w/wiki/561.omsalinux
安装依赖包:
yum install libcmpiCppImpl0 libwsman1 sblim-sfcb sblim-sfcc openwsman-client openwsman-server
[root@Node-A2 ~]# wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash#检查一下结果,可以看到服务器上多出了一个Dell软件仓库的配置文件:[root@Node-A2 ~]# ll /etc/yum.repos.d/ |grep dell-rw-r--r-- 1 root root 1004 Oct 20 15:31 dell-omsa-repository.repo#同时我们注意到,它还会从新配置好的软件仓库里安装四个rpm安装包:Installing:yum-dellsysid x86_64Installing for dependencies:libsmbios x86_64python-smbios x86_64smbios-utils-python x86_64
#说明一下,如果正确配置了软件源,即使前面忘记安装依赖包,这里也会自己检查依赖关系,安装必要的依赖包:[root@Node-A2 ~]# yum install srvadmin-all
首先需要安装相关的Perl功能模块,每个模块所对应的具体功能请查阅官方说明。
# For RHEL6 and CentOS6 the best way is to use EPEL:[root@Node-A2 ~]# yum install -y perl-Net-SNMP perl-Config-Tiny
[root@nagios-new ~]# vim /usr/local/nagios/etc/cgi.cfg# ESCAPE HTML TAGSescape_html_tags=1# My advice is to turn this off:escape_html_tags=1 --> escape_html_tags=0
首先你需要决定使用何种方式使用检测插件收集信息。使用SNMP的方式属于服务器主动收集监测信息,应于服务端运行使用该插件。使用NRPE、check_by_ssh等方法的话,属于被动获取信息,应于被监控节点上运行使用该插件。
# Creating a hostgroup:[root@nagios-new ~]# vim /usr/local/nagios/etc/objects/hosts.cfg# hostgroup for Dell serversdefine hostgroup{hostgroup_name dell-serversalias Dell Servers}
# Defining the hosts:define host {host_name my-server1.foo.orgalias my-server1address 192.168.10.12use generic-hosthostgroups dell-servers}
# Creating a servicegroup:[root@nagios-new ~]# vim /usr/local/nagios/etc/objects/services.cfg# Servicegroup for Dell OpenManagedefine servicegroup {servicegroup_name dell-openmanagealias Dell server health status}
选择通过SNMP进行检测的话,那么就要于服务端上定义相关指令。
# Openmanage check via SNMP:define command {command_name check_openmanagecommand_line /path/to/check_openmanage -H $HOSTADDRESS$}
# Defining the service:[root@nagios-new ~]# vim /usr/local/nagios/etc/objects/services.cfg# Dell OMSA statusdefine service {use generic-servicehostgroup_name dell-serversservicegroups dell-openmanageservice_description Dell OMSAcheck_command check_nrpe!check_openmanagenotes_url http://folk.uio.no/trondham/software/check_openmanage.html}
上面的所有设置均于监测服务端进行编辑修改,而仅需在被监控节点上定义相关指令:
# The NRPE config has the following:[root@nagios-new ~]# vim /usr/local/nagios/etc/objects/commands.cfg