本文主要是介绍Dell服务器的omsa硬件管理工具并添加到zabbix,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、安装dell的yum源
wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
2、安装omsa
yum install srvadmin-all
3、做软连接
ln -s /opt/dell/srvadmin/sbin/omreport /usr/bin/omreportln -s /opt/dell/srvadmin/sbin/omconfig /usr/bin/omconfig
4、关闭web模式(仅允许运行cli)
echo "/usr/bin/omconfig system webserver action=stop" >>/opt/dell/srvadmin/sbin/srvadmin-services.sh
5、启动omsa
/opt/dell/srvadmin/sbin/srvadmin-services.sh start
6、把omsa加入到开机启动里
echo "/opt/dell/srvadmin/sbin/srvadmin-services.sh start">>/etc/rc.local
7、vi hardware.conf 放到/etc/zabbix/zabbix_agentd.d下
#dell
#follow is monitor hardware
#状态1表示正常,状态0表示异常
#CMOS电池状态
UserParameter=hardware_battery,omreport chassis batteries | awk '/^Status/{if($NF=="Ok") {print 1} else {print 0}}'
#风扇状态
UserParameter=hardware_fan_health,awk -vhardware_fan_number=`omreport chassis fans | grep -c "^Index"` -vhardware_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}}'
#内存状态
UserParameter=hardware_memory_health,awk -vhardware_memory=`omreport chassis memory | awk '/^Health/{print $NF}'` 'BEGIN{if(hardware_memory=="Ok") {print 1} else {print 0}}'
#网卡状态
UserParameter=hardware_nic_health,awk -vhardware_nic_number=`omreport chassis nics | grep -c "Interface Name"` -vhardware_nic=`omreport chassis nics | awk '/^Connection Status/{print $NF}'| wc -l` 'BEGIN{if(hardware_nic_number==hardware_nic) {print 1} else {print 0}}'
#CPU状态
UserParameter=hardware_cpu,omreport chassis processors|awk '/^Health/{if($NF=="Ok") {print 1} else {print 0}}'
#电源状态
UserParameter=hardware_power_health,awk -vhardware_power_number=`omreport chassis pwrsupplies | grep -c "Index"` -vhardware_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"` -vhardware_physics_disk=`omreport storage pdisk controller=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}}'
#raid状态
UserParameter=hardware_virtual_health,awk -vhardware_virtual_disk_number=`omreport storage 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}}'
8、重启zabbix-agent服务
Cent6
service zabbix-agent restart
Cent7
systemctl restart zabbix-agent
9、磁盘查询命令
omreport system summary (显示所有系统组件的主要情况)omreport chassis (显示所有主要组件的常规状态)omreport chassis procesesors (显示CPU信息)omreport chassis memory (显示内存信息)omreport storage controller (显示RAID卡信息)omreport storage vdisk (显示虚拟磁盘信息)
10、添加到zabbix报警
这篇关于Dell服务器的omsa硬件管理工具并添加到zabbix的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!