PerfOps CLI 多地点网络测试工具

perfops-cli - 一款IT运维工具

GitHub:perfops-cli

PerfOps CLI 是一款适合于运维人员使用的命令行工具,方便从多地点执行 ping、traceroute、mtr 等网络基准测试。
PerfOps 使用简单,你可以从位于全世界的数百个节点向目标地址发起网络测试。在不设置 API 密钥的条件下,它允许每小时进行 10 次测试,免费注册用户则可以在每小时内发起最多 200 次测试。

Homebrew - MacOS 安装方法

使用 Homebrew 安装:

brew tap ProspectOne/perfops
brew install perfops
perfops --help

使用方法

$ perfops --help
perfops is a simple command line tool to interact with hunderds of servers around the world. Run benchmarks and debug your infrastructure without leaving your console.
perfops 是一个简单的命令行工具,可与世界各地的数百台服务器进行交互。 无需离开控制台即可运行基准测试并调试基础架构。

Usage:
  perfops [flags]
  perfops [command]

Examples:
perfops traceroute --from "New York" google.com

Available Commands:
  credits     Displays the remaing credits
  curl        Run a curl test on a domain name or IP address
  dnsperf     Find the time it takes to resolve a DNS record on a target
  help        Help about any command
  latency     Run a ICMP latency test on a domain name or IP address
  mtr         Run a MTR test on a domain name or IP address
  ping        Run a ping test on a domain name or IP address
  resolve     Resolve a DNS record on a domain name
  traceroute  Run a traceroute test on a domain name or IP address

Flags:
      --debug             Enables debug output
  -F, --from string       A continent, region (e.g eastern europe), country, US state or city
  -h, --help              help for perfops
  -J, --json              Print the result of a command in JSON format
  -K, --key string        The PerfOps API key (default is $PERFOPS_API_KEY)
  -N, --nodeid intSlice   A comma separated list of node IDs to run a test from
  -v, --version           Prints the version information of perfops

Use "perfops [command] --help" for more information about a command.

ping - 测试网络连通性

  1. 从亚洲(Asia)的随机一台服务器上 Ping baidu.com:
$ perfops ping --from Asia baidu.com
Node203, AS45102, Dubai, United Arab Emirates # Node203,AS45102,迪拜,阿拉伯联合酋长国
PING baidu.com (220.181.57.216) 56(84) bytes of data.
64 bytes from 220.181.57.216: icmp_seq=1 ttl=47 time=341 ms
64 bytes from 220.181.57.216: icmp_seq=2 ttl=47 time=342 ms
64 bytes from 220.181.57.216: icmp_seq=3 ttl=47 time=342 ms

--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 800ms
rtt min/avg/max/mdev = 341.865/342.230/342.800/0.789 ms
  1. 从亚洲(Asia)的随机两台服务器上 Ping 某一个IP地址:
$ perfops ping --from Asia 52.14.183.223 --limit 2
Node297, AS199524, Seoul, South Korea # 韩国首尔的节点
PING 52.14.183.223 (52.14.183.223) 56(84) bytes of data.
64 bytes from 52.14.183.223: icmp_seq=1 ttl=39 time=193 ms
64 bytes from 52.14.183.223: icmp_seq=2 ttl=39 time=193 ms
64 bytes from 52.14.183.223: icmp_seq=3 ttl=39 time=193 ms

--- 52.14.183.223 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 802ms
rtt min/avg/max/mdev = 193.768/193.786/193.814/0.020 ms

Node112, AS14061, Bangalore, India # Node112,AS14061,班加罗尔,印度
PING 52.14.183.223 (52.14.183.223) 56(84) bytes of data.
64 bytes from 52.14.183.223: icmp_seq=1 ttl=41 time=233 ms
64 bytes from 52.14.183.223: icmp_seq=2 ttl=41 time=232 ms
64 bytes from 52.14.183.223: icmp_seq=3 ttl=41 time=232 ms

--- 52.14.183.223 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 801ms
rtt min/avg/max/mdev = 232.727/232.975/233.375/0.486 ms

traceroute - 对域名或 IP 地址运行路由跟踪测试

从上海的某一台服务器测试 baidu.com 的路由跟踪:

$ perfops traceroute --from "Shanghai" baidu.com
Node276, AS37963, Shanghai, China
traceroute to baidu.com (123.125.115.110), 20 hops max, 60 byte packets
 2  11.222.252.181 (11.222.252.181)  5.770 ms  5.911 ms
 3  11.222.252.10 (11.222.252.10)  5.519 ms  52.961 ms
 4  11.220.159.58 (11.220.159.58)  1.760 ms  1.863 ms
 5  116.251.106.157 (116.251.106.157)  2.412 ms  2.402 ms
 6  140.205.50.225 (140.205.50.225)  2.185 ms  2.189 ms
 7  140.206.207.205 (140.206.207.205)  3.937 ms  4.036 ms
 8  140.206.207.29 (140.206.207.29)  4.209 ms  4.247 ms
 9  * *
10  139.226.227.33 (139.226.227.33)  9.367 ms  9.365 ms
11  219.158.6.165 (219.158.6.165)  30.609 ms  30.525 ms
12  * *
13  61.51.113.246 (61.51.113.246)  25.389 ms  25.578 ms
14  202.106.43.38 (202.106.43.38)  25.545 ms  25.531 ms
15  * *
16  * *
17  123.125.115.110 (123.125.115.110)  25.586 ms  25.594 ms

latency - 对域名或 IP 地址运行 ICMP 延迟测试

分别在位于中国的随机10台服务器上测试 google.com 的ICMP延迟:

perfops latency --from China google.com --limit 10
Node208, AS37963, Hangzhou, China # 杭州,100%丢包😂
100% packet loss
Node329, AS37963, Hohhot, China # 呼和浩特,100%丢包😂
100% packet loss
Node207, AS37963, Beijing, China # 北京。。。😂
100% packet loss
Node276, AS37963, Shanghai, China # 上海。。。😂
100% packet loss
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 217,734评论 6 505
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,931评论 3 394
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,133评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,532评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,585评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,462评论 1 302
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,262评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,153评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,587评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,792评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,919评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,635评论 5 345
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,237评论 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,855评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,983评论 1 269
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,048评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,864评论 2 354

推荐阅读更多精彩内容