Skip to content

Instantly share code, notes, and snippets.

@jdowning
Created October 10, 2013 16:56
Show Gist options
  • Select an option

  • Save jdowning/6921795 to your computer and use it in GitHub Desktop.

Select an option

Save jdowning/6921795 to your computer and use it in GitHub Desktop.
Run an `mtr --report` on a list of hosts and email the results
google.com
yahoo.com
amazon.com
#!/bin/bash -e
HOSTS_FILE=$1
EMAIL="your-email@address.com"
while read host
do
echo "MTR REPORT FOR $host"
mtr --report $host
echo " "
done < $HOSTS_FILE | mail -s "`hostname -s` mtr report" $EMAIL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment