Nagios监控磁盘I/O
Nagios监控磁盘I/O#官方默认插件中并无此插件,但官方还是提供了这个插件的下载,地址在:
http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_iostat-%252D-I-2FO-statistics/details
#注意:保证所有被监控机上都安装了sysstat包,并可以执行iostat命令
#下载之后,放在每台被监控机的/usr/local/nagios/libexec/目录下
#然后更改属组,赋予可执行权限
1chown nagios:nagios /usr/local/nagios/libexec/check_iostat
2chmod 755 !$
#被监控机上更改nrpe的配置文件
1vi /usr/local/nagios/etc/nrpe.cfg
2#增加下边这两行,如果有更多磁盘,相应增加即可,至于警告和严重警告的值,请适当调整
3#----------------------------引用文字-开始----------------------------
4command=/usr/local/nagios/libexec/check_iostat -d sda -w 100 -c 200
5command=/usr/local/nagios/libexec/check_iostat -d sdb -w 100 -c 200
6#----------------------------引用文字-结束----------------------------
#重启服务
01service nrpe restart
02
03#打开主监控机上的servicegroups.cfg,我选择的是监控所有机器的I/O,所以在all_hosts组下增加下面一段
04#----------------------------引用文字-开始----------------------------
05define service{
06hostgroup_name all_hosts
07service_description check_sda_iostat
08check_command check_nrpe!check_sda_iostat
09max_check_attempts 4
10check_interval 1440
11retry_interval 5
12check_period 24x7
13notification_interval 1440
14notification_period 24x7
15notification_options w,u,c
16#contacts contacts(*)
17contact_groups sa_groups
18}
19#----------------------------引用文字-结束----------------------------
20
21#如果只监控个别机器,请在services.cfg中相应的机器下增加
22#----------------------------引用文字-开始----------------------------
23define service{
24host_name 10.0.0.166
25service_description check_sda_iostat
26check_command check_nrpe!check_sda_iostat
27max_check_attempts 3
28check_interval 10
29retry_interval 5
30check_period 24x7
31notification_interval 30
32notification_period 24x7
33notification_options w,u,c
34#contacts contacts(*)
35contact_groups sa_groups
36}
37#----------------------------引用文字-结束----------------------------
#检查配置文件并重新加载服务
1service nagios checkconfig
2service nagios reload
http://www.chengyongxu.com/blog/nagios%E7%9B%91%E6%8E%A7%E7%A3%81%E7%9B%98io/
Nagios监控磁盘I/O
页:
[1]