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

三、插件的安装使用

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

       }


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值