UserParameter=hardware_power_health,awk -vhardware_power_number=`omreport chassis pwrsupplies|grep -c "Index"`-v hardware_power=`omreport chassis pwrsupplies|awk'/^Status/{if($NF=="Ok") count+=1}END{print count}'`'BEGIN{if(hardware_power_number==hardware_power) {print 1} else {print 0}}'
UserParameter=hardware_temp,omreport chassis temps|awk'/^Status/{if($NF=="Ok") {print 1} else {print 0}}'|head -n 1
UserParameter=hardware_physics_health,awk -vhardware_physics_disk_number=`omreport storage pdisk controller=0|grep -c"^ID"` -v hardware_physics_disk=`omreport storage pdiskcontroller=0|awk '/^Status/{if($NF=="Ok") count+=1}END{print count}'`'BEGIN{if(hardware_physics_disk_number==hardware_physics_disk) {print 1} else{print 0}}'
UserParameter=hardware_virtual_health,awk -v hardware_virtual_disk_number=`omreportstorage vdisk controller=0|grep -c "^ID"` -vhardware_virtual_disk=`omreport storage vdisk controller=0|awk'/^Status/{if($NF=="Ok") count+=1}END{print count}'`'BEGIN{if(hardware_virtual_disk_number==hardware_virtual_disk) {print 1} else{print 0}}'
2、重启zabbix_agentd服务
/etc/init.d/zabbix_agentd restart
3、测试获取数据:出现值为正常
[root@xxxxxx]# ../bin/zabbix_get -s 127.0.0.1 -k "hardware_virtual_health"
1
二、服务端
1、模板导入
把TemplateHardware Monitor模版导入到zabbix里
2、主机关联模板
把需要监控的硬件服务器关联此模板即可
3、监控图例
zabbix使用Omsa来监控Dell服务器的硬件信息 模板下载
------------------------------------------分割线------------------------------------------
具体下载目录在 /2015年资料/12月/20日/Zabbix使用Omsa来监控Dell服务器的硬件信息/
------------------------------------------分割线------------------------------------------
一些Zabbix相关教程集合:
Ubuntu 14.04下Zabbix2.4.5 源码编译安装 .com/Linux/2015-05/117657.htm