一、客户端

A.redhat或者centos系统里安装

1、安装dellyum

wget -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi |bash

 

2、安装omsa

yum install srvadmin-all

ps:出现某些包下载超时时,再次执行上面命令,直到全部下载安装完成.

 

3、做软连接

1.ln -s /opt/dell/srvadmin/sbin/omreport /usr/bin/omreport

2.ln -s /opt/dell/srvadmin/sbin/omconfig /usr/bin/omconfig

 

4、关闭web模式(仅允许运行cli

echo "/usr/bin/omconfig systemwebserver action=stop">>/opt/dell/srvadmin/sbin/srvadmin-services.sh

 

5、启动omsa

/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.

Ps:如果启动报以下错误,原因是 dell smbios 的版本不够,没读取出机器的识别码

升级一下,即可。  yum update python-smbios y

报错信息:

Starting Systems Management Data Engine:

Failed to start because system is not supported

dsm_om_shrsvc: DSM SA Shared Services cannot start on an unsupportedsystem. See the Dell Systems Software Support Matrix for a list of supported systems.

 

6、检查omsa启动状态

/opt/dell/srvadmin/sbin/srvadmin-services.sh status

dell_rbu(module) is running

ipmidriver is running

dsm_sa_datamgrd(pid 40936 40874) is running

dsm_sa_eventmgrd(pid 40950) is running

dsm_sa_snmpd(pid 40973) is running

dsm_om_shrsvcd(pid 41018) is running

dsm_om_connsvcdis stopped

Error!DSM SA Connection Service is already stopped.

Ps:最后两行错误可以忽略

7、把omsa加入到开机启动里

echo "/opt/dell/srvadmin/sbin/srvadmin-services.shstart">>/etc/rc.local

以上是在centos或者redhat系统里安装omsa

 

B.ubuntu下安装

1、增加源

echo 'debhttp://linux.dell.com/repo/community/ubuntu precise openmanage' | sudo tee -a/etc/apt/sources.list.d/linux.dell.com.sources.list


2、检测与增加key

1.gpg --keyserverpool.sks-keyservers.net --recv-key 1285491434D8786F

2.gpg -a --export1285491434D8786F | sudo apt-key add -

3、更新源

apt-get update -y

4、安装omsa

apt-get install srvadmin-all -y

5、做软连接

1.ln -s/opt/dell/srvadmin/sbin/omreport /usr/bin/omreport

2.ln -s/opt/dell/srvadmin/sbin/omconfig /usr/bin/omconfig

6、启动cli模式omsa

service dataeng start

 

C.zabbix客户端的配置

1、在zabbix_agentd.conf里添加以下配置,添加到最后

#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=`sudoomreport  chassis biossetup|awk '/CState/{if($NF=="Enabled") {print 0} else {print  1}}'` -v hardware_cpu_c1=`sudo omreportchassis 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 -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) {print1} 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"`-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_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"`-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_cpu_model"

1

 

二、服务端

1、模板导入

TemplateHardware Monitor模版导入到zabbix

2、主机关联模板

把需要监控的硬件服务器关联此模板即可

3、监控图例