您的位置:首页 > 移动开发 > IOS开发

nagios应用3- 插件的安装使用

2012-12-24 16:58 274 查看

三、插件的安装使用

1. check_iostat

下载地址:http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3379&cf_id=24

yum install perl-Nagios-Plugin -y

yum install perl-Class-Accessor -y

yum install perl-Config-Tiny -y

yum install perl-Math-Calc-Units -y

yum install perl-Params-Validate -y

yum install perl-Regexp-Common -y

yum install sysstat -y

yum install bc -y

./check_iiostat -d<disk> -c<tps>,<read>,<wrtn> -w<tps>,<read>,<wrtn>

tps - Transactionsper second

read - Kilobytes persecond read from the disk

wrtn - Kilobytes persecond written to the disk

./check_iostat -d sda3 -c 10,40,40 -w 1,20,20

2. check_traffic

下载地址:http://cloud.github.com/downloads/cloved/check_traffic/check_traffic_v1.3.7.zip
yum install snmp -y

./check_traffic.sh [ -v ] [ -6 ] [ -i Suffix ] [ -F s|S ] [-p N] [-r ] -V 1|2c|3 ( -C snmp-community | -A "AuthString" (when use snmpv3, U must give the AuthString)) -H host [ -L ] (-I interface|-N interfacename) -w in,out-warning-value
-cin,out-critical-value -K/M -B/b

-V snmp版本 protocol=[1|2c|3]
-H 被监控主机IP
-C snmp community值
-I 网卡序列
-N 网卡名
-r 范围,使用一个范围代替固定值,如10-20
-w warning值,可以使固定值, 也可是范围值
-c critical值,可以使固定值, 也可是范围值
-K/M 换算成K (kilo) or M (mega) 显示 ,默认是-K, kilo
-B/b换算成Bps(B/s) or bps(b/s)显示,默认是-b, bps

./check_traffic.sh -V 2c -C public -H 127.0.0.1-I 4 -w 200,100 -c 300,200 -K –B
./check_traffic.sh -V 2c -C public -H 127.0.0.1-I 4 -r -w 200-300,100-200 -c 100-400,50-250 -K –B
./check_traffic.sh -V 2c -C public -H 127.0.0.1-N FastEthernet0/1,FastEthernet0/2 -p 8 -w 45,45 -c 55,55

3. check_winmen 查看windows系统内存

下载地址:http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=940&cf_id=24

check_winmem ARG1 ARG2ARG3 ARG4
ARG1 IP
ARG2 身份验证码
ARG3 warn值
ARG4 critical 值
./check_winmem.sh192.168.8.80 gm 80 60

# vi/usr/local/nagios/etc/objects/commands.cfg
#'check_winmem' command definition
define
command{
command_name check_winmem
command_line $USER1$/check_winmem $ARG1$ $ARG2$ $ARG3$$ARG4$
}

# vi /usr/local/nagios/etc/objects/host.cfg
define service{
use generic-service
host_name host_name
service_description check_winmem
check_command check_winmem!192.168.1.10!public!80!60
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: