#wget http://exchange.nagios.org/components/com_mtree/p_w_upload.php?link_id=3379&cf_id=24
# chmod +x /usr/local/nagios/libexec/check_iostat # chown nagios. /usr/local/nagios/libexec/check_iostat
# ./check_iostat -d sda -w 100 -c 200 OK - I/O stats tps=0.31 KB_read/s=5.94 KB_written/s=6.66 | 'tps'=0.31; 'KB_read/s'=5.94; 'KB_written/s'=6.66;
# vi /usr/local/nagios/etc/nrpe.cfg command[check_iostat]=/usr/local/nagios/libexec/check_iostat -d sda -w 100 -c 200
# /etc/init.d/xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ]
# vi /usr/local/nagios/etc/objects/commands.cfg define command{ command_name check_iostat command_line $USER1$/check_iostat -d $ARG1$ -w $ARG2$ -c $ARG3$ }
# vi /usr/local/nagios/etc/services/mail_156.cfg define sevice{ use generic-service host_name mail_156 service_description check-iostat check_command check_nrpe!check_iostat!sda!100!200 }
[root@mail ~]# /usr/local/nagios/libexec/check_iostat -d sda1 -w 100 -c 200 /usr/local/nagios/libexec/check_iostat: line 54: sda1: command not found /usr/local/nagios/libexec/check_iostat: line 55: sda1: command not found /usr/local/nagios/libexec/check_iostat: line 56: sda1: command not found /usr/local/nagios/libexec/check_iostat: line 60: bc: command not found /usr/local/nagios/libexec/check_iostat: line 60: bc: command not found /usr/local/nagios/libexec/check_iostat: line 61: bc: command not found /usr/local/nagios/libexec/check_iostat: line 64: bc: command not found /usr/local/nagios/libexec/check_iostat: line 64: bc: command not found /usr/local/nagios/libexec/check_iostat: line 65: bc: command not found OK - I/O stats tps= KB_read/s= KB_written/s= | 'tps'=; 'KB_read/s'=; 'KB_written/s'=;
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。