談到檢測網路聯通性工具,ping命令必須首當其充。
但是,今天,民工哥給大家推薦一個強大的命令列工具:gping。
gping 是基於 Rust 編寫視覺化工具,具有動態圖形化介面顯示。
安裝
下載系統所對應的安裝包
本文以CentOS7系統為例,其它系統請參考官方文件。
[root@centos7 ~]# wget https://github.com/orf/gping/releases/download/gping-v1.2.6/gping-Linux-x86_64.tar.gz
[root@centos7 ~]# ll gping-Linux-x86_64.tar.gz
-rw-r--r-- 1 root root 889865 Dec 7 22:20 gping-Linux-x86_64.tar.gz
[root@centos7 ~]# mkdir /usr/local/gping
[root@centos7 ~]# tar zxf gping-Linux-x86_64.tar.gz -C /usr/local/gping
如果安裝完後,執行命令出現下述錯誤:
./gping: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by ./gping)
解決方案如下:
curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix=/usr
make -j2
make install
使用
[root@centos7 gping]# ./gping --help
gping 1.2.6
Ping, but with a graph.
USAGE:
gping [FLAGS] [OPTIONS] <hosts-or-commands>...
FLAGS:
--cmd Graph the execution time for a list of commands rather than pinging hosts
-h, --help Prints help information
-4 Resolve ping targets to IPv4 address
-6 Resolve ping targets to IPv6 address
-s, --simple-graphics Uses dot characters instead of braille
-V, --version Prints version information
OPTIONS:
-b, --buffer <buffer> Determines the number of seconds to display in the graph. [default: 30]
-n, --watch-interval <watch-interval> Watch interval seconds (provide partial seconds like '0.5'). Default for
ping is 0.2, default for cmd is 0.5.
ARGS:
<hosts-or-commands>... Hosts or IPs to ping, or commands to run if --cmd is provided.
它還可以同時對多個目標地址進行操作。