Created
November 23, 2010 17:46
-
-
Save somic/712175 to your computer and use it in GitHub Desktop.
AWK script to detect missing replies in Linux ping output, based on icmp_seq
This file contains hidden or 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
#!/usr/bin/awk -f | |
# | |
# analyzes ping output on Linux and looks for missed returns | |
# based on icmp_seq | |
# | |
# ping output is expected on stdin | |
# | |
BEGIN { num = 0 } | |
$5 ~ /icmp_seq=/ { | |
split($5, res, /=/); | |
if (res[2] != num + 1) { | |
print "missed between", num, "and", res[2] } | |
num = res[2]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After adding the above content to a file, Do i need to capture the ping output to a file.