Ping:
ping -6 -D a::b | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0 }'
windows Ping:
ping.exe -t a.b.c.d |Foreach{"{0} - {1}" -f (Get-Date),$_}
windows tcping:
.\tcping.exe -t a.b.c.d 23456 |Foreach{"{0} - {1}" -f (Get-Date),$_}
iperf服务端:
stdbuf -o0 iperf3 -s | sed "s/^/$(date '+[%Y-%m-%d %H:%M:%S]') /"
iperf客户端
stdbuf -o0 iperf3 -c a::b -R -t 86400 -b 100M | while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line";done
Curl:
while true;do curl --max-time 5 -s -o /dev/null -w "%{http_code}" -g http://[aa::bb]:23456 | while IFS= read -r line; do echo "$(date '+[%Y-%m-%d %H:%M:%S]') $line";if [ $? -ne 0 ];then break;fi;date;sleep 5s;done