Create an alarm from a DC 09 alarm
In this tutorial, you will learn how to create an OnSphere alarm from a DC 09 alarm.
Create an action of type
CREATE_ALARMthat will be called when a matching DC09 event arrives.Configure an IP-RCT server to receive forwarded alarms from the DC09 gateway.
Define an IP-RCT device matching a specific transmitter identifier.
Create a
FIRE_AND_FORGETtextual value with an alarm owner that matches NFA alarm codes and links to the action.
git checkout origin/osp-alarms-configuration .
git checkout origin/osp-web-configuration .
git checkout origin/osp-ip-rct-configuration .
git checkout origin/example-alarms-created-from-dc09 .
Prerequisites
Logical schema
Configuration structure
Steps
1. Create an action that can create an alarm
root/alarms/dc09-alarm/action/action.ospp
{
"moduleId": ["modules.ip-rct.ip-rct-1"],
"type": "CREATE_ALARM"
}
2. Create a server that will communicate with the DC09 gateway dc09.gateway.local
root/alarms/dc09-alarm/gateway/value.ospp
{
"name": "DC09 Gateway",
"description": "",
"type": "BOOLEAN"
}
root/alarms/dc09-alarm/gateway/server.ip-rct
{
"moduleId": "modules.ip-rct.ip-rct-1",
"hostname": "dc09.gateway.local",
"port": 8080,
"username": "ae-osp-user",
"passwordProvider": {
"type": "PLAINTEXT",
"password": "ae-osp-password"
},
"aeIdentifier": "ae-osp"
}
3. Create a device that will match the transmitter D00001
root/alarms/dc09-alarm/device/value.ospp
{
"name": "DC09 alarm transmitter",
"description": "",
"type": "BOOLEAN"
}
root/alarms/dc09-alarm/device/device.ip-rct
{
"linkedServer": "root.alarms.dc09-alarm.gateway",
"ipSptIdentifier": "D00001"
}
4. Create a textual value with FIRE_AND_FORGET retention so the value will be treated as an event instead of a state
root/alarms/dc09-alarm/alarm/value.ospp
{
"name": "Fire alarm",
"description": "",
"type": "TEXT",
"retention": "FIRE_AND_FORGET"
}
5. Create an alarm owner next to the textual value that will match NFAxxxx alarms coming from the D00001 transmitter, and link it to the action created earlier
root/alarms/dc09-alarm/alarm/owner-alarm.ip-rct
{
"linkedDevice": "root.alarms.dc09-alarm.device",
"alarmTypes": [
"ALARM"
],
"criteriaExpression": "^NFA\\d{4}$",
"linkedAction": {
"actionId": "root.alarms.dc09-alarm.action",
"expiration": {
"value": 4,
"unit": "SECONDS"
},
"parameters": {
"timestamp": {
"type": "FIELD",
"field": "TIMESTAMP"
},
"severity": {
"type": "CONSTANT",
"value": 600
},
"summary": {
"type": "CONSTANT",
"value": "Fire alarm"
},
"location": {
"type": "FIELD",
"field": "CONTENT",
"fieldParser": "spt.locationAddress"
},
"source": {
"type": "FIELD",
"field": "CONTENT",
"fieldParser": "spt.name"
},
"serial": {
"type": "FIELD",
"field": "ID"
},
"tags": {
"type": "LIST",
"values": [
{
"type": "CONSTANT",
"value": "DC09"
}
]
},
"additionalData": {
"type": "PROPERTIES",
"properties": {
"transmitter": {
"type": "FIELD",
"field": "CONTENT",
"fieldParser": "spt.sptIdentifier"
}
}
}
}
}
}