Created
February 7, 2014 10:04
-
-
Save yvt/8860063 to your computer and use it in GitHub Desktop.
Pingのパケット損失率をパケットサイズごとの表にしてCSV出力するスクリプト (要root)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 出力ファイル | |
OUT=/tmp/ping-test-out.csv | |
# ホスト名 (適宜変えてね) | |
HOST=www.google.com | |
echo "ping-test to ${HOST}" > "$OUT" | |
for siz in `seq 50 50 1500`; do | |
echo "size = ${siz}" | |
resline=`ping -s ${siz} -D -c 300 -f -q "$HOST" | grep -o '[0-9.]*\%'` | |
outline="${siz},${resline}" | |
echo "$outline" | |
echo "$outline" >> "$OUT" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment