Menu
Amazon CloudWatch
Command Line Reference (API Version 2010-08-01)

mon-describe-alarms

Description

Provides information on the specified alarm(s). If you don't specify an alarm name, this command returns information about all of your alarms. You can retrieve alarms by using only the alarm name prefix, the alarm state, or an action prefix.

Syntax

mon-describe-alarms [AlarmNames [AlarmNames ...]] [--action-prefix value] [--alarm-name-prefix value] [--state-value value] [Common Options]

Options

NameDescriptionRequired

AlarmNames AlarmNames

Names of the alarms. You can also set this value using --alarm-name. You can specify this option multiple times.

Type: Argument

Valid values: An existing alarm name, otherwise no response is returned.

Default: n/a, displays all alarms by default.

No

--action-prefix VALUE

Prefix of action names.

Type: Argument

Valid values: The prefix of an existing action name, in ARN format.

Default: n/a, display the first action by default.

No

--alarm-name-prefix VALUE

Prefix of alarm names.

Type: Argument

Valid values: The prefix of an existing alarm name.

Default: n/a

No

--state-value VALUE

The state of the alarm.

Type: Enumeration

Valid values: OK, ALARM, or INSUFFICIENT_DATA

Default: All alarm states.

No

Common Options

NameDescription

--aws-credential-file VALUE

Specifies the location of the file with your AWS credentials. You can set this value by using the environment variable AWS_CREDENTIAL_FILE. If you define the environment variable or you provide the path to the credential file, the file must exist or the request will fail. All CloudWatch requests must be signed using your access key ID and secret access key.

Type: String

Valid values: A valid path to a file containing your access key ID and secret access key.

Default: Uses the environment variable AWS_CREDENTIAL_FILE, if set.

-C, --ec2-cert-file-path VALUE

Specifies the location of your EC2 certificate file for signing requests. You can use the environment variable EC2_CERT to specify this value.

Type: String

Valid values: A valid file path to the PEM file provided by Amazon EC2 or AWS Identity and Access Management.

Default: Uses the environment variable EC2_CERT, if set.

--connection-timeout VALUE

Specify a connection timeout VALUE (in seconds).

Type: Integer

Valid values: Any positive number.

Default: 30

--delimiter VALUE

What delimiter to use when displaying delimited (long) results.

Type: String

Valid values: Any string.

Default: Comma (,)

--headers

If you are displaying tabular or delimited results, it includes the column headers. If you are showing xml results, it returns the HTTP headers from the service request, if applicable.

Type: Flag

Valid values: When present, shows headers.

Default: The --headers option is off by default.

-I, --access-key-id VALUE

Specifies an access key ID of VALUE that will be used, in conjunction with the secret key, to sign the request. This must be used in conjunction with --secret-key, otherwise the option will be ignored. All requests to CloudWatch must be signed, otherwise the request will be rejected.

Type: String

Valid values: A valid access key ID.

Default: None

-K, --ec2-private-key-file-path VALUE

Specifies a private key in the file VALUE that will be used to sign the request. Using public/private keys will cause the CLI to use SOAP. The request will be signed with a public certificate and private key. This parameter must be used in conjunction with EC2_CERT, otherwise the value will be ignored. The value of the environment variable EC2_PRIVATE_KEY will be used if it is set, and this option is not specified. This option is ignored if the environment variable AWS_CREDENTIAL_FILE is set, or --aws-credentials-file is used. All requests to CloudWatch must be signed, otherwise the request will be rejected.

Type: String

Valid values: The path to a valid ASN.1 private key.

Default: None

--region VALUE

Specifies which region requests are directed to. You can use the environment variable EC2_REGION to specify the value. The region is used to create the URL used to call CloudWatch, and must be a valid Amazon Web Services (AWS) region.

Type: String

Valid values: Any AWS region, for example, us-east-1.

Default: us-east-1, unless the EC2_REGION environment variable is set.

S, --secret-key VALUE

Specify a secret key of VALUE that will be used, in conjunction with an access key ID, to sign the request. This must be used in conjunction with the --access-key-id, otherwise this option will be ignored.

Type: String

Valid values: Your access key ID.

Default: None

--show-empty-fields

Show empty fields using (nil) as a placeholder to indicate that this data was not requested.

Type: Flag

Valid values: None

Default: Empty fields are not shown by default.

--show-request

Displays the URL the CLI uses to call AWS.

Type: Flag

Valid values: None

Default: false

--show-table, --show-long, --show-xml, --quiet

Specify how the results are displayed: in a table, delimited (long), XML, or no output (quiet). The --show-table display shows a subset of the data in fixed column-width form; --show-long shows all of the returned values delimited by a character; --show-xml is the raw return from the service; and --quiet suppresses all standard output. All options are mutually exclusive, with the priority --show-table, --show-long, --show-xml, and -–quiet.

Type: Flag

Valid values: None

Default: --show-table

-U, --url VALUE

Specifies the URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUDWATCH_URL. This value will be used in conjunction with --region to create the expected URL. This option will override the URL for the service call with VALUE.

Type: String

Valid values: A valid HTTP or HTTPS URL.

Default: Uses the value specified in AWS_CLOUDWATCH_URL, if set.

Output

This command returns a table that contains the following:

  • ALARM - Alarm name.

  • DESCRIPTION - Alarm description. This column appears only in the --show-long view.

  • STATE - Alarm state.

  • STATE_REASON - Human readable reason for state. This column appears only in the --show-long view.

  • STATE_REASON_DATA - Machine readable reason for state (JSON format). This column appears only in the --show-long view.

  • ENABLED - Actions enabled or not. This column appears only in the --show-long view.

  • OK_ACTIONS - Action to execute on OK status. This column appears only in the --show-long view.

  • ALARM_ACTIONS - Action to execute on ALARM status.

  • INSUFFICIENT_DATA_ACTIONS - Action to execute on INSUFFICIENT_DATA status. This column appears only in the --show-long view.

  • NAMESPACE - Namespace for metric.

  • METRIC_NAME - Metric name.

  • DIMENSIONS - Dimensions. This column appears only in the --show-long view.

  • PERIOD - Period.

  • STATISTIC - Statistic.

  • UNIT - Unit. This column appears only in the --show-long view.

  • EVAL_PERIODS - Number of periods for which metric will be evaluated.

  • COMPARISON - Comparison operator.

  • THRESHOLD - Threshold.

The Amazon CloudWatch CLI displays errors on stderr.

Examples

Example Request

This example describes all of your alarms whose name starts with my-alarm.

PROMPT> mon-describe-alarms --alarm-name-prefix my-alarm --headers 
This is an example output of this command.                       
                      
ALARM      STATE ALARM_ACTIONS  NAMESPACE  METRIC_NAME    PERIOD  STATISTIC  EVAL_PERIODS  COMPARISON            THRESHOLD
my-alarm1  OK    arn:aws:sns:.. AWS/EC2    CPUUtilization 60      Average    3             GreaterThanThreshold  100.0
my-alarm2  OK    arn:aws:sns:.. AWS/EC2    CPUUtilization 60      Average    5            
GreaterThanThreshold  80o.0