Provision a new node 'n1' using the Quick Add workflow.
Create a link between 'localhost' and 'n1' with a POST to /api/v2/userdefinedlinks
{
"node-id-a": 1,
"node-id-z": 2,
"component-label-a": "port-a",
"component-label-z": "port-z",
"link-id": "localhost:port-a->n1:port-z",
"owner": "me"
}
View the relation in topology.
Create an alarm on n1 with a POST to /api/v2/events
:
{
"uei": "uei.opennms.org/alarms/trigger",
"nodeid": 2,
"parms": [
{"parmName": "node", "value": "sometimes"},
{"parmName": "ip", "value": "things"},
{"parmName": "service", "value": "fail"}
],
"severity": "minor"
}
Create an alarm on localhost with a POST to /api/v2/events
:
{
"uei": "uei.opennms.org/alarms/trigger",
"nodeid": 1,
"parms": [
{"parmName": "node", "value": "sometimes"},
{"parmName": "ip", "value": "things"},
{"parmName": "service", "value": "break"}
],
"severity": "major"
}
See if the situation was created.
Alternative create it manually with with a POST to /api/v2/events
{
"uei": "uei.opennms.org/alarms/situation",
"parms": [
{"parmName": "related-reductionKey", "value": "uei.opennms.org/alarms/trigger:sometimes:things:fail"},
{"parmName": "related-reductionKey", "value": "uei.opennms.org/alarms/trigger:sometimes:things:break"}
]
}
In Grafana, create a new panel with Data Source OpenNMS Entities
and the Alarm Table
visualization with query SELECT Alarms WHERE isSituation = true OR isInSituation = false
.
Add Situation Alarm Count
as a column.