mon-describe-alarm-history - Amazon CloudWatch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

mon-describe-alarm-history

Description

Retrieves the history for the specified alarm. You can filter alarms by date range or item type. If you don't specify an alarm name, Amazon CloudWatch returns histories for all of your alarms.

Note

Amazon CloudWatch retains the history of active and deleted alarms for two weeks.

Syntax

mon-describe-alarm-history [AlarmNames [AlarmNames ...]] [--end-date value] [--history-item-type value] [--start-date value] [Common Options]

Options

Name Description

AlarmName AlarmNames

The names of the alarms, separated by spaces. If you don't specify an alarm name, this command returns the histories of all your alarms. You can also set this value using --alarm-name.

Type: Argument

Valid values: Any string between 1 and 255 characters in length.

Default: n/a

Required: No

--end-date VALUE

The end of the date range for history.

Type: Date

Valid values: Date in YYYY-MM-DD format.

Default: The current date.

Required: No

--history-item-type VALUE

The type of history items to retrieve. By default, all types are returned.

Type: Enumeration

Valid values: ConfigurationUpdate, StateUpdate, or Action

Default: All types are returned.

Required: No

--start-date VALUE

The start of the date range for history. By default it extends to all available history.

Type: Date

Valid values: Date in YYYY-MM-DD format.

Default: All available history.

Required: No

Common options

Name Description

--aws-credential-file VALUE

The location of the file with your Amazon credentials. You can set this value 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 fails. 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

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 Amazon Identity and Access Management.

Default: Uses the environment variable EC2_CERT, if set.

--connection-timeout VALUE

The connection timeout value, in seconds.

Type: Integer

Valid values: Any positive number.

Default: 30

--delimiter VALUE

The 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, include the column headers. If you are showing XML results, return 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

The access key ID 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 is ignored. All requests to CloudWatch must be signed, otherwise the request is rejected.

Type: String

Valid values: A valid access key ID.

Default: None

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

The private key that will be used to sign the request. Using public/private keys causes the CLI to use SOAP. The request is signed with a public certificate and private key. This parameter must be used in conjunction with EC2_CERT, otherwise the value is 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 is rejected.

Type: String

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

Default: None

--region VALUE

The 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 (Amazon) region.

Type: String

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

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

S, --secret-key VALUE

The secret access key that will be used to sign the request, in conjunction with an access key ID. This parameter must be used in conjunction with --access-key-id, otherwise this option is ignored.

Type: String

Valid values: Your access key ID.

Default: None

--show-empty-fields

Shows 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 Amazon.

Type: Flag

Valid values: None

Default: false

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

Specifies 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

The URL used to contact CloudWatch. You can set this value using the environment variable AWS_CLOUDWATCH_URL. This value is used in conjunction with --region to create the expected URL. This option overrides the URL for the service call.

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 - The alarm name.

  • TIMESTAMP - The timestamp.

  • TYPE - The type of event, one of ConfigurationUpdate, StateUpdate and Action.

  • SUMMARY - A human-readable summary of history event.

  • DATA - Detailed data about the event in machine-readable JSON format. This column appears only in the --show-long view.

The Amazon CloudWatch CLI displays errors on stderr.

Examples

Example request

This example describes all history items for the alarm my-alarm.

mon-describe-alarm-history--alarm-name my-alarm --headers

This is an example output of this command.

ALARM TIMESTAMP TYPE SUMMARY my-alarm 2013-05-07T18:46:16.121Z Action Published a notification to arn:aws:sns:... my-alarm 2013-05-07T18:46:16.118Z StateUpdate Alarm updated from INSUFFICIENT_DATA to OK my-alarm 2013-05-07T18:46:07.362Z ConfigurationUpdate Alarm "my-alarm" created

Related topics

Download

Related action

Related commands