CentOS 7.6.1810 安裝 fping 3.15
1、創建安裝目錄
mkdir -p /usr/local/fping && cd /usr/local/fping
2、下載 fping3.15 安裝包
wget http://fping.org/dist/fping-3.15.tar.gz
3、解壓安裝包
tar -zxvf fping-3.15.tar.gz && cd fping-3.15
4、編譯安裝
./configure --prefix=/usr/local/fping && make && make install
5、配置環境變量,並使其生效
sed -i '1i\export PATH=$PATH:/usr/local/fping/sbin' /etc/profile && source /etc/profile
6、配置環境變量永久生效
echo "export PATH=$PATH:/usr/local/fping/sbin" >> /etc/bashrc
7、測試成功與否?
fping -v
幫助文件
常用: fping -Asg 192.168.1.0/24 #以IP顯示是否在線,並打印出報告
Usage(用法): fping [選項] [目標...]
-a 顯示目標地址是否在線
-A 以IP地址顯示,並判斷是否在線
-b n 發送ping的數據包量,以字節為單位 (默認 56),n寫成數量,以下參數同此
-B f 設置指數回退因素為f
-c n 計算要發送到每個目標的ping信號 (默認發送 1 個包)
-C n 功能同-c,報告結果更詳細
-D 在每個輸出行打印時間戳
-e 顯示返回包的運行時間
-f file 從文件中讀取目標列表 ( - means stdin) (only if no -g specified)
-g 生成目標列表 (only if no -f specified)
(在目標列表中指定開始和結束IP, 或者提供一個IP網絡掩碼)
(ex. fping -g 192.168.1.0 192.168.1.255 or fping -g 192.168.1.0/24)
-H n 設置IP TTL值(Time To Live hops)
-i n 發送ping包之間的間隔 (in millisec毫秒) (default 25)
-I 如果綁定到特定接口
-l loop sending pings forever永不
-m ping目標主機上的多個接口
-M 設置Don't Fragment標志
-n 按名稱顯示目標 (-d is equivalent等效的)
-N 為網絡數據輸出兼容(-l -Q are required必須的)
-o 顯示累計停機時間 (lost packets * packet interval 間隔)
-O n 在ICMP包上設置服務類型(tos)標志
-p n ping包到一個目標之間的間隔 (in millisec)
(in looping and counting modes, default 1000)
-q 安靜模式 (don't show per-target/per-ping results)
-Q n 功能如同 -q, 每n秒顯示摘要
-r n 重復次數 (default 3)
-R 隨機分組數據 (to foil阻止 link data compression壓縮)
-s 打印最后的統計數據
-S 設置源地址
-t n 單個目標初始超時 (in millisec) (default 500)
-T n 忽略(for compatibility兼容性 with fping 2.4)
-u 顯示目標不可達
-v 顯示版本
要檢查的目標列表 (if no -f specified)
English Version
fping: Version 3.15
fping: comments to david@schweikert.ch
Usage: fping [options] [targets...]
-a show targets that are alive
-A show targets by address
-b n amount of ping data to send, in bytes (default 56)
-B f set exponential backoff factor to f
-c n count of pings to send to each target (default 1)
-C n same as -c, report results in verbose format
-D print timestamp before each output line
-e show elapsed time on return packets
-f file read list of targets from a file ( - means stdin) (only if no -g specified)
-g generate target list (only if no -f specified)
(specify the start and end IP in the target list, or supply a IP netmask)
(ex. fping -g 192.168.1.0 192.168.1.255 or fping -g 192.168.1.0/24)
-H n Set the IP TTL value (Time To Live hops)
-i n interval between sending ping packets (in millisec) (default 25)
-I if bind to a particular interface
-l loop sending pings forever
-m ping multiple interfaces on target host
-M set the Don't Fragment flag
-n show targets by name (-d is equivalent)
-N output compatible for netdata (-l -Q are required)
-o show the accumulated outage time (lost packets * packet interval)
-O n set the type of service (tos) flag on the ICMP packets
-p n interval between ping packets to one target (in millisec)
(in looping and counting modes, default 1000)
-q quiet (don't show per-target/per-ping results)
-Q n same as -q, but show summary every n seconds
-r n number of retries (default 3)
-R random packet data (to foil link data compression)
-s print final stats
-S addr set source address
-t n individual target initial timeout (in millisec) (default 500)
-T n ignored (for compatibility with fping 2.4)
-u show targets that are unreachable
-v show version
targets list of targets to check (if no -f specified)