Last active
October 3, 2015 00:09
-
-
Save tmichelet/5ff43f86f9bbc350e013 to your computer and use it in GitHub Desktop.
[AWS] display metrics and contexts
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 characters
import boto | |
import boto.ec2 | |
import boto.ec2.cloudwatch | |
accounts = [ | |
('<key>', '<secret>'), | |
] | |
regions = [r.name for r in boto.ec2.regions()] | |
for key, secret in accounts: | |
for region in regions: | |
print region | |
try: | |
ccw = boto.ec2.cloudwatch.connect_to_region(region, aws_access_key_id=key, aws_secret_access_key=secret) | |
metrics = ccw.list_metrics(namespace='AWS/AutoScaling') | |
for metric in metrics: | |
print metric.name, metric.dimensions | |
except Exception as e: | |
print e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment