Zabbix使用Omsa来监控Dell服务器的硬件状态
OMSA(Open Manage Server Administrator)是Dell主机的硬件检测和维护软件
OpenManage系统管理方案是戴尔公司基于自主研发力量开发的IT系统管理解决方案,通过与业内领先的系统管理解决方案供应商密切配合,在深入了解用户对系统管理需求的基础上,OpenManage系统管理方案可以全面解决系统管理人员最关心的系统部署、系统监控和系统变更三大系统管理问题。
1、安装dell的yum源
wget -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
2、安装omsa
yum install -y srvadmin-base srvadmin-storageservices (推荐,只安装必要的组件) 或 yum install srvadmin-all
srvadmin-base:安装omsa基础组件,不包含webserver
srvadmin-storageservices:安装raid管理界面
3、创建软连接
ln -s /opt/dell/srvadmin/sbin/omreport /usr/bin/omreport
ln -s /opt/dell/srvadmin/sbin/omconfig /usr/bin/omconfig
4、启动cli模式omsa
service dataeng start 或者 /opt/dell/srvadmin/sbin/srvadmin-services.sh start
Ps: 如果启动报以下错误,需要安装openipmi服务 yum -y install OpenIPMI
报错信息:
[root@xxxxx/]# /opt/dell/srvadmin/sbin/srvadmin-services.sh start
StartingSystems Management Device Drivers:
Startingdell_rbu: Already started [ OK ]
Startingipmi driver: [FAILED]
StartingSystems Management Device Drivers:
Startingdell_rbu: Already started [ OK ]
Startingipmi driver: [FAILED]
DSM SAShared Services is already started
StartingDSM SA Connection Service: [ OK ]
DSM SAConnection Service stopped successfully.
5、zabbix客户端的配置
vim /usr/local/zabbix/etc/zabbix_agentd.conf.d/check_hardware.conf
#######################################################
UserParameter=hardware_cpu,omreport chassis processors|awk '/^Health/{if($NF=="Ok") {print 1} else {print 0}}'
UserParameter=hardware_cpu_model,awk -v hardware_cpu_crontol=`omreport chassis biossetup|awk '/CState/{if($NF=="Enabled") {print 0} else {print 1}}'` -v hardware_cpu_c1=`omreport chassis biossetup|awk '/C1[-|E]/{if($NF=="Enabled") {print 0} else{print 1}}'` 'BEGIN{if(hardware_cpu_crontol==0 && hardware_cpu_c1==0){print 0} else {print 1}}'
UserParameter=hardware_raid_health,awk -v vdisk_total_num=`omreport storage vdisk controller=0 | grep -c "^ID"` -v vdisk_ok_num=`omreport storage vdisk controller=0 |awk '/^Status/ {if($NF == "Ok") {print 1}else{print 0}}'` 'BEGIN{if(vdisk_total_num == vdisk_ok_num) {print 1} else {print 0}}'
UserParameter=hardware_memory_health,awk -v hardware_memory=`omreport chassis memory|awk '/^Health/{print $NF}'` 'BEGIN{if(hardware_memory=="Ok") {print 1} else {print 0}}'
UserParameter=hardware_temp,awk -v temperature_total_num=`omreport chassis temps | grep -c "^Index"` -v temperature_ok_num=`omreport chassis temps | awk '/^Status/{if($NF == "Ok") count=count+1}END{print count}'` 'BEGIN{if(temperature_total_num == temperature_ok_num) {print 1}else{print 0}}'
UserParameter=hardware_physics_health,awk -v pdisk_total_num=`omreport storage pdisk controller=0 | grep -c "^ID"` -v pdisk_ok_num=`omreport storage pdisk controller=0 | awk '/^Status/ {if($NF == "Ok") count=count+1}END{print count}'` 'BEGIN{if(pdisk_total_num == pdisk_ok_num) {print 1} else {print 0}}'
UserParameter=hardware_power_health,awk -v power_total_num=`omreport chassis pwrsupplies | grep -c "Index"` -v power_ok_num=`omreport chassis pwrsupplies | awk '/^Status/ {if($NF == "Ok") count=count+1}END{print count}'` 'BEGIN{if(power_total_num == power_ok_num){print 1}else{print 0}}'
UserParameter=hardware_battery,omreport chassis batteries|awk '/^Status/{if($NF=="Ok") {print 1} else {print 0}}'
UserParameter=hardware_nic_health,awk -v hardware_nic_number=`omreport chassis nics |grep -c "Interface Name"` -v hardware_nic=`omreport chassis nics |awk '/^Connection Status/{print$NF}'|wc -l` 'BEGIN{if(hardware_nic_number == hardware_nic) {print 1} else {print0}}'
UserParameter=hardware_fan_health,awk -v hardware_fan_number=`omreport chassis fans|grep -c "^Index"` -v hardware_fan=`omreport chassis fans|awk '/^Status/{if($NF=="Ok")count+=1}END{print count}'` 'BEGIN{if(hardware_fan_number == hardware_fan) {print 1} else {print 0}}'
#############################################################################
6、重启zabbix_agentd服务
/etc/init.d/zabbix_agentd restart
7、测试获取数据:出现值为正常
[root@xxxxxx]# zabbix_get -s 127.0.0.1 -k hardware_memory_health
1