2、安装OMSA
wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
yum install srvadmin-all //安装的时候报一个依赖的冲突,具体是哪个包忘记了,后加了--skip-broken参数忽略,没有安装成功。
最后,通过下面命令安装成功
yum install -y srvadmin-base srvadmin-storageservices
3、做软链接并关闭web模式
ln -s /opt/dell/srvadmin/sbin/omreport /usr/bin/omreport
ln -s /opt/dell/srvadmin/sbin/omconfig /usr/bin/omconfig
echo "/usr/bin/omconfig system webserver action=stop" >>/opt/dell/srvadmin/sbin/srvadmin-services.sh
4、启动并加入开机启动
/opt/dell/srvadmin/sbin/srvadmin-services.sh start
echo "/opt/dell/srvadmin/sbin/srvadmin-services.sh start">>/etc/rc.local
二、zabbix配置
1、配置agentd
vim zabbix_agentd.conf 在最下面加入如下内容:
#cat /usr/local/etc/zabbix_agentd.conf |grep hardware
#follow is monitor hardware
UserParameter=hardware_battery,omreport chassis batteries|awk '/^Status/{if($NF=="Ok") {print 1} else {print 0}}'
UserParameter=hardware_cpu_model,awk -v hardware_cpu_crontol=`sudo omreport chassis biossetup|awk '/C State/{if($NF=="Enabled") {print 0} else {print 1}}'` -v hardware_cpu_c1=`sudo 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_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}}'
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_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 {print 0}}'
UserParameter=hardware_cpu,omreport chassis processors|awk '/^Health/{if($NF=="Ok") {print 1} else {print 0}}'
UserParameter=hardware_power_health,awk -v hardware_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 -v hardware_physics_disk_number=`omreport storage pdisk controller=0|grep-c "^ID"` -v hardware_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}}'
UserParameter=hardware_virtual_health,awk -v hardware_virtual_disk_number=`omreport storage vdisk controller=0|grep -c "^ID"` -v hardware_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}}'