Skip to content

Instantly share code, notes, and snippets.

@deckerego
Created December 6, 2013 22:18
Show Gist options
  • Save deckerego/7833103 to your computer and use it in GitHub Desktop.
Save deckerego/7833103 to your computer and use it in GitHub Desktop.
Look at the US-EAST-1 RSS feeds for AWS and see if there are any outages
#!/usr/bin/python
import feedparser
import time
rss_feeds = {
"http://status.aws.amazon.com/rss/elb-us-east-1.rss",
"http://status.aws.amazon.com/rss/ec2-us-east-1.rss",
"http://status.aws.amazon.com/rss/elasticache-us-east-1.rss",
"http://status.aws.amazon.com/rss/rds-us-east-1.rss",
"http://status.aws.amazon.com/rss/s3-us-standard.rss",
"http://status.aws.amazon.com/rss/vpc-us-east-1.rss",
"http://status.aws.amazon.com/rss/directconnect-us-east-1.rss"
}
failures = []
for rss_feed in rss_feeds:
rss_data = feedparser.parse(rss_feed)
if any(rss_data['entries']):
latest_entry = rss_data['entries'][0]
title = latest_entry['title']
published = latest_entry['published_parsed']
days_ago = (time.time() - time.mktime(published)) / (24 * 60 * 60)
if "RESOLVED" not in title and "Service is operating normally" not in title:
failures.append(title)
print failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment