ubuntu@ip-172-31-19-185:~$ date; sudo ifdown eth0
Fri Dec 5 13:02:39 UTC 2014
EC2のStatus Check。前回同様、3分ぐらいでfail検知
123456789101112131415
Fri Dec 5 22:05:22 JST 2014
ok
DETAILS reachability passed
Fri Dec 5 22:05:28 JST 2014
ok
DETAILS reachability passed
Fri Dec 5 22:05:34 JST 2014
impaired
DETAILS 2014-12-05T13:05:00.000Z reachability failed
Fri Dec 5 22:05:40 JST 2014
impaired
DETAILS 2014-12-05T13:05:00.000Z reachability failed
SNS通知。飛ぶまで2分弱
1234567891011121314151617181920
Alarm Details:
- Name: StatusCheckFailed-Alarm-for-i-xxxxxxxx
- Description: Instance i-xxxxxxxx has failed
- State Change: OK -> ALARM
- Reason for State Change: Threshold Crossed: 2 datapoints were greater than or equal to the threshold (1.0). The most recent datapoints: [1.0, 1.0].
- Timestamp: Friday 05 December, 2014 13:07:19 UTC
- AWS Account: 123456789012
Threshold:
- The alarm is in the ALARM state when the metric is GreaterThanOrEqualToThreshold 1.0 for 60 seconds.
Monitored Metric:
- MetricNamespace: AWS/EC2
- MetricName: StatusCheckFailed
- Dimensions: [InstanceId = i-xxxxxxxx]
- Period: 60 seconds
- Statistic: Maximum
- Unit: Count
ubuntu@ip-172-31-21-180:~$ date; sudo ifdown eth0
Fri Dec 5 19:37:32 UTC 2014
EC2のStatus Check。約3分ぐらいでfail検知
1234567891011
Sat Dec 6 04:40:09 JST 2014
ok
DETAILS reachability passed
Sat Dec 6 04:40:16 JST 2014
impaired
DETAILS 2014-12-05T19:40:00.000Z reachability failed
Sat Dec 6 04:40:22 JST 2014
impaired
DETAILS 2014-12-05T19:40:00.000Z reachability failed
SNS通知。飛ぶまで2分弱
1234567
Alarm Details:
- Name: StatusCheckFailed-Alarm-for-i-yyyyyyyy
- Description: Instance i-yyyyyyyy has failed
- State Change: OK -> ALARM
- Reason for State Change: Threshold Crossed: 2 datapoints were greater than or equal to the threshold (1.0). The most recent datapoints: [1.0, 1.0].
- Timestamp: Friday 05 December, 2014 19:42:33 UTC
- AWS Account: 123456789012
そしてLambda発動!
1234567
START RequestId: e64849be-7cb6-12e4-9951-11b87edac46e
2014-12-05T19:42:36.728Z e64849be-7cb6-12e4-9951-11b87edac46e Received event:
2014-12-05T19:42:36.728Z e64849be-7cb6-12e4-9951-11b87edac46e { Type: 'Notification', MessageId: '2d85a5d8-c596-5f83-94a9-e924c97fd676', TopicArn: 'arn:aws:sns:us-west-2:123456789012:instance-alert', Subject: 'Status Check Alarm: !!StatusCheckFailed-Alarm-for-i-yyyyyyyy!! in US-West-2', Message: '{!!AlarmName!!:!!StatusCheckFailed-Alarm-for-i-yyyyyyyy!!,!!AlarmDescription!!:!!Instance i-yyyyyyyy has failed!!,!!AWSAccountId!!:!!123456789012!!,!!NewStateValue!!:!!ALARM!!,!!NewStateReason!!:!!Threshold Crossed: 2 datapoints were greater than or equal to the threshold (1.0). The most recent datapoints: [1.0, 1.0].!!,!!StateChangeTime!!:!!2014-12-05T19:42:33.757+0000!!,!!Region!!:!!US-West-2!!,!!OldStateValue!!:!!OK!!,!!Trigger!!:{!!MetricName!!:!!StatusCheckFailed!!,!!Namespace!!:!!AWS/EC2!!,!!Statistic!!:!!MAXIMUM!!,!!Unit!!:!!Count!!,!!Dimensions!!:[{!!name!!:!!InstanceId!!,!!value!!:!!i-yyyyyyyy!!}],!!Period!!:60,!!EvaluationPeriods!!:2,!!ComparisonOperator!!:!!GreaterThanOrEqualToThreshold!!,!!Threshold!!:1.0}}', Timestamp: '2014-12-05T19:42:33.841Z', SignatureVersion: '1', Signature: '1IYhSVfZmNxWWzoc539jBDN2HCo0Y5k/dUhWbaAEZSt/tkISjFkNTb9VsVwNAfZDOaLneO/sE2PwfUc/3aU9eedlAassxHOXAB6h844NVKxJzR5Xwg4dUx0mIb+fk9pMy/elcwk13GbDxLJ1cCTef7Bu7zyJU3TAF626YfAVhI9QdEo4o44g/y2osEXb+CuvFc5ICYpIWAad7gM5YPYxCU6tJ/CEtWGzaPz+O5Vk4NLm2/AizZ6LKA8/zqhQkqwnUwhzQDwuDGbJ2DXtTJwAO2r4M+zU8RwOxwPgEdgxA270xrmB6AlWV0mhsQIqqJVxo5Xm2v7y3iNUjKfov5DCZm==', SigningCertURL: 'https://sns.us-west-2.amazonaws.com/SimpleNotificationService-ad6697a11189d5c6f9eccf214ff9e123.pem', UnsubscribeURL: 'https://sns.us-west-2.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-west-2:123456789012:instance-alert:2d85a5d8-faea-5f83-baa1-9fecd7a5e71b' }
2014-12-05T19:42:36.728Z e64849be-7cb6-12e4-9951-11b87edac46e Changing instance health for: i-yyyyyyyy
014-12-05T19:42:36.831Z e64849be-7cb6-12e4-9951-11b87edac46e { ResponseMetadata: { RequestId: 'dd605f39-7cb6-12e4-a2c2-d57010899d82' } }
END RequestId: e64849be-7cb6-12e4-9951-11b87edac46e
REPORT RequestId: e64849be-7cb6-12e4-9951-11b87edac46e Duration: 175.86 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 18 MB
AutoscalingのHealth Status
1234567891011121314151617
Sat Dec 6 04:42:18 JST 2014
aws-advent2014-sg us-west-2a HEALTHY i-yyyyyyyy aws-advent2014-lc InService
Sat Dec 6 04:42:24 JST 2014
aws-advent2014-sg us-west-2a HEALTHY i-yyyyyyyy aws-advent2014-lc InService
Sat Dec 6 04:42:30 JST 2014
aws-advent2014-sg us-west-2a UNHEALTHY i-yyyyyyyy aws-advent2014-lc InService
Sat Dec 6 04:42:35 JST 2014
aws-advent2014-sg us-west-2a UNHEALTHY i-yyyyyyyy aws-advent2014-lc InService
Sat Dec 6 04:42:42 JST 2014
aws-advent2014-sg us-west-2a UNHEALTHY i-yyyyyyyy aws-advent2014-lc InService
jSat Dec 6 04:42:48 JST 2014
aws-advent2014-sg us-west-2a UNHEALTHY i-yyyyyyyy aws-advent2014-lc Terminating