Create an alarm from a DC 09 alarm¶
Prerequisites¶
git checkout origin/osp-alarms-web-configuration .
git checkout origin/osp-ip-rct-configuration .
Description¶
In this tutorial, you will learn how to create an OnSphere alarm from a DC 09 alarm.
The alarm will be created from DC 09 alarms :
with code
NFAxxxx
emitted from device
D00001
received from a DC-09 gateway hosted at
dc09.gateway.local
Some of the alarm fields will be extracted from the DC-09 payload while others will be hardcoded.
The use of an action (using the osp-ip-rct
linked action functionality) allows the DC-09 alarm sender to be notified if the alarm could not be processed by the system in time (4 seconds in this case), so that it can try to send it again later.
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 dc03.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",
"alarmType": "ALARM",
"criteriaExpression": "^NFA\\d{4}$",
"linkedAction": {
"actionId": "root.alarms.dc09-alarm.action",
"expiration": {
"value": 4,
"unit": "SECONDS"
},
"parameters": {
"timestamp": {
"field": "TIMESTAMP"
},
"severity": {
"value": 600
},
"summary": {
"value": "Fire alarm"
},
"location": {
"field": "CONTENT",
"fieldParser": "spt.locationAddress"
},
"source": {
"field": "CONTENT",
"fieldParser": "spt.name"
},
"serial": {
"field": "ID"
},
"tags": {
"values": [
{
"value": "DC09"
}
]
},
"additionalData": {
"properties": {
"transmitter": {
"field": "CONTENT",
"fieldParser": "spt.sptIdentifier"
}
}
}
}
}
}