六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 791|回复: 0

Nagios监控磁盘I/O

[复制链接]
 楼主| 发表于 2015-8-24 15:17:49 | 显示全部楼层 |阅读模式
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[check_sda_iostat]=/usr/local/nagios/libexec/check_iostat -d sda -w 100 -c 200

5command[check_sdb_iostat]=/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

该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表