您可以通过 netdig
命令一键式诊断网络,帮助您确定网络问题。
./tosutil netdig domain/ipaddress [-aoe] [-ipv6] [-w] [-we=xxx] [-p] [-pss=xxx] [-tr] [-c] [-dp=xxx] [-di=xxx] [-u] [-ucl=xxx]
参数名 | 参数类型 | 描述 |
---|---|---|
domain | String | 目标主机域名。TOS 支持的地域和访问域名,请参见地域和访问域名(Endpoint)。 |
ipaddress | String | 目标主机 IP 地址。 |
-aoe | Bool | 执行过程中遇到错误时中断命令。 |
-ipv6 | Bool | 解析域名时选择 IPv6 地址。 |
-w | Bool | 使用 |
-we | String | 查看 |
-p | Bool | 使用 |
-pss | String | 使用 |
-tr | Bool | 使用 |
-c | Bool | 使用 |
-dp | String | 使用 注意 该参数的值必须使用双引号 |
-di | String | 使用 |
-u | Bool | 打包并上传收集到的网络信息到 TOS 存储桶。 |
-ucl | String | 打包上传时使用该参数指定的桶和前缀,格式为 |
执行命令进行网络诊断测试,并收集相关信息打包上传到指定的桶。示例如下:
./tosutil netdig tos-cn-beijing.volces.com -w -p -tr -c -dp "-pt upload -timeout 15" -u -ucl tos://bucket-test
Start to exec command [dig whoami.byte008.com] Start to exec command [ping -c 10 -s 64 tos-cn-beijing.volces.com] Start to exec command [ping -c 10 -s 1295 tos-cn-beijing.volces.com] Start to exec command [ping -c 10 -s 1472 tos-cn-beijing.volces.com] Start to exec command [traceroute -P UDP -n -w 1 tos-cn-beijing.volces.com] Start to exec command [traceroute -P ICMP -n -w 1 tos-cn-beijing.volces.com] Start to exec command [curl -o /dev/null -s -w time_namelookup:\t%{time_namelookup}\ntime_connect:\t\t%{time_connect}\ntime_appconnect:\t%{time_appconnect}\ntime_pretransfer:\t%{time_pretransfer}\ntime_starttransfer:\t%{time_starttransfer}\ntime_total:\t\t%{time_total}\ntime_redirect:\t\t%{time_redirect}\n http://tos-cn-beijing.volces.com] Start to exec command [tcpdump -nn -w 618b7d5a-2bf1-11ef-ade1-b645e116****.pcap (tcp[tcpflags] & (tcp-syn|tcp-fin|tcp-rst) != 0 or tcp[13] & 0x3f = 0x3f) and host tos-cn-beijing.volces.com] Start to test the uploading speed for region cn-beijing Average upload rate: 6.73MB/s Time consuming details Resolve dns cost: 24 ms Build connection cost: 36 ms Tls handshake cost: -1 ms Send request cost: 14938 ms Wait response cost: -1 ms Total cost: 15000 ms Collect network info finished, start to upload it as key [2024-06-16T15:01:59Z/618b7e18-2bf1-11ef-ade1-b645e116****] in bucket [bucket-test] [-------------------------------------------------] 100.00% ?/s 99.60MB/? 127ms Upload network info finished, the uploaded url is: http://bucket-test.tos-cn-beijing.volces.com/2024-06-16T15:01:59Z/618b7e18-2bf1-11ef-ade1-b645e116****?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTY2E1ZTExYjgzMjk0NGJkYTgyYTQ3OWE5NjVjYzV****%2F20240616%2Fbeijing%2Ftos%2Frequest&X-Tos-Date=20240616T150410Z&X-Tos-Expires=25200&X-Tos-Signature=6aedd32bec9f224414afeda5f2859d9f8684f493714cb86e0b320a3a5ab****&X-Tos-SignedHeaders=host Capture network packet finished, start to upload it as key [2024-06-16T15:01:59Z/618b7d5a-2bf1-11ef-ade1-b645e1163e54.pcap] in bucket [bucket-test] [--------------------------------------------------] 100.00% ?/s 99.60MB/? 40ms Upload network packet finished, the uploaded url is: http://bucket-test.tos-cn-beijing.volces.com/2024-06-16T15:01:59Z/618b7d5a-2bf1-11ef-ade1-b645e1163e54.pcap?X-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=AKLTY2E1ZTExYjgzMjk0NGJkYTgyYTQ3OWE5NjVjYzViZTQ%2F20240616%2Fbeijing%2****Frequest&X-Tos-Date=20240616T150410Z&X-Tos-Expires=25200&X-Tos-Signature=95601b6fe804552b5256410fa2242062a32c2b850d3822a27485b4665ef7****&X-Tos-SignedHeaders=host