check 用法 linux,Nagios插件check_ping用法

Nagios的check_ping是Nagios用来ping远程主机的一个插件,用法如下:

check_ping -H -w ,% -c ,%

[-p packets] [-t timeout] [-4|-6]

Options:

-h, --help

Print detailed help screen

-V, --version

Print version information

-4, --use-ipv4

Use IPv4 connection

-6, --use-ipv6

Use IPv6 connection

-H, --hostname=HOST

host to ping

-w, --warning=THRESHOLD

warning threshold pair

-c, --critical=THRESHOLD

critical threshold pair

-p, --packets=INTEGER

number of ICMP ECHO packets to send (Default: 5)

-L, --link

show HTML in the plugin output (obsoleted by urlize)

-t, --timeout=INTEGER

Seconds before connection times out (default: 10)

例子

./check_ping -H 8.8.8.8 -w 200,20% -c 300,50% -p 3 -t 2

-H 目标主机

-w 延时200丢包20%

-c 延时300丢包50%

延时有3个范围

1. 延时 小于 200

2. 延时 在 200 - 300 范围内

3. 延时 大于 300

小于则输出 OK 正常

范围内则输出 WARNING 警告

大于则输出 CRITICAL 宕机

1、OK 正常:

[root@linuxso.com plugins]# ./check_ping -H 8.8.8.8 -w 200,20% -c 300,50% -p 3 -t 2

PING OK - Packet loss = 0%, RTA = 96.45 ms|rta=96.449997ms;200.000000;300.000000;0.000000 pl=0%;20;50;0

2、WARNING 警告 :

[root@linuxso.com plugins]# ./check_ping -H 8.8.8.8 -w 100,20% -c 200,50% -p 3 -t 2

PING WARNING - Packet loss = 0%, RTA = 106.00 ms|rta=106.003998ms;100.000000;200.000000;0.000000 pl=0%;20;50;0

3、CRITICAL 宕机 :

[root@linuxso.com plugins]# ./check_ping -H 8.8.8.8 -w 50,20% -c 100,50% -p 3 -t 2

PING CRITICAL - Packet loss = 0%, RTA = 128.41 ms|rta=128.410995ms;50.000000;100.000000;0.000000 pl=0%;20;50;0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值