Nagios监控磁盘I/O

Posted by – 2009-11-05

#官方默认插件中并无此插件,但官方还是提供了这个插件的下载,地址在:

http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_iostat-%252D-I-2FO-statistics/details

#注意:保证所有被监控机上都安装了sysstat包,并可以执行iostat命令

#下载之后,放在每台被监控机的/usr/local/nagios/libexec/目录下
#然后更改属组,赋予可执行权限

chown nagios:nagios /usr/local/nagios/libexec/check_iostat
chmod 755 !$

#被监控机上更改nrpe的配置文件

vi /usr/local/nagios/etc/nrpe.cfg
#增加下边这两行,如果有更多磁盘,相应增加即可,至于警告和严重警告的值,请适当调整
#----------------------------引用文字-开始----------------------------
command[check_sda_iostat]=/usr/local/nagios/libexec/check_iostat -d sda -w 100 -c 200
command[check_sdb_iostat]=/usr/local/nagios/libexec/check_iostat -d sdb -w 100 -c 200
#----------------------------引用文字-结束----------------------------

#重启服务

service nrpe restart

#打开主监控机上的servicegroups.cfg,我选择的是监控所有机器的I/O,所以在all_hosts组下增加下面一段
#----------------------------引用文字-开始----------------------------
define service{
hostgroup_name       all_hosts
service_description       check_sda_iostat
check_command       check_nrpe!check_sda_iostat
max_check_attempts       4
check_interval       1440
retry_interval       5
check_period       24x7
notification_interval       1440
notification_period       24x7
notification_options      w,u,c
#contacts       contacts(*)
contact_groups       sa_groups
}
#----------------------------引用文字-结束----------------------------

#如果只监控个别机器,请在services.cfg中相应的机器下增加
#----------------------------引用文字-开始----------------------------
define service{
host_name       10.0.0.166
service_description       check_sda_iostat
check_command       check_nrpe!check_sda_iostat
max_check_attempts       3
check_interval       10
retry_interval       5
check_period       24x7
notification_interval       30
notification_period       24x7
notification_options      w,u,c
#contacts       contacts(*)
contact_groups       sa_groups
}
#----------------------------引用文字-结束----------------------------

#检查配置文件并重新加载服务

service nagios checkconfig
service nagios reload
0 Comments on Nagios监控磁盘I/O

Respond

Respond

Comments

Comments