标签:
zabbix dell
原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。
http://yujianglei.blog.51cto.com/7215578/1725472
1
|
说明: 公司的所有的服务器都是Dell服务器.为什么做这个监控呢?是因为线上的一台DB数据库的磁盘发生损坏.结果我们运维组人员(公司只有我一名,当然出了事由我个人负责了,想想还是自己技术欠缺)没有第一时间发现.于是网络搜寻zabbix去监控Dell服务器.
|
1.监控工具使用dell自带的omsa工具进行监控,下载安装omsa工具,并进行安装
1
2
3
4
5
|
wget -q -O - http:
//linux
.dell.com
/repo/hardware/latest/bootstrap
.cgi |
bash
yum
install
srvadmin-all -y
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
|
2.启动
1
|
/opt/dell/srvadmin/sbin/srvadmin-services
.sh start
|
3.开机启动
1
|
echo
"/opt/dell/srvadmin/sbin/srvadmin-services.sh start"
>>
/etc/rc
.
local
|
4.zabbix客户端配置
vi zabbix_agentd.conf
1
2
3
4
5
6
7
8
9
|
UserParameter=cpu_status,
awk
-
v
cpu_stats=`omreport chassis processors |
awk
'/^Health/ {print $NF}'
`
'BEGIN{if(cpu_stats=="Ok"){print 1}else{print 0}}'
UserParameter=memory_stats,
awk
-
v
memory_stats=`omreport chassis memory |
awk
'/Health/ {print $NF}'
`
'BEGIN{if(memory_stats=="Ok") {print 1} else {print 0}}'
UserParameter=pdisk_status,
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=fans_status,
awk
-
v
fan_total_num=`omreport chassis fans |
grep
-c
"^Index"
` -
v
fan_ok_num=`omreport chassis fans |
awk
'/Status/ {if($NF == "Ok") count=count+1}END{print count}'
`
'BEGIN{if(fan_total_num == fan_ok_num) {print 1}else {print 0}}'
UserParameter=nics_stats,
awk
-
v
nic_total_num=`omreport chassis nics |
head
-n 16 |
grep
-c
"^Index"
` -
v
nic_ok_num=`omreport chassis nics |
head
-n 16 |
awk
'/Connection Status/ {if($NF == "Connected") count=count+1}END{print count}'
` BEGIN
'{if(nic_total_num == nic_ok_num){print 1}else{print 0}}'
UserParameter=CMOS_stats,omreport chassis batteries |
awk
'/^Health/{if($NF == "Ok"){print 1}else {print 0}}'
UserParameter=raid_stats,
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=power_stats,
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=temperature_status,
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}}'
|
5.重启zabbix客户端
1
2
|
kill
`
ps
-ef|
grep
zabbix|
grep
-
v
grep
|
awk
'{print $2}'
`
/usr/local/zabbix/sbin/zabbix_agentd
-c
/usr/local/zabbix/etc/zabbix_agentd
.conf
|
6.手动创建模板(监控项,触发器,图像),或者下载模板,见附件
7.监控图如下: