From ffe41b130344c9c5210b638fc87fc7e6e46ad364 Mon Sep 17 00:00:00 2001 From: Youfou Date: Tue, 17 Jan 2017 18:59:10 +0800 Subject: [PATCH] =?UTF-8?q?+=20=E4=B8=AD=E6=96=87=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 36 ++++++++++++++-------- README_ZHCN.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 README_ZHCN.md diff --git a/README.md b/README.md index bdb1cda..9270692 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[中文说明](https://github.com/youfou/mping/blob/master/README_ZHCN.md) + # mping Ping multiple hosts concurrently and find the fastest to you. @@ -10,27 +12,35 @@ Ping multiple hosts concurrently and find the fastest to you. Just tell which host is the fastest: - mping host1.com host2.com host3.com +```shell +mping host1.com host2.com host3.com +``` Get hosts from a file, and ping them: - mping -p PATH/TO/THE/FILE.txt +```shell +mping -p PATH/TO/THE/FILE.txt +``` > Read **Input File** section below for more details. The results will be like this: - host | count, loss%, min/avg/max - ----------|-------------------------- - host1.com | 99, 0.0%, 5.4/6.8/14.1 - host2.com | 90, 0.0%, 23.8/33.5/39.5 - host3.com | 77, 0.4%, 37.4/39.1/43.6 +``` +host | count, loss%, min/avg/max +----------|-------------------------- +host1.com | 99, 0.0%, 5.4/6.8/14.1 +host2.com | 90, 0.0%, 23.8/33.5/39.5 +host3.com | 77, 0.4%, 37.4/39.1/43.6 +``` -> The `count` number represents that how many pings returned to the each host. +> The `count` number represents how many replies returned from each host. Also Check out the help stuff for more instructions: - mping -h +```shell +mping -h +``` ## Input File @@ -43,9 +53,11 @@ When use a plain text file, just place each host in a line. For example: - host1.com - host2.com - host3.com +``` +host1.com +host2.com +host3.com +``` **Json File** diff --git a/README_ZHCN.md b/README_ZHCN.md new file mode 100644 index 0000000..97030de --- /dev/null +++ b/README_ZHCN.md @@ -0,0 +1,84 @@ +# mping + +并发的 ping 多个主机,找出连接最快的。 + +## 安装方法 + + pip3 install -U mping + +## 使用方法 + +看看哪个主机最快: + +```shell +mping host1.com host2.com host3.com +``` + +Ping 文件中的主机列表: + +```shell +mping -p PATH/TO/THE/FILE.txt +``` + +> 阅读下方的 **输入文件** 了解过多细节。 + +结果大概会像这样: + +``` +host | count, loss%, min/avg/max +----------|-------------------------- +host1.com | 99, 0.0%, 5.4/6.8/14.1 +host2.com | 90, 0.0%, 23.8/33.5/39.5 +host3.com | 77, 0.4%, 37.4/39.1/43.6 +``` + +> `count` 数表示每个主机返回了多少个 ping 回复。 + +查看说明,了解更多: + +```shell +mping -h +``` + +## 输入文件 + +可以使用纯文本文件,或 Json 文件,来用于 `-p` / `--path` 参数. + + +**纯文本文件** + +当使用纯文本文件时,只要把每个主机放在单独一行即可。 + +例如: + +``` +host1.com +host2.com +host3.com +``` + +**Json 文件** + +你也可以使用一个 Json 文件来作为输入的主机列表,这里有两种模式: + + 把主机放进一个列表: + + ```json +[ + "host1.com", + "host2.com", + "host3.com" +] +``` + +把主机放进一个对象(字典),并为主机命名: + + ```json +{ + "S1": "host1.com", + "S2": "host3.com", + "S3": "host3.com" +} +``` + +> 主机名称将会在结果中被打印出来。