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

@startuml
skinparam backgroundColor transparent

node spt as "SP"
node rct as "RCT"
node osprct as "osp-ip-rct"
node ospalarms as "osp-alarms"

spt -[#black]> rct : <size:11><color:black>  **Send alarm**
rct -[#black]d-> osprct : <size:11><color:black>  **Forward alarm**
osprct -[#black]d-> ospalarms : <size:11><color:black>  **create alarm**
ospalarms -[#black]d-> alarms : <size:11><color:black>  **The alarm is dispatched**

@enduml

Configuration structure

{
@startuml
skinparam backgroundColor transparent
package "root/.../gateway" {
    [server.ip-rct] as server
}

package "root/.../device" {
    [device.ip-rct] as device
}

package "root/.../alarm" {
    [owner-alarm.ip-rct] as alarm
}

package "root/.../action" {
    [action.ospp] as action
}

node ospscripts as "osp-ip-rct"
node ospalarms as "osp-alarms"

ospscripts -[#black]> server : <size:11><color:black> **forwards**
server -[#black]d-> device : <size:11><color:black> **dispatches**
device -[#black]d-> alarm : <size:11><color:black> **dispatches**
alarm -[#dodgerblue]d-> action : <size:11><color:dodgerblue> **executes**
action -[#firebrick]r-> ospalarms : <size:11><color:firebrick> **Create alarm**
@enduml
}

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"
}