您好,登錄后才能下訂單哦!
(nagios插件:nagios-plugins-1.4.12/plugins/check_ping.c)
[root@datacenter libexec]# ./check_ping --help
check_ping v1.4.15 (nagios-plugins 1.4.15)
Copyright (c) 1999 Ethan Galstad <>
Copyright (c) 2000-2007 Nagios Plugin Development Team
<>
Use ping to check connection statistics for a remote host.
Usage:
check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
[-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)
THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel
time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the
percentage of packet loss to trigger an alarm state.
This plugin uses the ping command to probe the specified host for packet loss
(percentage) and round trip average (milliseconds). It can produce HTML output
linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in
the contrib area of the downloads section at
Send email to if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to
[root@datacenter libexec]#
用法:
Usage: check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>%
[-p packets] [-t timeout] [-L] [-4|-6]
具體如下:
-H 主機地址
-w WARNING 警告狀態: 響應時間(毫秒),丟包率 (%) 閥值
-c CRITICAL 危險狀態: 響應時間(毫秒),丟包率 (%) 閥值
-p 發送的包數 默認5個包
-t 超時時間 默認10秒
-4|-6 使用ipv4|ipv6 地址 默認ipv4
示例:
復制代碼 代碼如下:
./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@204 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@204 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@204 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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。