Alarms
GETs (Reading Data)
Resource | Description |
---|---|
|
Get a list of alarms. |
|
Get the number of alarms. (Returns plaintext, rather than XML or JSON.) |
|
Get the alarms specified by the given ID. |
Note that you can also query by severity, like so:
Resource | Description |
---|---|
|
Get the alarms with a severity greater than or equal to MINOR. |
PUTs (Modifying Data)
PUT requires form data using application/x-www-form-urlencoded as a Content-Type.
Resource | Description |
---|---|
|
Acknowledges (or unacknowledges) an alarm. |
|
Acknowledges (or unacknowledges) alarms matching the additional query parameters. e.g., |
|
Clears an alarm. |
|
Escalates an alarm (for example, NORMAL → MINOR, MAJOR → CRITICAL) |
|
Clears alarms matching the additional query parameters. |
|
Escalates alarms matching the additional query parameters. |
Additionally, when acknowledging alarms (ack=true) you can specify an ackUser
parameter.
You will only be allowed to ack
as a different user IF you are PUTting as an authenticated user who is in the admin role.
v2 API
Since Horizon 20.1.0, an alarms endpoint has been available in the v2 API that uses FIQL for querying.
Examples:
-
/api/v2/alarms?_s=alarm.reductionKey==uei.opennms.org/nodes/nodeDown::*
-
/api/v2/alarms?_s=alarm.uei==uei.opennms.org/nodes/nodeDown
-
/api/v2/alarms?_s=alarm.ipAddr==127.0.0.1
-
/api/v2/alarms?_s=node.label==localhost
If your query string includes a FIQL reserved character like a comma (,) or a semicolon (;) you need to double percent-escape it. |
Suppose you have a service with a comma in the name, like COMMA,SERVICE
and you want to retrieve all the alarms for its failure.
Your query would look like /api/v2/alarms?_s=alarm.reductionKey==uei.opennms.org/nodes/nodeLostService::*:COMMA%252CSERVICE
.