Forked from edgartaor/ Ping all AWS EC2 IPs
Last active
June 11, 2023 01:45
Revisions
-
sashareds revised this gist
May 24, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,6 @@ That's it! Things to do: 1. tidy up the output. For some weird reason script fails to process the first ping sometimes and prints out an error. Also, it prints the variables as the first line of the output, no idea why for now. 2. figure out how to nicely columnise the output. For now ``column`` doesnt pick up the output fully. 3. Add an option to ping only particular country. 4. make this script available to run with wget/curl -
sashareds revised this gist
May 24, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ To run the script That's it! Things to do: 1. tidy up the output. For some weird reason script fails to process the first ping sometimes and prints out an error. Also, it prints the variables as the first line of the output, no idea why for now. 2. figure out how to nicely columnise the output. For now ``column doesnt`` picking up the output fully. 3. Add an option to ping only particular country. make this script available to run with wget/curl -
sashareds revised this gist
May 24, 2019 . 6 changed files with 96 additions and 197 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Automatic ping of all AWS EC2 IPs from http://ec2-reachability.amazonaws.com/ 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,17 @@ This is a fork from of Ping all AWS EC2 IPs script. It didnt work for me so I had to figure it out on my own. I only copied IPs from http://ec2-reachability.amazonaws.com for Europe(Ireland, London, Paris, Frankfurt & Stockholm). It's easy to make your own csv files with your own regions. To run the script 1. chmod u-x scriptname.sh 2. then just run # bash scriptname.sh OR simply # ./scriptname.sh the result will be printed in your shell. 3. If you'd like to output its results into a file, just run this # ./scriptname.sh > results.txt That's it! Things to do: 1. tidy up the output. sfor some reason script fails to process first ping sometimes, prinitng an error. Also, it prints variable as the first line of the output, no idea why for now. 2. figure out how to nicely columnise the output. For now column doesnt picking up the output fully. 3. Add an option to ping only particular country. make this script available to run with wget/curl 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,62 @@ Country,Region,IP Ireland,eu-west-1,18.202.0.0 Ireland,eu-west-1,34.240.0.253 Ireland,eu-west-1,34.248.60.213 Ireland,eu-west-1,46.51.178.50 Ireland,eu-west-1,46.137.120.1 Ireland,eu-west-1,46.137.191.254 Ireland,eu-west-1,52.16.0.2 Ireland,eu-west-1,52.19.0.2 Ireland,eu-west-1,52.30.63.252 Ireland,eu-west-1,52.48.63.252 Ireland,eu-west-1,52.215.255.254 Ireland,eu-west-1,54.72.255.252 Ireland,eu-west-1,54.73.0.1 Ireland,eu-west-1,54.74.0.1 Ireland,eu-west-1,54.76.0.3 Ireland,eu-west-1,54.78.0.3 Ireland,eu-west-1,54.154.63.252 Ireland,eu-west-1,54.155.0.1 Ireland,eu-west-1,54.170.248.3 Ireland,eu-west-1,54.171.63.252 Ireland,eu-west-1,54.194.255.254 Ireland,eu-west-1,54.216.0.1 Ireland,eu-west-1,54.220.0.0 Ireland,eu-west-1,54.228.250.251 Ireland,eu-west-1,54.229.0.1 Ireland,eu-west-1,54.240.0.0 Ireland,eu-west-1,54.240.56.254 Ireland,eu-west-1,54.246.127.255 Ireland,eu-west-1,54.247.127.254 Ireland,eu-west-1,63.32.0.0 Ireland,eu-west-1,79.125.120.9 Ireland,eu-west-1,99.80.0.0 Ireland,eu-west-1,108.128.0.0 Ireland,eu-west-1,176.34.127.254 Ireland,eu-west-1,176.34.255.255 Ireland,eu-west-1,185.48.120.66 ,, London,eu-west-2,3.8.0.0 London,eu-west-2,18.130.0.0 London,eu-west-2,35.176.0.252 London,eu-west-2,35.178.0.253 London,eu-west-2,52.56.34.0 ,, Paris,eu-west-3,35.180.0.253 Paris,eu-west-3,35.181.0.0 Paris,eu-west-3,52.47.32.127 ,, Frankfurt,eu-central-1,3.120.0.0 Frankfurt,eu-central-1,3.124.0.0 Frankfurt,eu-central-1,18.184.0.0 Frankfurt,eu-central-1,18.194.0.252 Frankfurt,eu-central-1,18.196.0.253 Frankfurt,eu-central-1,35.156.63.252 Frankfurt,eu-central-1,52.28.63.252 Frankfurt,eu-central-1,52.29.63.252 Frankfurt,eu-central-1,52.57.255.254 Frankfurt,eu-central-1,52.58.63.252 Frankfurt,eu-central-1,54.93.32.2 Frankfurt,eu-central-1,54.93.162.162 ,, Stockholm,eu-north-1,13.53.128.254 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 charactersOriginal file line number Diff line number Diff line change @@ -1,183 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,22 @@ #!/bin/bash #debugging #exec 7> debug_output.txt #BASH_XTRACEFD=7 #PS4='$LINENO: ' #set -x # IFS="," #printing tabke header echo "COUNTRY, REGION, IP, RTT" cat awsiplist.csv | while read Country Region IP do #extractung avarage Rouns Trip Time rtt=`ping -c 5 $IP | tail -1| gawk '{print $4}' | cut -d '/' -f 2` #printing results into the table (needs some work tho) printf "$Country, $Region, $IP, $rtt ms (avg) \n" | column -s ',' -t done -
edgartaor revised this gist
Aug 14, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ I simple took the IPs from http://ec2-reachability.amazonaws.com and made a script to ping all. Run and save the results with ./pingall.sh > results.csv (Tested on Windows 10 with Cygwin) -
edgartaor revised this gist
Aug 14, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ I simple took the IPs from http://ec2-reachability.amazonaws.com and made a script to ping all. Run and save the results with ./pingall.sh > results.csv -
edgartaor renamed this gist
Aug 14, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
edgartaor renamed this gist
Aug 14, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
edgartaor revised this gist
Aug 14, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Ping all AWS EC2 IPs from http://ec2-reachability.amazonaws.com/ -
edgartaor revised this gist
Aug 14, 2016 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,4 @@ I simple grab the IPs from http://ec2-reachability.amazonaws.com and made a script to ping all. Run and save the results with ./pingall.sh > results.csv -
edgartaor revised this gist
Aug 14, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Ping all AWS EC2 IPs from http://ec2-reachability.amazonaws.com/ -
edgartaor revised this gist
Aug 14, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -180,4 +180,4 @@ sa-east-1,54.232.0.0/16,54.232.127.254 sa-east-1,54.233.64.0/18,54.233.127.252 sa-east-1,54.233.128.0/17,54.233.192.0 sa-east-1,54.240.16.0/21,54.240.16.0 sa-east-1,177.71.128.0/17,177.71.255.255 -
edgartaor created this gist
Aug 14, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,183 @@ Region,Prefix,IP us-east-1,23.20.0.0/14,23.23.255.255 us-east-1,50.16.0.0/15,50.17.255.254 us-east-1,50.19.0.0/16,50.19.255.254 us-east-1,52.0.0.0/15,52.1.255.254 us-east-1,52.2.0.0/15,52.2.0.2 us-east-1,52.4.0.0/14,52.7.255.255 us-east-1,52.20.0.0/14,52.20.63.253 us-east-1,52.70.0.0/15,52.70.63.252 us-east-1,52.72.0.0/15,52.72.63.252 us-east-1,52.86.0.0/15,52.86.63.252 us-east-1,52.90.0.0/15,52.90.63.252 us-east-1,52.200.0.0/13,52.200.255.254 us-east-1,54.80.0.0/14,54.80.0.2 us-east-1,54.84.0.0/15,54.84.0.3 us-east-1,54.86.0.0/15,54.86.63.252 us-east-1,54.88.0.0/16,54.88.0.3 us-east-1,54.89.0.0/16,54.89.0.3 us-east-1,54.90.0.0/15,54.90.0.3 us-east-1,54.92.128.0/17,54.92.128.2 us-east-1,54.144.0.0/14,54.144.0.2 us-east-1,54.152.0.0/16,54.152.63.252 us-east-1,54.156.0.0/14,54.156.0.0 us-east-1,54.160.0.0/14,54.160.0.2 us-east-1,54.164.0.0/15,54.164.63.252 us-east-1,54.166.0.0/15,54.166.0.2 us-east-1,54.172.0.0/15,54.172.63.252 us-east-1,54.174.0.0/15,54.174.0.2 us-east-1,54.196.0.0/15,54.196.0.1 us-east-1,54.198.0.0/16,54.198.0.1 us-east-1,54.204.0.0/15,54.205.255.255 us-east-1,54.208.0.0/15,54.208.0.1 us-east-1,54.210.0.0/16,54.210.63.252 us-east-1,54.221.0.0/16,54.221.214.221 us-east-1,54.224.0.0/15,54.225.110.215 us-east-1,54.226.0.0/15,54.226.0.1 us-east-1,54.234.0.0/15,54.235.236.60 us-east-1,54.236.0.0/15,54.236.0.0 us-east-1,54.240.8.0/21,54.240.8.0 us-east-1,54.242.0.0/15,54.243.255.254 us-east-1,67.202.0.0/18,67.202.0.5 us-east-1,72.44.32.0/19,72.44.32.8 us-east-1,75.101.128.0/17,75.101.163.105 us-east-1,107.20.0.0/14,107.22.255.255 us-east-1,174.129.0.0/16,174.129.0.31 us-east-1,184.72.64.0/18,184.72.92.4 us-east-1,184.72.128.0/17,184.72.255.254 us-east-1,184.73.0.0/16,184.73.173.231 us-east-1,204.236.192.0/18,204.236.238.4 us-west-1,50.18.0.0/16,50.18.56.1 us-west-1,52.8.0.0/16,52.8.191.254 us-west-1,52.9.0.0/16,52.9.63.252 us-west-1,52.52.0.0/15,52.52.63.252 us-west-1,54.67.0.0/17,54.67.63.253 us-west-1,54.151.0.0/17,54.151.0.2 us-west-1,54.153.0.0/17,54.153.63.252 us-west-1,54.176.0.0/15,54.176.64.1 us-west-1,54.183.0.0/16,54.183.64.3 us-west-1,54.193.0.0/16,54.193.0.3 us-west-1,54.215.0.0/16,54.215.0.1 us-west-1,54.219.0.0/16,54.219.127.255 us-west-1,54.241.0.0/16,54.241.127.255 us-west-1,184.72.0.0/18,184.72.56.36 us-west-1,184.169.128.0/17,184.169.255.254 us-west-1,204.236.128.0/18,204.236.129.206 us-west-2,50.112.0.0/16,50.112.120.53 us-west-2,52.10.0.0/15,52.10.63.252 us-west-2,52.12.0.0/15,52.13.255.255 us-west-2,52.24.0.0/14,52.24.63.252 us-west-2,52.32.0.0/14,52.32.63.252 us-west-2,52.36.0.0/14,52.36.0.2 us-west-2,52.40.0.0/14,52.43.255.254 us-west-2,52.88.0.0/15,52.88.0.2 us-west-2,54.68.0.0/15,54.68.63.252 us-west-2,54.70.0.0/15,54.70.0.12 us-west-2,54.148.0.0/15,54.148.0.2 us-west-2,54.184.0.0/15,54.184.0.3 us-west-2,54.186.0.0/15,54.186.0.3 us-west-2,54.188.0.0/15,54.188.0.0 us-west-2,54.190.0.0/16,54.190.0.0 us-west-2,54.191.0.0/16,54.191.63.252 us-west-2,54.200.0.0/15,54.200.0.1 us-west-2,54.202.0.0/15,54.202.0.1 us-west-2,54.212.0.0/15,54.212.0.0 us-west-2,54.214.0.0/16,54.214.0.1 us-west-2,54.218.0.0/16,54.218.4.254 us-west-2,54.240.24.0/21,54.240.24.0 us-west-2,54.244.0.0/16,54.244.128.1 us-west-2,54.245.0.0/16,54.245.127.255 us-gov-west-1,52.222.0.0/17,52.222.9.163 eu-west-1,46.51.128.0/18,46.51.178.50 eu-west-1,46.137.0.0/17,46.137.120.1 eu-west-1,46.137.128.0/18,46.137.191.254 eu-west-1,52.16.0.0/15,52.16.0.2 eu-west-1,52.18.0.0/15,52.19.0.2 eu-west-1,52.30.0.0/15,52.30.63.252 eu-west-1,52.48.0.0/14,52.48.63.252 eu-west-1,52.208.0.0/13,52.215.255.254 eu-west-1,54.72.0.0/16,54.72.255.252 eu-west-1,54.73.0.0/16,54.73.0.1 eu-west-1,54.74.0.0/15,54.74.0.1 eu-west-1,54.76.0.0/15,54.76.0.3 eu-west-1,54.78.0.0/16,54.78.0.3 eu-west-1,54.154.0.0/16,54.154.63.252 eu-west-1,54.155.0.0/16,54.155.0.1 eu-west-1,54.170.0.0/16,54.170.248.3 eu-west-1,54.171.0.0/16,54.171.63.252 eu-west-1,54.194.0.0/15,54.194.255.254 eu-west-1,54.216.0.0/15,54.216.0.1 eu-west-1,54.220.0.0/16,54.220.0.0 eu-west-1,54.228.0.0/16,54.228.250.251 eu-west-1,54.229.0.0/16,54.229.0.1 eu-west-1,54.240.0.0/21,54.240.0.0 eu-west-1,54.246.0.0/16,54.246.127.255 eu-west-1,54.247.0.0/16,54.247.127.254 eu-west-1,79.125.0.0/17,79.125.120.9 eu-west-1,176.34.64.0/18,176.34.127.254 eu-west-1,176.34.128.0/17,176.34.255.255 eu-west-1,185.48.120.0/22,185.48.120.66 eu-central-1,52.28.0.0/16,52.28.63.252 eu-central-1,52.29.0.0/16,52.29.63.252 eu-central-1,52.58.0.0/15,52.58.63.252 eu-central-1,54.93.0.0/17,54.93.32.2 eu-central-1,54.93.128.0/17,54.93.162.162 ap-northeast-1,46.51.224.0/19,46.51.255.254 ap-northeast-1,52.68.0.0/15,52.68.63.252 ap-northeast-1,52.192.0.0/15,52.192.63.252 ap-northeast-1,52.196.0.0/14,52.196.63.252 ap-northeast-1,54.64.0.0/15,54.64.0.2 ap-northeast-1,54.92.0.0/17,54.92.0.2 ap-northeast-1,54.95.0.0/16,54.95.0.2 ap-northeast-1,54.150.0.0/16,54.150.0.255 ap-northeast-1,54.168.0.0/16,54.168.0.2 ap-northeast-1,54.178.0.0/16,54.178.0.2 ap-northeast-1,54.199.0.0/16,54.199.127.255 ap-northeast-1,54.238.0.0/16,54.238.0.0 ap-northeast-1,54.248.0.0/15,54.248.127.254 ap-northeast-1,54.250.0.0/16,54.250.128.0 ap-northeast-1,103.4.8.0/21,103.4.10.139 ap-northeast-1,175.41.192.0/18,175.41.248.202 ap-northeast-1,176.32.64.0/19,176.32.95.254 ap-northeast-1,176.34.0.0/18,176.34.56.254 ap-northeast-2,52.78.0.0/16,52.78.63.252 ap-northeast-2,52.79.0.0/16,52.79.52.64 ap-southeast-1,46.51.216.0/21,46.51.216.14 ap-southeast-1,46.137.192.0/18,46.137.255.254 ap-southeast-1,52.74.0.0/16,52.74.0.2 ap-southeast-1,52.76.0.0/17,52.76.0.2 ap-southeast-1,52.76.128.0/17,52.76.191.252 ap-southeast-1,52.77.0.0/16,52.77.63.252 ap-southeast-1,52.220.0.0/15,52.221.255.252 ap-southeast-1,54.151.128.0/17,54.151.128.2 ap-southeast-1,54.169.0.0/17,54.169.0.2 ap-southeast-1,54.169.128.0/17,54.169.191.253 ap-southeast-1,54.179.0.0/17,54.179.0.2 ap-southeast-1,54.179.128.0/17,54.179.191.252 ap-southeast-1,54.251.0.0/16,54.251.63.255 ap-southeast-1,54.254.0.0/16,54.254.128.1 ap-southeast-1,54.255.0.0/16,54.255.0.2 ap-southeast-1,122.248.192.0/18,122.248.255.254 ap-southeast-1,175.41.128.0/18,175.41.146.190 ap-southeast-2,52.62.0.0/15,52.62.63.252 ap-southeast-2,52.64.0.0/17,52.64.63.253 ap-southeast-2,52.64.128.0/17,52.64.191.252 ap-southeast-2,52.65.0.0/16,52.65.63.252 ap-southeast-2,54.66.0.0/17,54.66.0.2 ap-southeast-2,54.66.128.0/17,54.66.191.252 ap-southeast-2,54.79.0.0/16,54.79.127.252 ap-southeast-2,54.153.128.0/17,54.153.191.252 ap-southeast-2,54.206.0.0/17,54.206.127.254 ap-southeast-2,54.206.128.0/17,54.206.128.2 ap-southeast-2,54.252.0.0/16,54.252.88.8 ap-southeast-2,54.253.0.0/16,54.253.0.1 ap-south-1,52.66.0.0/16,52.66.66.2 sa-east-1,52.67.0.0/16,52.67.255.254 sa-east-1,54.94.0.0/17,54.94.0.66 sa-east-1,54.94.128.0/17,54.94.191.252 sa-east-1,54.207.0.0/16,54.207.127.254 sa-east-1,54.232.0.0/16,54.232.127.254 sa-east-1,54.233.64.0/18,54.233.127.252 sa-east-1,54.233.128.0/17,54.233.192.0 sa-east-1,54.240.16.0/21,54.240.16.0 sa-east-1,177.71.128.0/17,177.71.255.255, 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/bash export IFS="," echo "REGION,PREFIX,IP,RESULT" cat hostlist.csv | while read Region Prefix IP do result=`ping "$IP" | tail -1| gawk '{print $9}' | cut -d '/' -f 2` echo "$Region,$Prefix,$IP,$result" done read -p "Press enter to continue" nothing