Skip to content

Instantly share code, notes, and snippets.

@brickzva
Last active November 23, 2017 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brickzva/03e01d16e3b0f2bbb6b1 to your computer and use it in GitHub Desktop.
Save brickzva/03e01d16e3b0f2bbb6b1 to your computer and use it in GitHub Desktop.
Quick Bash tool to test for bottlenecks on an internal network. Tests the path to a host with each UDP/ICMP/TCP packet types for comparison. Used from shell and target device passed from stdin: example "./latency_finder.sh <<your host here>>" Can be used in cron job for scheduled testing.
#!/bin/bash
host=$1
echo "------"
echo "MTR Trace Report - UDP"
echo "______________________"
mtr -r -w -c 10 --show-ips -u $host
echo "------"
echo "------"
echo "MTR Trace Report - ICMP"
echo "_______________________"
mtr -r -w -c 10 --show-ips $host
echo "------"
echo "------"
echo "MTR Trace Report - TCP"
echo "______________________"
mtr -r -w -c 10 --show-ips -T $host
echo "------"
echo ""
echo "------"
echo "Parsed hosts for configuration gathering:"
echo "_________________________________________"
tracepath $host | grep -v 1?| grep -v LOC | uniq
echo "---- end of testing ----"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment