zabbix监控dell服务器脚本及方式key值

简介:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
function  CheckChassis ()
{
OMREPORTPATH= "/opt/dell/srvadmin/bin/"
TRIGGER=` "$OMREPORTPATH" omreport chassis |  grep  -i  "$1"  awk  { 'print $1' }`;
echo  "$TRIGGER" ;
}
 
function  CheckRaidStatus ()
{
OMREPORTPATH= "/opt/dell/srvadmin/bin/"
"$OMREPORTPATH" omreport storage vdisk |  grep  '^ID'  | \
         while  read  LINE
                 do
                         read  -a VDISKIDALL <<<$LINE;
                         VDISKID= "${VDISKIDALL[2]}" ;
                         VDISKIDSTATUS=` "$OMREPORTPATH" omreport storage vdisk |  grep  -1  "$VDISKID"  grep  -i  "status"  awk  { 'print $3' }`;
                         VDISKTYPE=` "$OMREPORTPATH" omreport storage vdisk |  grep  -6  "$VDISKID"  grep  -i  "layout"  awk  { 'print $3' }`; 
                         if  [[  "$VDISKIDSTATUS"  !=  "Ok"  ]]
                                 then
                                         TRIGGER= "$VDISKID--$VDISKTYPE--$VDISKIDSTATUS" ;
                                         echo  "$TRIGGER" ;
                         fi
                 done ;
}
 
function  CheckStorage ()
{
OMREPORTPATH= "/opt/dell/srvadmin/bin/"
"$OMREPORTPATH" omreport storage pdisk controller=0 |  grep  '^ID'  | \
         while  read  LINE
                 do
                         read  -a PDISKIDALL <<<$LINE;
                         PDISKID= "${PDISKIDALL[2]}" ;
                         PDISKIDSTATUS=` "$OMREPORTPATH" omreport storage pdisk controller=0 |  grep  -1  "$PDISKID"  grep  -i  "status"  awk  { 'print $3' }`;
                         if  [[  "$PDISKIDSTATUS"  !=  "Ok"  ]]
                                 then
                                         TRIGGER= "$PDISKID--$PDISKIDSTATUS" ;
                                         echo  "$TRIGGER" ;
                         fi
                 done ;
}
 
 
case  "$1"  in
         fans)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         intrusion)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         memory)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         supplies)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         management)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         processors)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         temperatures)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         voltages)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         hardware)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         batteries)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
         storage)
                 TRIGGERVALUE=`CheckStorage`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                         TRIGGERVALUE= "Ok" ;
                 fi
                 echo  $TRIGGERVALUE;;
         raid)
                 TRIGGERVALUE=`CheckRaidStatus`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                         TRIGGERVALUE= "Ok" ;
                 fi
                 echo  $TRIGGERVALUE;;
         *)
                 TRIGGERVALUE=`CheckChassis $1`;
                 if  [ -z  "$TRIGGERVALUE"  ]
                         then
                                 TRIGGERVALUE= "UNKNOWN" ;
                 fi
                 echo  "$TRIGGERVALUE" ;;
esac ;


本文转自   tianshuai369   51CTO博客,原文链接:http://blog.51cto.com/kkkkkk/1711044
相关文章
|
1月前
|
弹性计算 监控 数据可视化
ecs自定义监控
ecs自定义监控
22 1
|
1月前
|
Arthas 弹性计算 运维
阿里云ECS监控服务
阿里云ECS监控服务
401 2
|
25天前
|
弹性计算 运维 监控
ECS资源监控
ECS资源监控涉及CPU、内存、磁盘I/O、网络流量、系统负载和进程的关键指标,通过云服务商控制台、监控服务、API与SDK、运维工具进行实时监控和告警设置。支持历史数据查询、事件监控,以及使用Windows资源监视器和Linux系统工具进行操作系统层面监控。全面监控确保ECS实例稳定运行、资源有效利用和问题及时处理。如需特定云服务商的指导,请询问。
28 3
|
28天前
|
弹性计算 运维 监控
ecs监控与评估
阿里云ECS提供全面的监控与评估解决方案,包括云监控服务(实时资源指标、告警)、ECS实例详情页(运行状态查看)、资源负载评估(综合性能得分)、ECS Insight(多维度分析)、报警配置、流量管理优化(负载均衡、CDN)。这些工具帮助用户有效管理资源、识别潜在风险、优化性能,确保云服务稳定高效。
17 1
|
3月前
|
存储 SQL 监控
修改Zabbix源码实现监控数据双写,满足业务需求!
虽然对接Elasticsearch后有诸多好处,但是它不往数据库写历史数据了,同时还不再计算趋势数据了。有这么一个场景...
修改Zabbix源码实现监控数据双写,满足业务需求!
|
4月前
|
数据采集 监控 数据库
OceanBase社区版可以通过Zabbix监控
OceanBase社区版可以通过Zabbix监控
75 4
|
4月前
|
监控 关系型数据库 机器人
小白带你学习linux的监控平台zabbix
小白带你学习linux的监控平台zabbix
134 0
|
6月前
|
监控 关系型数据库 MySQL
企业实战(8)CentOS 6.8安装Zabbix-agent 5.0监控主机性能与Mysql数据库
企业实战(8)CentOS 6.8安装Zabbix-agent 5.0监控主机性能与Mysql数据库
|
1月前
|
数据采集 监控 数据库
请问OceanBase社区版能否通过zabbix监控,然后将报错信息展现到grafana?
【2月更文挑战第25天】请问OceanBase社区版能否通过zabbix监控,然后将报错信息展现到grafana?
25 2
|
6月前
|
监控
zabbix如何添加自定义监控项
zabbix如何添加自定义监控项
256 0

热门文章

最新文章

推荐镜像

更多