tilg 发表于 2013-9-12 09:19:12

Nagios+OMSA监控dell设备硬件

现在监控软件非常多,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_descriptionomsa_cpu
       check_command       omsa_cpu
}
我只是列举了一条,如果你在发现为什么是omsa_cpu,这个omsa是什么的话,我们一会儿说到被监控端的时候在详细说下。
这样,我们的服务器端就部署ok,下面来说被监控端。


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

安装步骤如下:
官方网址: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的性能损耗,不过我没有测试过!

阿里狼 发表于 2013-9-14 03:47:17

学习了,谢谢分享、、、

sxyzy 发表于 2013-9-15 08:45:40

男人有冲动可能是爱你,也可能是不爱,但没有冲动肯定是不爱!

cxwpf200 发表于 2013-9-17 08:07:21

商女不知亡国恨、妓女不懂婚外情。

dopost 发表于 2013-9-19 23:00:22

相当不错,感谢无私分享精神!

zhaoke0727 发表于 2013-9-25 10:26:49

不知该说些什么。。。。。。就是谢谢

lihanchuan125 发表于 2013-10-1 08:44:26

找不到恐龙,就用蜥蜴顶
页: [1]
查看完整版本: Nagios+OMSA监控dell设备硬件