Amazon EC2 Instance Stop Scheduled Event Status

Amazon.AmazonWebServices.UnitMonitor.InstanceStopScheduledEventState (UnitMonitor)

It is a monitor for EC2 Instance Stop Scheduled Event Status

Knowledge Base article:

Summary

Monitor is in Warning state when an instance-stop event is scheduled or occurs.

When Amazon EC2 determines that an instance must be shut down, the instances status returns an event code called instance-stop. Stop events include a scheduled start and end time.

Causes

This monitor depends on EC2 Instance status check.

Resolutions

Investigate reason why EC2 Instance failed to pass status check in Amazon Console

Element properties:

TargetAmazon.AmazonWebServices.AmazonInstanceHealth
Parent MonitorAmazon.AmazonWebServices.Aggregate.AmazonInstanceHealthScheduledEventsAggregate
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeAmazon.AmazonWebServices.MonitorType.AmazonInstanceScheduledEventWarningStateType
RemotableFalse
AccessibilityPublic
Alert Message
Amazon EC2 Instance Stop Scheduled Event Status Alert
The EC2 Instance '{0}' is scheduled for stop between {2} and {3}. Event description: {1}
RunAsDefault

Source Code:

<UnitMonitor ID="Amazon.AmazonWebServices.UnitMonitor.InstanceStopScheduledEventState" Target="Amazon.AmazonWebServices.AmazonInstanceHealth" ParentMonitorID="Amazon.AmazonWebServices.Aggregate.AmazonInstanceHealthScheduledEventsAggregate" TypeID="Amazon.AmazonWebServices.MonitorType.AmazonInstanceScheduledEventWarningStateType" Remotable="false" Priority="Normal" ConfirmDelivery="false" Accessibility="Public" Enabled="true">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Amazon.AmazonWebServices.UnitMonitor.InstanceStopScheduledEventState.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="System!System.Entity"]/DisplayName$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name="Description"]$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name="NotBefore"]$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='NotAfter']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='InstanceId']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Property[Type='Amazon.AmazonWebServices.AmazonInstanceHealth']/InstanceId$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='EventType']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">instance-stop</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</Configuration>
</UnitMonitor>