4001.shell脚本和SNMP实现的AIX小型机巡检报告
巡检报告示例(以下是日报示例,可以方便地扩展出周报/月报等):
--------- Report information of host system ---------------
Today : 12-21-09 Reporting Day : 12-20-09
IP : 192.168.24.28 Hostname : IBM.AIX.WebApp.1
HostType : aix 5.3
IP : 192.168.24.28 Hostname : IBM.AIX.WebApp.1
HostType : aix 5.3
-------------- Report information of today ----------------
CPU Average : 7 Max : 25 09:12:02
Mem Average : 95 Max : 96 20:12:02
Swap Average : 12 Max : 12 09:12:02
Proc Average : 121 Max : 121 09:12:02
Mem Average : 95 Max : 96 20:12:02
Swap Average : 12 Max : 12 09:12:02
Proc Average : 121 Max : 121 09:12:02
--------------------------- Report information of hour -------------------------------
Time CpuAver CpuMax HappenTime Warn MemAver MemMax HappenTime Warn ProcAver
0:00-0:59 8 24 00:12:01 - 95 95 00:12:01 - 121
1:00-1:59 10 24 01:15:02 - 95 95 01:09:02 - 121
2:00-2:59 8 20 02:09:01 - 95 95 02:09:01 - 121
3:00-3:59 8 25 03:12:02 - 95 95 03:24:02 - 121
4:00-4:59 8 25 04:12:02 - 95 95 04:12:02 - 121
5:00-5:59 9 25 05:12:02 - 95 95 05:12:02 - 121
6:00-6:59 8 20 06:09:02 - 95 95 06:09:02 - 121
7:00-7:59 9 19 07:09:01 - 95 95 07:09:01 - 121
8:00-8:59 9 20 08:09:02 - 95 95 08:09:02 - 121
9:00-9:59 9 25 09:12:02 - 95 95 09:12:02 - 121
10:00-10:59 9 24 10:12:02 - 95 95 10:15:02 - 121
11:00-11:59 9 25 11:12:01 - 95 95 11:12:01 - 121
12:00-12:59 9 25 12:12:02 - 95 95 12:09:01 - 121
13:00-13:59 9 24 13:12:02 - 95 95 13:12:02 - 121
14:00-14:59 9 19 14:09:01 - 95 95 14:09:01 - 121
15:00-15:59 7 25 15:12:02 - 95 95 15:15:02 - 121
16:00-16:59 3 7 16:39:02 - 95 95 16:39:02 - 121
17:00-17:59 3 10 17:39:02 - 95 95 17:39:02 - 121
18:00-18:59 5 25 18:12:02 - 95 95 18:12:02 - 121
19:00-19:59 5 25 19:12:02 - 95 96 19:12:02 - 121
20:00-20:59 5 25 20:12:02 - 95 96 20:12:02 - 121
21:00-21:59 5 25 21:12:02 - 96 96 21:12:02 - 121
22:00-22:59 5 25 22:12:02 - 95 96 22:12:02 - 121
23:00-23:59 6 24 23:12:02 - 96 96 23:12:02 - 121
Time CpuAver CpuMax HappenTime Warn MemAver MemMax HappenTime Warn ProcAver
0:00-0:59 8 24 00:12:01 - 95 95 00:12:01 - 121
1:00-1:59 10 24 01:15:02 - 95 95 01:09:02 - 121
2:00-2:59 8 20 02:09:01 - 95 95 02:09:01 - 121
3:00-3:59 8 25 03:12:02 - 95 95 03:24:02 - 121
4:00-4:59 8 25 04:12:02 - 95 95 04:12:02 - 121
5:00-5:59 9 25 05:12:02 - 95 95 05:12:02 - 121
6:00-6:59 8 20 06:09:02 - 95 95 06:09:02 - 121
7:00-7:59 9 19 07:09:01 - 95 95 07:09:01 - 121
8:00-8:59 9 20 08:09:02 - 95 95 08:09:02 - 121
9:00-9:59 9 25 09:12:02 - 95 95 09:12:02 - 121
10:00-10:59 9 24 10:12:02 - 95 95 10:15:02 - 121
11:00-11:59 9 25 11:12:01 - 95 95 11:12:01 - 121
12:00-12:59 9 25 12:12:02 - 95 95 12:09:01 - 121
13:00-13:59 9 24 13:12:02 - 95 95 13:12:02 - 121
14:00-14:59 9 19 14:09:01 - 95 95 14:09:01 - 121
15:00-15:59 7 25 15:12:02 - 95 95 15:15:02 - 121
16:00-16:59 3 7 16:39:02 - 95 95 16:39:02 - 121
17:00-17:59 3 10 17:39:02 - 95 95 17:39:02 - 121
18:00-18:59 5 25 18:12:02 - 95 95 18:12:02 - 121
19:00-19:59 5 25 19:12:02 - 95 96 19:12:02 - 121
20:00-20:59 5 25 20:12:02 - 95 96 20:12:02 - 121
21:00-21:59 5 25 21:12:02 - 96 96 21:12:02 - 121
22:00-22:59 5 25 22:12:02 - 95 96 22:12:02 - 121
23:00-23:59 6 24 23:12:02 - 96 96 23:12:02 - 121
23:00-23:59 6 24 23:12:02 - 96 96 23:12:02 - 121
报告实现方法简述:
1.确认监控目标AIX主机开启了SNMP
2.确定SNMP采集使用的CPU与内存相关OID
3.使用shell脚本每隔3分钟采集一次AIX的CPU与内存使用率
4.使用shell脚本每天将采集的数据进行处理生成AIX巡检报告
5.通过邮件发送将巡检报告发送给相关管理人员和代维工程师
shell脚本系列视频访问链接: