Skip to content

cloudwatch describe-alarm

Describe cloudwatch alarms

Description

show details about cloudwatch alarms

Synopsis

cloudwatch describe-alarm
    [--site <site>]
    [--region <region>]
    [<names>]
    [--action_prefix <action_prefix>]
    [--name_prefix <name_prefix>]
    [--state <state>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

region - (string)

     AWS region for the service
     Example: --region "region-1"
     Default: _None_      Attributes: optional

names - (string)

     Specific alarm names to look for
     Example: "names-1"
     Default: _None_      Attributes: optional, multiple allowed

action_prefix - (string)

     To only filter those alarms that use a certain alarm action
     Example: --action_prefix "action_prefix-1"
     Default: _None_      Attributes: optional

name_prefix - (string)

     Prefix for the alarm name
     Example: --name_prefix "name_prefix-1"
     Default: _None_      Attributes: optional

state - (string)

     Filter alarms that are currently in the specified state
     Example: --state "state-1"
     Default: _None_      Attributes: optional

Examples

Input:

x=! cloudwatch describe-alarm
Output:
[
  {
    "name": "awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization",
    "description": "Created from EC2 Console",
    "arn": "arn:aws:cloudwatch:us-east-1:248495481387:alarm:awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization",
    "state_value": "ALARM",
    "threshold": 0.001,
    "state_reason": "Threshold Crossed: 2 datapoints [0.099453551912591 (03/10/22 19:13:00), 0.10171439703875258 (03/10/22 19:08:00)] were greater than or equal to the threshold (0.001)."
  },
  {
    "name": "awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization2",
    "description": "Created from EC2 Console",
    "arn": "arn:aws:cloudwatch:us-east-1:248495481387:alarm:awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization2",
    "state_value": "ALARM",
    "threshold": 0.0001,
    "state_reason": "Threshold Crossed: 1 datapoint [0.099453551912572 (27/09/22 12:10:00)] was greater than or equal to the threshold (1.0E-4)."
  },
  {
    "name": "awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization4",
    "description": "Created from EC2 Console",
    "arn": "arn:aws:cloudwatch:us-east-1:248495481387:alarm:awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization4",
    "state_value": "ALARM",
    "threshold": 0.001,
    "state_reason": "Threshold Crossed: 1 datapoint [0.0672316384180944 (27/09/22 12:30:00)] was greater than or equal to the threshold (0.001)."
  },
  {
    "name": "awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization5",
    "description": "Created from EC2 Console",
    "arn": "arn:aws:cloudwatch:us-east-1:248495481387:alarm:awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization5",
    "state_value": "ALARM",
    "threshold": 0.001,
    "state_reason": "Threshold Crossed: 1 datapoint [0.066666666666663 (27/09/22 17:33:00)] was greater than or equal to the threshold (0.001)."
  }
]
Input:
! cloudwatch describe-alarm
Output:
NAME                                                                            STATE   THRESHOLD 
awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization         ALARM       0.001
awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization2        ALARM      0.0001
awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization4        ALARM       0.001
awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-CPUUtilization5        ALARM       0.001
awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-DiskReadOps            OK           0.99
awsec2-i-0bc9464a6e9ba87b5-GreaterThanOrEqualToThreshold-DiskWriteBytes         OK           0.99

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "cloudwatch"
Service Instance
Namespace
Object Type "alarm"
Object ID

Please see Access Control for details.