Chapter 6. alarm


This chapter describes the commands under the alarm command.

6.1. alarm create

Create an alarm

Usage:

openstack alarm create [-h] [-f {json,shell,table,value,yaml}]
                              [-c COLUMN] [--max-width <integer>]
                              [--fit-width] [--print-empty] [--noindent]
                              [--prefix PREFIX] --name <NAME> -t <TYPE>
                              [--project-id <PROJECT_ID>]
                              [--user-id <USER_ID>]
                              [--description <DESCRIPTION>] [--state <STATE>]
                              [--severity <SEVERITY>] [--enabled {True|False}]
                              [--alarm-action <Webhook URL>]
                              [--ok-action <Webhook URL>]
                              [--insufficient-data-action <Webhook URL>]
                              [--time-constraint <Time Constraint>]
                              [--repeat-actions {True|False}]
                              [--query <QUERY>]
                              [--comparison-operator <OPERATOR>]
                              [--evaluation-periods <EVAL_PERIODS>]
                              [--threshold <THRESHOLD>] [--metric <METRIC>]
                              [--event-type <EVENT_TYPE>]
                              [--granularity <GRANULARITY>]
                              [--aggregation-method <AGGR_METHOD>]
                              [--resource-type <RESOURCE_TYPE>]
                              [--resource-id <RESOURCE_ID>]
                              [--metrics <METRICS>]
                              [--composite-rule <COMPOSITE_RULE>]

Table 6.1. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.2. Output Formatters
ValueSummary

output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

Table 6.3. common gnocchi alarm rules
ValueSummary

--aggregation-method <AGGR_METHOD>

The aggregation_method to compare to the threshold.

--granularity <GRANULARITY>

The time range in seconds over which to query.

Table 6.4. event alarm
ValueSummary

--event-type <EVENT_TYPE>

Event type to evaluate against

Table 6.5. gnocchi resource threshold alarm
ValueSummary

--resource-id <RESOURCE_ID>

The id of a resource.

--resource-type <RESOURCE_TYPE>

The type of resource.

Table 6.6. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.7. composite alarm
ValueSummary

--composite-rule <COMPOSITE_RULE>

Composite threshold rule with json format, the form can be a nested dict which combine gnocchi rules by "and", "or". For example, the form is like: {"or":[RULE1, RULE2, {"and": [RULE3, RULE4]}]}.

Table 6.8. Optional Arguments
ValueSummary

--ok-action <Webhook URL>

Url to invoke when state transitions to ok. may be used multiple times

--user-id <USER_ID>

User to associate with alarm (configurable by admin users only)

--name <NAME>

Name of the alarm

-t <TYPE>, --type <TYPE>

Type of alarm, should be one of: event, composite, gnocchi_resources_threshold, gnocchi_aggregation_by_metrics_threshold, gnocchi_aggregation_by_resources_threshold.

--repeat-actions {True

False}

True if actions should be repeatedly notified while alarm remains in target state

--state <STATE>

State of the alarm, one of: [ok, alarm, insufficient data]

--time-constraint <Time Constraint>

Only evaluate the alarm if the time at evaluation is within this time constraint. Start point(s) of the constraint are specified with a cron expression, whereas its duration is given in seconds. Can be specified multiple times for multiple time constraints, format is: name=<CONSTRAINT_NAME>;start=< CRON>;duration=<SECONDS>;[description=<DESCRIPTION>;[t imezone=<IANA Timezone>]]

--project-id <PROJECT_ID>

Project to associate with alarm (configurable by admin users only)

--insufficient-data-action <Webhook URL>

Url to invoke when state transitions to insufficient data. May be used multiple times

--severity <SEVERITY>

Severity of the alarm, one of: [low, moderate, critical]

--alarm-action <Webhook URL>

Url to invoke when state transitions to alarm. may be used multiple times

-h, --help

Show this help message and exit

--description <DESCRIPTION>

Free text description of the alarm

--enabled {True

False}

True if alarm evaluation is enabled

Table 6.9. common alarm rules
ValueSummary

--evaluation-periods <EVAL_PERIODS>

Number of periods to evaluate over

--query <QUERY>

For alarms of type event: key[op]data_type::value; list. data_type is optional, but if supplied must be string, integer, float, or boolean. For alarms of type gnocchi_aggregation_by_resources_threshold: need to specify a complex query json string, like: {"and": [{"=": {"ended_at": null}}, …​]}.

--comparison-operator <OPERATOR>

Operator to compare with, one of: [lt, le, eq, ne, ge, gt]

--metric <METRIC>

Metric to evaluate against.

--threshold <THRESHOLD>

Threshold to evaluate against.

Table 6.10. gnocchi aggregation by metrics alarm
ValueSummary

--metrics <METRICS>

The list of metric ids.

Table 6.11. Shell Formatter
ValueSummary

a format a UNIX shell can parse (variable="value")--prefix PREFIX

Add a prefix to all variable names

6.2. alarm delete

Delete an alarm

Usage:

openstack alarm delete [-h] [--name <NAME>] [<ALARM ID or NAME>]

Table 6.12. Positional Arguments
ValueSummary

<ALARM ID or NAME>

Id or name of an alarm.

Table 6.13. Optional Arguments
ValueSummary

--name <NAME>

Name of the alarm

-h, --help

Show this help message and exit

6.4. alarm-history show

Show history for an alarm

Usage:

openstack alarm-history show [-h] [-f {csv,json,table,value,yaml}]
                                    [-c COLUMN] [--max-width <integer>]
                                    [--fit-width] [--print-empty] [--noindent]
                                    [--quote {all,minimal,none,nonnumeric}]
                                    [--sort-column SORT_COLUMN]
                                    [--limit <LIMIT>] [--marker <MARKER>]
                                    [--sort <SORT_KEY:SORT_DIR>]
                                    alarm_id

Table 6.19. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.20. Positional Arguments
ValueSummary

alarm_id

Id of an alarm

Table 6.21. CSV Formatter
ValueSummary

--quote {all,minimal,none,nonnumeric}

When to include quotes, defaults to nonnumeric

Table 6.22. Output Formatters
ValueSummary

output formatter options-f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

--sort-column SORT_COLUMN

Specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

Table 6.23. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.24. Optional Arguments
ValueSummary

--sort <SORT_KEY:SORT_DIR>

Sort of resource attribute. e.g. timestamp:desc

--limit <LIMIT>

Number of resources to return (default is server default)

-h, --help

Show this help message and exit

--marker <MARKER>

Last item of the previous listing. return the next results after this value,the supported marker is event_id.

6.5. alarm list

List alarms

Usage:

openstack alarm list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
                            [--max-width <integer>] [--fit-width]
                            [--print-empty] [--noindent]
                            [--quote {all,minimal,none,nonnumeric}]
                            [--sort-column SORT_COLUMN]
                            [--query QUERY | --filter <KEY1=VALUE1;KEY2=VALUE2...>]
                            [--limit <LIMIT>] [--marker <MARKER>]
                            [--sort <SORT_KEY:SORT_DIR>]

Table 6.25. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.26. CSV Formatter
ValueSummary

--quote {all,minimal,none,nonnumeric}

When to include quotes, defaults to nonnumeric

Table 6.27. Output Formatters
ValueSummary

output formatter options-f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

--sort-column SORT_COLUMN

Specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

Table 6.28. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.29. Optional Arguments
ValueSummary

--sort <SORT_KEY:SORT_DIR>

Sort of resource attribute, e.g. name:asc

--filter <KEY1=VALUE1;KEY2=VALUE2…​>

Filter parameters to apply on returned alarms.

--query QUERY

Rich query supported by aodh, e.g. project_id!=my-id user_id=foo or user_id=bar

--marker <MARKER>

Last item of the previous listing. return the next results after this value,the supported marker is alarm_id.

--limit <LIMIT>

Number of resources to return (default is server default)

-h, --help

Show this help message and exit

6.6. alarm show

Show an alarm

Usage:

openstack alarm show [-h] [-f {json,shell,table,value,yaml}]
                            [-c COLUMN] [--max-width <integer>] [--fit-width]
                            [--print-empty] [--noindent] [--prefix PREFIX]
                            [--name <NAME>]
                            [<ALARM ID or NAME>]

Table 6.30. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.31. Positional Arguments
ValueSummary

<ALARM ID or NAME>

Id or name of an alarm.

Table 6.32. Output Formatters
ValueSummary

output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

Table 6.33. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.34. Optional Arguments
ValueSummary

--name <NAME>

Name of the alarm

-h, --help

Show this help message and exit

Table 6.35. Shell Formatter
ValueSummary

a format a UNIX shell can parse (variable="value")--prefix PREFIX

Add a prefix to all variable names

6.7. alarm state get

Get state of an alarm

Usage:

openstack alarm state get [-h] [-f {json,shell,table,value,yaml}]
                                 [-c COLUMN] [--max-width <integer>]
                                 [--fit-width] [--print-empty] [--noindent]
                                 [--prefix PREFIX] [--name <NAME>]
                                 [<ALARM ID or NAME>]

Table 6.36. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.37. Positional Arguments
ValueSummary

<ALARM ID or NAME>

Id or name of an alarm.

Table 6.38. Output Formatters
ValueSummary

output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

Table 6.39. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.40. Optional Arguments
ValueSummary

--name <NAME>

Name of the alarm

-h, --help

Show this help message and exit

Table 6.41. Shell Formatter
ValueSummary

a format a UNIX shell can parse (variable="value")--prefix PREFIX

Add a prefix to all variable names

6.8. alarm state set

Set state of an alarm

Usage:

openstack alarm state set [-h] [-f {json,shell,table,value,yaml}]
                                 [-c COLUMN] [--max-width <integer>]
                                 [--fit-width] [--print-empty] [--noindent]
                                 [--prefix PREFIX] [--name <NAME>] --state
                                 <STATE>
                                 [<ALARM ID or NAME>]

Table 6.42. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.43. Positional Arguments
ValueSummary

<ALARM ID or NAME>

Id or name of an alarm.

Table 6.44. Output Formatters
ValueSummary

output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

Table 6.45. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.46. Optional Arguments
ValueSummary

--name <NAME>

Name of the alarm

-h, --help

Show this help message and exit

--state <STATE>

State of the alarm, one of: [ok, alarm, insufficient data]

Table 6.47. Shell Formatter
ValueSummary

a format a UNIX shell can parse (variable="value")--prefix PREFIX

Add a prefix to all variable names

6.9. alarm update

Update an alarm

Usage:

openstack alarm update [-h] [-f {json,shell,table,value,yaml}]
                              [-c COLUMN] [--max-width <integer>]
                              [--fit-width] [--print-empty] [--noindent]
                              [--prefix PREFIX] [--name <NAME>] [-t <TYPE>]
                              [--project-id <PROJECT_ID>]
                              [--user-id <USER_ID>]
                              [--description <DESCRIPTION>] [--state <STATE>]
                              [--severity <SEVERITY>] [--enabled {True|False}]
                              [--alarm-action <Webhook URL>]
                              [--ok-action <Webhook URL>]
                              [--insufficient-data-action <Webhook URL>]
                              [--time-constraint <Time Constraint>]
                              [--repeat-actions {True|False}]
                              [--query <QUERY>]
                              [--comparison-operator <OPERATOR>]
                              [--evaluation-periods <EVAL_PERIODS>]
                              [--threshold <THRESHOLD>] [--metric <METRIC>]
                              [--event-type <EVENT_TYPE>]
                              [--granularity <GRANULARITY>]
                              [--aggregation-method <AGGR_METHOD>]
                              [--resource-type <RESOURCE_TYPE>]
                              [--resource-id <RESOURCE_ID>]
                              [--metrics <METRICS>]
                              [--composite-rule <COMPOSITE_RULE>]
                              [<ALARM ID or NAME>]

Table 6.48. Table Formatter
ValueSummary

--print-empty

Print empty table if there is no data to show.

--max-width <integer>

Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence.

--fit-width

Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable

Table 6.49. Positional Arguments
ValueSummary

<ALARM ID or NAME>

Id or name of an alarm.

Table 6.50. Output Formatters
ValueSummary

output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

The output format, defaults to table

-c COLUMN, --column COLUMN

Specify the column(s) to include, can be repeated

Table 6.51. common gnocchi alarm rules
ValueSummary

--aggregation-method <AGGR_METHOD>

The aggregation_method to compare to the threshold.

--granularity <GRANULARITY>

The time range in seconds over which to query.

Table 6.52. event alarm
ValueSummary

--event-type <EVENT_TYPE>

Event type to evaluate against

Table 6.53. gnocchi resource threshold alarm
ValueSummary

--resource-id <RESOURCE_ID>

The id of a resource.

--resource-type <RESOURCE_TYPE>

The type of resource.

Table 6.54. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Table 6.55. composite alarm
ValueSummary

--composite-rule <COMPOSITE_RULE>

Composite threshold rule with json format, the form can be a nested dict which combine gnocchi rules by "and", "or". For example, the form is like: {"or":[RULE1, RULE2, {"and": [RULE3, RULE4]}]}.

Table 6.56. Optional Arguments
ValueSummary

--ok-action <Webhook URL>

Url to invoke when state transitions to ok. may be used multiple times

--user-id <USER_ID>

User to associate with alarm (configurable by admin users only)

--name <NAME>

Name of the alarm

-t <TYPE>, --type <TYPE>

Type of alarm, should be one of: event, composite, gnocchi_resources_threshold, gnocchi_aggregation_by_metrics_threshold, gnocchi_aggregation_by_resources_threshold.

--repeat-actions {True

False}

True if actions should be repeatedly notified while alarm remains in target state

--state <STATE>

State of the alarm, one of: [ok, alarm, insufficient data]

--time-constraint <Time Constraint>

Only evaluate the alarm if the time at evaluation is within this time constraint. Start point(s) of the constraint are specified with a cron expression, whereas its duration is given in seconds. Can be specified multiple times for multiple time constraints, format is: name=<CONSTRAINT_NAME>;start=< CRON>;duration=<SECONDS>;[description=<DESCRIPTION>;[t imezone=<IANA Timezone>]]

--project-id <PROJECT_ID>

Project to associate with alarm (configurable by admin users only)

--insufficient-data-action <Webhook URL>

Url to invoke when state transitions to insufficient data. May be used multiple times

--severity <SEVERITY>

Severity of the alarm, one of: [low, moderate, critical]

--alarm-action <Webhook URL>

Url to invoke when state transitions to alarm. may be used multiple times

-h, --help

Show this help message and exit

--description <DESCRIPTION>

Free text description of the alarm

--enabled {True

False}

True if alarm evaluation is enabled

Table 6.57. common alarm rules
ValueSummary

--evaluation-periods <EVAL_PERIODS>

Number of periods to evaluate over

--query <QUERY>

For alarms of type event: key[op]data_type::value; list. data_type is optional, but if supplied must be string, integer, float, or boolean. For alarms of type gnocchi_aggregation_by_resources_threshold: need to specify a complex query json string, like: {"and": [{"=": {"ended_at": null}}, …​]}.

--comparison-operator <OPERATOR>

Operator to compare with, one of: [lt, le, eq, ne, ge, gt]

--metric <METRIC>

Metric to evaluate against.

--threshold <THRESHOLD>

Threshold to evaluate against.

Table 6.58. gnocchi aggregation by metrics alarm
ValueSummary

--metrics <METRICS>

The list of metric ids.

Table 6.59. Shell Formatter
ValueSummary

a format a UNIX shell can parse (variable="value")--prefix PREFIX

Add a prefix to all variable names

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.