Created
December 5, 2012 16:50
-
-
Save nz/4217338 to your computer and use it in GitHub Desktop.
Add CloudWatch StatusCheckFailed alarm to all instances (wip)
This file contains 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
# Still a WIP while I read up on what all the API attributes are. Suggestions welcome. ;) | |
require 'fog' | |
require 'fog/aws/cloud_watch/alarm' | |
include Fog::AWS::CloudWatch | |
conn = Fog::Compute.new provider: 'AWS' | |
conn.servers.each do |srv| | |
Alarm.new({ | |
connection: conn, | |
id: srv.id, | |
comparison_operator: '>', | |
metric_name: 'StatusCheckFailed', | |
period: 60, | |
statistic: 'Maximum', | |
threshold: '1.0' | |
}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment