Fping –一种在Ubuntu上并行Ping主机的命令行工具
Fping是一种将ICMP回声探测发送到网络主机的程序,与ping类似,因此它允许用户检查远程主机是否处于启动或关闭状态。使用Fping命令,我们可以一次检查多个主机。本文介绍“如何安装Fping命令以及Fping命令的用法”
安装Fping命令
要安装Fping命令,请使用以下命令-
$ sudo apt-get install fping
样本输出应如下所示–
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: gtk2-engines-pixbuf libbs2b0 libopusfile0 libpyside1.2 libqmmp-misc libqmmpui0 libshiboken1.2 libsidplayfp libtidy-0.99-0 linux-headers-4.2.0-27 linux-headers-4.2.0-27-generic linux-image-4.2.0-27-generic linux-image-extra-4.2.0-27-generic linux-signed-image-4.2.0-27-generic php7.0-opcache python-beautifulsoup python-feedparser python-html2text python-magic python-oauth2 python-pyside.qtcore python-pyside.qtgui python-pyside.qtnetwork python-pyside.qtwebkit python-pysqlite2 python-regex python-sqlalchemy python-sqlalchemy-ext python-support python-unity-singlet python-utidylib Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: fping 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Need to get 30.7 kB of archives. .........................................................
Fping命令的用法
要运行Fping,请使用以下命令-
$ fping nhooo.com
样本输出应如下所示–
nhooo.com is alive
要测试多个站点,请使用以下命令–
$ fping www.nhooo.com www.google.com
样本输出应如下所示–
www.nhooo.com is alive www.google.com is alive
如果主机列表存储在文件中,请使用以下命令–
$ fping < hosts.txt
样本输出应如下所示–
www.nhooo.com is alive www.google.com is alive
要获取有关fping的更多信息,请使用以下命令–
$ fping -help
样本输出应如下所示–
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)
-l loop sending pings forever
-m ping multiple interfaces on target host
-n show targets by name (-d is equivalent)
-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)
-s print final stats
-I if bind to a particular interface
-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
-O n set the type of service (tos) flag on the ICMP packets
-v show version
targets list of targets to check (if no -f specified)恭喜你!现在,您知道“如何在Linux上安装Fping工具以及Fping工具的用法”。在我们的下一篇Linux文章中,我们将详细了解这些类型的命令。继续阅读!