Alarm filters can be created to extract specific data from an overall alarm list. To do this, you can first create the filter using any of the following options shown. Each option corresponds to a given field found in any entry in the alarm history, so be sure to use the same format when specifying the variables.
Step 1: First create the desired filter using the following command and options. Be sure to specify that the filter source is the alarm-history as other sources like the active-alarms can also be used.
create alarm-filter <filter-name> filter source alarm-history [options]
Example:
RLS# create alarm-filter TestFilter filter
alarm-state cause-list clear-time clear-time-range condition-type count
direction has-additional-info has-user-notes history-id history-id-range id
id-range last location name-list order raise-time
raise-time-range resource-list service-impact severity-list source time
time-range update-reason
RLS# create alarm-filter "Last5Major" filter source alarm-history severity-list major count 5
Step 2: Verify that your filter was created, and has the desired settings with the following command.
show alarm-filter <filter-name>
Example:
RLS# show alarm-filter
alarm-filter:
- filter-name : Last5Major
filter:
source : alarm-history
severity-list : major
count : 5
- filter-name : Last5Critical
filter:
source : alarm-history
severity-list : critical
Step 3: Run the filter in CLI to output the desired data using the following command.
filtered-alarms filter-name <filter-name>
Example:
RLS# filtered-alarms filter-name Last5Major
filtered-alarms output
+------------------------+
| Name | Value |
+------------------------+
| status | ok |
+------------------------+
filtered-alarms output history-alarms
+---------------------------------------------------------------------------------------------------------------------------------+
| history-id | update-reason | history-time | id | name | resource | raise-time +
+---------------------------------------------------------------------------------------------------------------------------------+
| 4441 | alarm-clear | 2022-10-30T11:26:57Z | 2179 | Intrusion Attempt | ciena-6500r-shelves:shelf | 2022-10-30T11:11:57Z +
| 4448 | alarm-raise | 2022-11-02T06:41:56Z | 2183 | Intrusion Attempt | ciena-6500r-shelves:shelf | 2022-11-02T06:41:56Z +
| 4449 | alarm-clear | 2022-11-02T06:56:56Z | 2183 | Intrusion Attempt | ciena-6500r-shelves:shelf | 2022-11-02T06:41:56Z +
| 4454 | alarm-raise | 2022-11-04T11:11:53Z | 2186 | Intrusion Attempt | ciena-6500r-shelves:shelf | 2022-11-04T11:11:53Z +
| 4455 | alarm-clear | 2022-11-04T11:26:54Z | 2186 | Intrusion Attempt | ciena-6500r-shelves:shelf | 2022-11-04T11:11:53Z +
+---------------------------------------------------------------------------------------------------------------------------------+