euwatch-put-metric-alarm

Creates a new alarm, or updates an existing alarm.

Syntax

euwatch-put-metric-alarm Alarm --comparison-operator  value  --evaluation-periods  value
--metric-name  value  --namespace  value  --period  value  --statistic 
value  --threshold  value [--actions-enabled  value ] [--alarm-actions 
value[,value...] ] [--alarm-description  value ] [--dimensions 
"key1=value1,key2=value2..." ] [--ok-actions  value[,value...] ] [--unit 
value ] [--insufficient-data-actions  value[,value...] ]

Options

Option Description Required
Alarm Name of the alarm. Yes
--actions-enabled value This determines if you want actions be executed when this alarm changes state.

Valid values: true | false

No
--alarm-actions value1,value2,value3... Describes what you want to do if the alarm changes state. The value is the Amazon resource name (ARN) of the resource you want to act on. No
--alarm-description value Description of the alarm. No
--comparison-operator value The operator with which the comparison with threshold will be made.

Valid values: GreaterThanOrEqualToThreshold | GreaterThanThreshold | LessThanThreshold | LessThanOrEqualToThreshold

Yes
--dimensions "key1=value1,key2=value2..." Dimensions of the metric on which to alarm. No
--evaluation-periods value Number of consecutive periods for which the value of the metric needs to be compared to threshold. Yes
--metric-name value The name of the metric on which to alarm. Yes
--namespace value Namespace of the metric on which to alarm. Yes
--ok-actions value1,value2,value3... Describes what you want to do if the alarm goes to state OK. The value is the Amazon resource name (ARN) of the resource you want to act on. No
--period value Period of metric on which to alarm. Yes
--statistic value The statistic of the metric on which to alarm.

Valid values: SampleCount | Average | Sum | Minimum | Maximum

Yes
--threshold value The threshold with which the metric value will be compared. Yes
--unit value The unit of the metric on which to alarm. No
--insufficient-data-actions value1,value2,value3.. Describes what you want to do if the alarm goes to state INSUFFICIENT_DATA. The value is the Amazon resource name (ARN) of the resource you want to act on. No

Common Options

Option Description
--show-empty-fields Show empty fields using (nil) as a placeholder to indicate that this data was not requested. Empty fields are not shown by default.
--region value Specify region value as the cloud region to use. You can set this by using the environment variable AWS_DEFAULT_REGION.
-U,--url value Overrides the URL for the service call with the value entered. You can set this by using the environment variable AWS_AUTOSCALING_URL.
-I, --access-key-id value User's access key ID
-S, --secret-key value User's AWS secret Key to use.
--debug Prints what the command sends to the server and what it receives from the server. Use when you're trying to debug Euca2ools.
--debugger Enable interactive debugger on error.
--version Display the version of this tool.
-h,--help Display the manual page for the command.

Output

Eucalyptus does not return a response.

Example

The following example creates an alarm, test-alarm, that add a message to a topic when the CPU utilization of an instance exceeds 90% for three consecutive one minute periods.

euwatch-put-metric-alarm test-alarm --alarm-description "some desc"
 --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average  --period 60 --threshold
 90 --comparison-operator GreaterThanThreshold  --dimensions AutoScalingGroupName=dev01
 --evaluation-periods 3  --unit Percent --alarm-actions 
 arn:aws:autoscaling::scalingPolicy:45e9ed16-9462-4905-b9d4-ff99fecc0d43
 :autoScalingGroupName/dev01:policyName/cap01-add
x