现在监控软件非常多,nagios,zbbiax什么数不胜数,不过现在最多的还是nagios和zbbiax、cacti监控工具。

下面我们就来说一下,如果使用nagios来监测dell服务器的硬件,这样你就可以像监控服务那样监控服务器的各种硬件状态了!

准备工作:

1、服务器端

服务端我这边使用的centos6.3的系统,运行nagios最高的版本(这个版本其实是无所谓的),因为资源的原因,我服务端用的虚拟机。

2、被检测端

这个一定要使用一台dell的实体机,具体是R410是12代的什么服务器俺就不管了

开始部署:

1、服务器端

我这里提前安装了nagios,如果你不知道怎么搭建nagios的话,建议你去google上面搞明白在了过来看这里,反正文多档的是!


下载check_openmanage这个脚本程序,把他放在nagios的libexec插件库中,然后到/nagios/etc/objects/目录中修改commands.cfg

添加如下信息:

1 define command{

2 command_name omsa_status

3 command_line $USER1$/check_openmanage -H $HOSTADDRESS$

4 }

5 #mosa进行整体检测

6 define command{

7 command_name omsa_cpu

8 command_line $USER1$/check_openmanage -H $HOSTADDRESS$ --only cpu -p

9 }

10 #检测cpu硬件

11 define command{

12 command_name omsa_temp

13 command_line $USER1$/check_openmanage -H $HOSTADDRESS$ --only temp -w $ARG1$ -c $ARG2$ -P

14 }

15 #对服务器的温度进行监控,同时自定义阀值

16 define command{

17 command_name omsa_storage

18 command_line $USER1$/check_openmanage -H $HOSTADDRESS$ --only srotage -p

19 }

20 #对存储设备进行监控

21 define command{

22 command_name omsa_intrusion

23 command_line $USER1$/check_openmanage -H $HOSTADDRESS$ --only intrusion -p

24 }

25 #对服务器机箱锁状态进行监控

26 define command{
       command_name    omsa_fans
       command_line    $USER1$/check_openmanage -H $HOSTADDRESS$ --only fans -p
}

这个是监控内存的,only有如下参数:

critical     Only output critical alerts. It is possible to use the --check option together with this option to adjust checks.
warning     Only output warning alerts. It is possible to use the --check option together with this option to adjust checks.
chassis     Only check chassis components, i.e. everything but storage and log content.
storage     Only check storage components
memory     Only check memory modules
fans     Only check fans
power     Only check power supplies
temp     Only check temperatures
cpu     Only check processors
voltage     Only check voltage probes
batteries     Only check batteries
amperage     Only check power usage
intrusion     Only check chassis intrusion
sdcard     Only check removable flash media
esmhealth     Only check ESM log health
esmlog     Only check ESM log content
alertlog     Only check alertlog content


下面添加services.cfg


define service {
       use                 test
       host_name           test01
       service_description  omsa_cpu
       check_command       omsa_cpu

}

我只是列举了一条,如果你在发现为什么是omsa_cpu,这个omsa是什么的话,我们一会儿说到被监控端的时候在详细说下。

这样,我们的服务器端就部署ok,下面来说被监控端。



我在被监控端上面的操作系统同样是centos6.3,服务器型号是R410.首先我要做的就是安装dellOMSA管理组件。我们就是通过这个玩意来监控服务器的硬件的。


安装步骤如下:

官方网址:http://linux.dell.com/repo/hardware/

安装方法(centos linux 6.3x64):

被监控服务器:使用yum安装

1) 增加dell的yum库

wget -q -O - http://linux.dell.com/repo/hardware/OMSA_6.5.2/bootstrap.cgi | bash(这个版本太老了,如果出现问题,dell客服会让你安装下面的版本,也是最新的版本)

wget -q -O - http://linux.dell.com/repo/hardware/OMSA_7.3/bootstrap.cgi | bash



2) 安装srvadmin(这个很重要,所有的组件全在这个里面,如果系统比较完整,需要安装42个包;稍微次一点,需要安装60多个包呢)

Installing OpenManage Server Administrator

yum install srvadmin-all


3)安装firmware-tools(这个是升级主板用的,如果你用不到这样的功能,可以不用安装,我测试过不安装不影响服务的)

Installing firmware-tools to manage BIOS and firmware updates

yum install dell_ft_install

这个是你在浏览器里面输入https://主机ip:1311,你就可以进入OMSA的web界面了,用户名是root,密码是系统密码!

这样,你就可以监控到所有的信息了!

下面我附上check_openmanage的官方说明:

http://folk.uio.no/trondham/software/check_openmanage.html


有的文章说可以使用nrpe的模式来监控,会降低nagios的性能损耗,不过我没有测试过!