Skip to content

Instantly share code, notes, and snippets.

@Yggdrasil
Created June 30, 2015 09:35
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 Yggdrasil/163d63a11f0efbc6a13b to your computer and use it in GitHub Desktop.
Save Yggdrasil/163d63a11f0efbc6a13b to your computer and use it in GitHub Desktop.
Fetch and format a list of Pingdom probe servers via bash-scripting
# It can be useful to pull the list of Pingdom probe servers and format it for various applications, such as ACLs or whitelists.
# We simply use the RSS-feed and some Bash-scripting.
# For example, an Apache access-list:
printf "# Pingdom servers at %s\nAllow from " "$(date -u +%F' '%T' '%Z)" ; \
wget -qO- https://my.pingdom.com/probes/feed \
| awk '/IP: / {print $2}' | awk -F';' '{print$1}' | sort -n \
| while read ip; do \
printf "%s " "$ip" ;
done | sed 's/ $//' ; echo
# Sample output:
# Pingdom servers at 2015-06-30 09:34:07 UTC
Allow from 46.165.195.139 46.20.45.18 50.23.94.74 64.141.100.136 64.237.55.3 67.228.213.178 69.59.28.19 69.64.56.47 70.32.40.2 …
# Another form of Apache access-list
printf "# Pingdom servers at %s\n" "$(date -u +%F' '%T' '%Z)" ; \
wget -qO- https://www.pingdom.com/rss/probe_servers.xml \
| grep 'IP: ' \
| perl -p -e 's,.*IP: (.*); Host.*,Allow from $1,' \
| sort -n
# Sample output:
# Pingdom servers at 2015-06-30 09:34:07 UTC
Allow from 108.62.115.226
Allow from 173.204.85.217
Allow from 173.248.147.18
[…]
# As Varnish ACL:
printf "# Pingdom servers at %s\n" "$(date -u +%F' '%T' '%Z)" ; \
echo "acl monitoring {"; \
wget -qO- https://www.pingdom.com/rss/probe_servers.xml \
| grep 'IP: ' \
| perl -p -e 's,.*IP: (.*); Host.*, "$1";,' \
| sort -n; \
echo "}"
# Sample output:
# Pingdom servers at 2015-06-30 09:34:07 UTC
acl monitoring {
"108.62.115.226";
"158.58.173.160";
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment