activityForbiddenDatastream
DATASTREAM
ADVANCED
false
Activity detected for an entity with administrative state disabled
1 {
2 "active" : false ,
3 "description" : "Activity detected for an entity with administrative state disabled" ,
4 "javascript" : "var validAdministrativeStates = [\"ACTIVE\", \"TESTING\"],sourcesWithActivity = [\"DEVICE_TELNET\", \"DEVICE_FTP\", \"DEVICE_SNMP_TRAP\", \"DEVICE_SNMP_GET\", \"ROUTER_TELNET\", \"OPERATOR_RADIUS\"];if (isActivityForbidden(validAdministrativeStates)) {closeAlarmByAlarmName(null, \"activityForbidden\");openAlarm(null, \"activityForbidden\", \"activityForbidden\", \"INFORMATIVE\", \"LOW\", \"Activity detected for an entity with administrative state disabled\");}function isActivityForbidden(administrativeState) {var resourceType = entity.resourceType ? entity.resourceType._value._current.value : null,i = null;if (resourceType === 'entity.device') {administrativeState = entity['provision.device.administrativeState'] ? entity['provision.device.administrativeState']._value._current.value : null;} else if (resourceType === 'entity.asset') {administrativeState = entity['provision.asset.administrativeState'] ? entity['provision.asset.administrativeState']._value._current.value : null;} else if (resourceType === 'entity.subscriber') {administrativeState = entity['provision.device.communicationModules[].subscriber.administrativeState'] ? entity['provision.device.communicationModules[].subscriber.administrativeState'][0]._value._current.value : null;} else if (resourceType === 'entity.subscription') {administrativeState = entity['provision.device.communicationModules[].subscription.administrativeState'] ? entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._current.value : null;}if (administrativeState \u0026\u0026 !isIncludedValue(validAdministrativeStates, administrativeState)) {for (var key in entity) {if (key.startsWith(\"device\")) {if (key.indexOf(\"[]\") != -1) {for (var index in entity[key])if (entity[key][index]._value._received \u0026\u0026 entity[key][index]._value._current.source \u0026\u0026 isIncludedValue(sourcesWithActivity, entity[key][index]._value._current.source)) {return true;}} else {if (entity[key]._value._received \u0026\u0026 entity[key]._value._current.source \u0026\u0026 isIncludedValue(sourcesWithActivity, entity[key]._value._current.source)) {return true;}}}}}return false;}function isIncludedValue(validValues, currentValue) {for (var item in validValues)if (validValues[item] === currentValue) {return true;}return false;}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "activityForbiddenDatastream" ,
7 "type" : {
8 "name" : "DATASTREAM"
9 }
10 }
activityForbiddenOperation
OPERATION
ADVANCED
false
Activity detected for an entity with administrative state disabled
1 {
2 "active" : false ,
3 "description" : "Activity detected for an entity with administrative state disabled" ,
4 "javascript" : "var validAdministrativeStates = [\"ACTIVE\", \"TESTING\"],operationsWithActivity = [\"REFRESH_PRESENCE\"];if (isActivityForbidden(validAdministrativeStates)) {closeAlarmByAlarmName(null, \"activityForbidden\");openAlarm(null, \"activityForbidden\", \"activityForbidden\", \"INFORMATIVE\", \"LOW\", \"Activity detected for an entity with administrative state disabled\");}function isActivityForbidden(validAdministrativeStates) {var resourceType = entity.resourceType ? entity.resourceType._value._current.value : null,administrativeState = null;if (resourceType === 'entity.device') {administrativeState = entity['provision.device.administrativeState'] ? entity['provision.device.administrativeState']._value._current.value : null;} else if (resourceType === 'entity.asset') {administrativeState = entity['provision.asset.administrativeState'] ? entity['provision.asset.administrativeState']._value._current.value : null;} else if (resourceType === 'entity.subscriber') { administrativeState = entity['provision.device.communicationModules[].subscriber.administrativeState'] ? entity['provision.device.communicationModules[].subscriber.administrativeState'][0]._value._current.value : null; } else if (resourceType === 'entity.subscription') { administrativeState = entity['provision.device.communicationModules[].subscription.administrativeState'] ? entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._current.value : null; }if (administrativeState \u0026\u0026 !isIncludedValue(validAdministrativeStates, administrativeState)) {if (entity[\"operation.name\"] \u0026\u0026 isIncludedValue(operationsWithActivity, entity[\"operation.name\"]._value)) {if (entity[\"operation.error\"]._value) {return false;}return true;}}return false;}function isIncludedValue(validValues, currentValue) {for (var item in validValues)if (validValues[item] === currentValue) { return true; } return false;}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "activityForbiddenOperation" ,
7 "type" : {
8 "name" : "OPERATION" ,
9 "operationName" : "REFRESH_PRESENCE"
10 }
11 }
areaInputWithParameter
DATASTREAM
ADVANCED
false
Checks if an entity has entered in a geofence
1 {
2 "active" : false ,
3 "description" : "Checks if an entity has entered in a geofence" ,
4 "javascript" : "var locationData = entity[getVariableValue(parameterObject['datastream_location_name'])];\nvar areaParameter = getVariableValue(parameterObject['area']);\nif (locationData._value._received) {\n var areas = getAreas(locationData._value._current.value.position.coordinates);\n var extraParameter = getVariableValue(parameterObject['datastream_name']);\n var result = false;\n if (locationData._value._previous) {\n var areasPrev = getAreas(locationData._value._previous.value.position.coordinates);\n result = JSON.stringify(areas).indexOf(areaParameter) !== -1 \u0026\u0026 JSON.stringify(areasPrev).indexOf(areaParameter) === -1;\n } else {\n result = JSON.stringify(areas).indexOf(areaParameter) !== -1;\n }\n if (extraParameter !== '') {\n var data = entity[extraParameter];\n result = data._value._current \u0026\u0026 (result \u0026\u0026 data._value._current.value === getVariableValue(parameterObject['datastream_value']));\n }\n}\n\nif (result) {\n\n var notificationDescription = getVariableValue(parameterObject['notification_description']);\n var notificationSeverity = getVariableValue(parameterObject['notification_severity']);\n var notificationPriority = getVariableValue(parameterObject['notification_priority']);\n var snmp_recipients = getVariableValue(parameterObject['snmp_recipients']);\n var email_recipients = getVariableValue(parameterObject['email_recipients']);\n\n if (snmp_recipients.length \u003e 0) {\n\n var identifier = entity['provision.device.identifier'] ? entity['provision.device.identifier']._value._current.value : entity['provision.asset.identifier']._value._current.value;\n\n var trapVariables = {\n '1.1.1': entity['provision.administration.organization']._value._current.value,\n '1.1.2': entity['provision.administration.channel']._value._current.value,\n '1.1.3': identifier,\n '1.1.4': entity['provision.administration.serviceGroup']._value._current.value,\n '1.9.1': '' + ruleName + '',\n '1.9.2': 'areaInputWithParameter',\n '1.9.3': '' + notificationDescription + '',\n '1.9.4': '' + notificationPriority + '',\n '1.9.5': '' + notificationSeverity + '',\n '1.9.6': new Date().toISOString(),\n '1.9.14': 'entity.location',\n '1.9.15': areaParameter\n };\n var recipients = snmp_recipients.split(',');\n addTrapNotification(recipients, trapVariables, 'areaInputWithParameter', '1.100.3', '1.3.6.1.4.1.32784', ruleName);\n }\n\n if (email_recipients.length \u003e 0) {\n var mailParameters = {};\n var mailBody = notificationDescription;\n var recipients = email_recipients.split(',');\n addEmailNotification(recipients, ruleName, mailBody, ruleName, mailParameters);\n }\n\n openAlarm(null, ruleName, ruleName, notificationSeverity, notificationPriority, notificationDescription);\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "areaInputWithParameter" ,
7 "parameters" : [
8 {
9 "name" : "datastream_location_name" ,
10 "schema" : "string" ,
11 "value" : "entity.location"
12 },
13 {
14 "name" : "datastream_name" ,
15 "schema" : "string" ,
16 "value" : ""
17 },
18 {
19 "name" : "area" ,
20 "schema" : "string" ,
21 "value" : "Zone3"
22 },
23 {
24 "name" : "datastream_value" ,
25 "schema" : "string" ,
26 "value" : ""
27 },
28 {
29 "name" : "notification_description" ,
30 "schema" : "string" ,
31 "value" : "Checks if an entity has entered in a geofence"
32 },
33 {
34 "name" : "notification_severity" ,
35 "schema" : "string" ,
36 "value" : "URGENT"
37 },
38 {
39 "name" : "notification_priority" ,
40 "schema" : "string" ,
41 "value" : "MEDIUM"
42 },
43 {
44 "name" : "snmp_recipients" ,
45 "schema" : "string" ,
46 "value" : ""
47 },
48 {
49 "name" : "email_recipients" ,
50 "schema" : "string" ,
51 "value" : ""
52 }
53 ],
54 "type" : {
55 "datastreams" : [
56 {
57 "name" : "entity.location" ,
58 "prefilter" : true
59 }
60 ],
61 "name" : "DATASTREAM"
62 }
63 }
areaOutputWithParameter
DATASTREAM
ADVANCED
false
Checks if an entity has exitted of a geofence
1 {
2 "active" : false ,
3 "description" : "Checks if an entity has exitted of a geofence" ,
4 "javascript" : "var locationData = entity[getVariableValue(parameterObject['datastream_location_name'])];\nvar areaParameter = getVariableValue(parameterObject['area']);\nif (locationData._value._received) {\n var areas = getAreas(locationData._value._current.value.position.coordinates);\n var extraParameter = getVariableValue(parameterObject['datastream_name']);\n var result = false;\n if (locationData._value._previous) {\n var areasPrev = getAreas(locationData._value._previous.value.position.coordinates);\n result = JSON.stringify(areasPrev).indexOf(areaParameter) !== -1 \u0026\u0026 JSON.stringify(areas).indexOf(areaParameter) === -1;\n if (extraParameter !== '') {\n var data = entity[extraParameter];\n if (data._value._current) {\n result = result \u0026\u0026 data._value._current.value === getVariableValue(parameterObject['datastream_value']);\n } else {\n result = false;\n }\n }\n } else {\n result = false;\n }\n} else {\n result = false;\n}\n\nif (result) {\n\n var notificationDescription = getVariableValue(parameterObject['notification_description']);\n var notificationSeverity = getVariableValue(parameterObject['notification_severity']);\n var notificationPriority = getVariableValue(parameterObject['notification_priority']);\n var snmp_recipients = getVariableValue(parameterObject['snmp_recipients']);\n var email_recipients = getVariableValue(parameterObject['email_recipients']);\n\n if (snmp_recipients.length \u003e 0) {\n\n var identifier = entity['provision.device.identifier'] ? entity['provision.device.identifier']._value._current.value : entity['provision.asset.identifier']._value._current.value;\n\n var trapVariables = {\n '1.1.1': entity['provision.administration.organization']._value._current.value,\n '1.1.2': entity['provision.administration.channel']._value._current.value,\n '1.1.3': identifier,\n '1.1.4': entity['provision.administration.serviceGroup']._value._current.value,\n '1.9.1': '' + ruleName + '',\n '1.9.2': 'areaOutputWithParameter',\n '1.9.3': '' + notificationDescription + '',\n '1.9.4': '' + notificationPriority + '',\n '1.9.5': '' + notificationSeverity + '',\n '1.9.6': new Date().toISOString(),\n '1.9.14': 'entity.location',\n '1.9.15': areaParameter\n };\n var recipients = snmp_recipients.split(',');\n addTrapNotification(recipients, trapVariables, 'areaOutputWithParameter', '1.100.4', '1.3.6.1.4.1.32784', ruleName);\n }\n\n if (email_recipients.length \u003e 0) {\n var mailParameters = {};\n var mailBody = notificationDescription;\n var recipients = email_recipients.split(',');\n addEmailNotification(recipients, ruleName, mailBody, ruleName, mailParameters);\n }\n\n closeAlarmByAlarmName(null, getVariableValue(parameterObject['rule_to_close']));\n openAlarm(null, ruleName, ruleName, notificationSeverity, notificationPriority, notificationDescription);\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "areaOutputWithParameter" ,
7 "parameters" : [
8 {
9 "name" : "datastream_location_name" ,
10 "schema" : "string" ,
11 "value" : "entity.location"
12 },
13 {
14 "name" : "datastream_name" ,
15 "schema" : "string" ,
16 "value" : ""
17 },
18 {
19 "name" : "area" ,
20 "schema" : "string" ,
21 "value" : "Zone3"
22 },
23 {
24 "name" : "datastream_value" ,
25 "schema" : "string" ,
26 "value" : ""
27 },
28 {
29 "name" : "notification_description" ,
30 "schema" : "string" ,
31 "value" : "Checks if an entity has exitted of a geofence"
32 },
33 {
34 "name" : "notification_severity" ,
35 "schema" : "string" ,
36 "value" : "URGENT"
37 },
38 {
39 "name" : "notification_priority" ,
40 "schema" : "string" ,
41 "value" : "MEDIUM"
42 },
43 {
44 "name" : "snmp_recipients" ,
45 "schema" : "string" ,
46 "value" : ""
47 },
48 {
49 "name" : "email_recipients" ,
50 "schema" : "string" ,
51 "value" : ""
52 },
53 {
54 "name" : "rule_to_close" ,
55 "schema" : "string" ,
56 "value" : "areaInputWithParameter"
57 }
58 ],
59 "type" : {
60 "datastreams" : [
61 {
62 "name" : "entity.location" ,
63 "prefilter" : true
64 }
65 ],
66 "name" : "DATASTREAM"
67 }
68 }
batteryThreshold
DATASTREAM
EASY
false
Current value of datastream has an unusual value
1 {
2 "actions" : {
3 "open" : [
4 {
5 "description" : "Current value of datastream has an unusual value" ,
6 "enabled" : false ,
7 "name" : "batteryChargeCurrentValueThreshold" ,
8 "priority" : "MEDIUM" ,
9 "severity" : "URGENT"
10 }
11 ]
12 },
13 "actionsDelay" : 18000 ,
14 "active" : false ,
15 "condition" : {
16 "filter" : {
17 "and" : [
18 {
19 "lte" : {
20 "device.powersupply.battery.charge._current.value" : "$parameter:threshold"
21 }
22 },
23 {
24 "or" : [
25 {
26 "gt" : {
27 "device.powersupply.battery.charge._previous.value" : "$parameter:threshold"
28 }
29 },
30 {
31 "eq" : {
32 "device.powersupply.battery.charge._previous" : null
33 }
34 }
35 ]
36 }
37 ]
38 }
39 },
40 "description" : "Current value of datastream has an unusual value" ,
41 "mode" : "EASY" ,
42 "name" : "batteryThreshold" ,
43 "parameters" : [
44 {
45 "name" : "threshold" ,
46 "schema" : "integer" ,
47 "value" : 5
48 }
49 ],
50 "type" : {
51 "datastreams" : [
52 {
53 "fields" : [
54 {
55 "alias" : "battery current and previous value" ,
56 "field" : "value"
57 }
58 ],
59 "name" : "device.powersupply.battery.charge" ,
60 "prefilter" : true
61 }
62 ],
63 "name" : "DATASTREAM"
64 }
65 }
cancelBatteryThreshold
DATASTREAM
EASY
false
Current value of datastream has is returned to usual value
1 {
2 "actions" : {
3 "cancelDelay" : [
4 {
5 "name" : "batteryThreshold"
6 }
7 ],
8 "close" : [
9 {
10 "enabled" : false ,
11 "ruleToClose" : "batteryThreshold"
12 }
13 ]
14 },
15 "active" : false ,
16 "condition" : {
17 "filter" : {
18 "and" : [
19 {
20 "gt" : {
21 "device.powersupply.battery.charge._current.value" : "$parameter:threshold"
22 }
23 },
24 {
25 "lte" : {
26 "device.powersupply.battery.charge._previous.value" : "$parameter:threshold"
27 }
28 }
29 ]
30 }
31 },
32 "description" : "Current value of datastream has is returned to usual value" ,
33 "mode" : "EASY" ,
34 "name" : "cancelBatteryThreshold" ,
35 "parameters" : [
36 {
37 "name" : "threshold" ,
38 "schema" : "integer" ,
39 "value" : 5
40 }
41 ],
42 "type" : {
43 "datastreams" : [
44 {
45 "fields" : [
46 {
47 "alias" : "battery current and previous value" ,
48 "field" : "value"
49 }
50 ],
51 "name" : "device.powersupply.battery.charge" ,
52 "prefilter" : true
53 }
54 ],
55 "name" : "DATASTREAM"
56 }
57 }
changeCommsModuleOperationalStatusByNokPing
DATASTREAM
ADVANCED
false
Put selected operational status to communication module if consecutive NOK Ping reach selected value
1 {
2 "active" : false ,
3 "description" : "Put selected operational status to communication module if consecutive NOK Ping reach selected value" ,
4 "javascript" : "var countList = entity[\"device.communicationModules[].subscription.counters.presence.consecutivePingNOK\"];\nif (countList) {\n var commsValues = {};\n var values = {};\n var activeCollect = false;\n countList.forEach(function(data, index) {\n if (data._value \u0026\u0026 data._value._received \u0026\u0026 data._value._current.value \u003e= getVariableValue(parameterObject[\"threshold\"])) {\n var operationalStatusDatastream = \"device.communicationModules[].operationalStatus\";\n var commsIdentifier;\n var currentOperationalStatus;\n if (data._index.value \u0026\u0026 data._index.value._current) {\n commsIdentifier = data._index.value._current.value;\n currentOperationalStatus = entity[operationalStatusDatastream] ? entity[operationalStatusDatastream][index] : null;\n }\n if (commsIdentifier !== undefined \u0026\u0026 (!currentOperationalStatus || currentOperationalStatus._value._current.value !== \"DISABLED\")) {\n if (!commsValues[operationalStatusDatastream]) {\n commsValues[operationalStatusDatastream] = {};\n }\n commsValues[operationalStatusDatastream][commsIdentifier] = getVariableValue(parameterObject[\"operational_status\"]);\n activeCollect = true;\n }\n }\n });\n if (activeCollect) collectDatastreams(values, commsValues);\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "changeCommsModuleOperationalStatusByNokPing" ,
7 "parameters" : [
8 {
9 "name" : "operational_status" ,
10 "schema" : "string" ,
11 "value" : "DISABLED"
12 },
13 {
14 "name" : "threshold" ,
15 "schema" : "integer" ,
16 "value" : 50
17 }
18 ],
19 "type" : {
20 "datastreams" : [
21 {
22 "fields" : [
23 {
24 "alias" : "ping current and previous value" ,
25 "field" : "value"
26 }
27 ],
28 "name" : "device.communicationModules[].subscription.counters.presence.consecutivePingNOK" ,
29 "prefilter" : true
30 }
31 ],
32 "name" : "DATASTREAM"
33 }
34 }
changeCommsModuleOperationalStatusByOkPing
DATASTREAM
ADVANCED
false
Put selected operational status to communication module if OK Ping received
1 {
2 "active" : false ,
3 "description" : "Put selected operational status to communication module if OK Ping received" ,
4 "javascript" : "var ipList = entity[\"device.communicationModules[].subscription.presence.ip\"];\nif (ipList) {\n var commsValues = {};\n var values = {};\n var activeCollect = false;\n ipList.forEach(function(data, index) {\n if (data._value \u0026\u0026 data._value._received \u0026\u0026 \"DEVICE_PING\" === data._value._current.source \u0026\u0026 \"OK\" === data._value._current.value \u0026\u0026 data._value._previous \u0026\u0026 (\"OK\" !== data._value._previous.value || \"DEVICE_PING\" !== data._value._previous.source)) {\n var operationalStatusDatastream = \"device.communicationModules[].operationalStatus\";\n var commsIdentifier;\n var currentOperationalStatus;\n if (data._index.value \u0026\u0026 data._index.value._current) {\n commsIdentifier = data._index.value._current.value;\n currentOperationalStatus = entity[operationalStatusDatastream] ? entity[operationalStatusDatastream][index] : null;\n }\n if (commsIdentifier \u0026\u0026 currentOperationalStatus \u0026\u0026 currentOperationalStatus._value._current.value !== getVariableValue(parameterObject[\"operational_status\"])) {\n if (!commsValues[operationalStatusDatastream]) {\n commsValues[operationalStatusDatastream] = {};\n } \n commsValues[operationalStatusDatastream][commsIdentifier] = getVariableValue(parameterObject[\"operational_status\"]);\n activeCollect = true;\n }\n }\n if (activeCollect) {\n collectDatastreams(values, commsValues);\n }\n });\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "changeCommsModuleOperationalStatusByOkPing" ,
7 "parameters" : [
8 {
9 "name" : "operational_status" ,
10 "schema" : "string" ,
11 "value" : "RUNNING"
12 }
13 ],
14 "type" : {
15 "datastreams" : [
16 {
17 "name" : "device.communicationModules[].subscription.presence.ip" ,
18 "prefilter" : true
19 }
20 ],
21 "name" : "DATASTREAM"
22 }
23 }
checkDistance
DATASTREAM
ADVANCED
false
Checks if entity is farther than a defined distance
1 {
2 "active" : false ,
3 "description" : "Checks if entity is farther than a defined distance" ,
4 "javascript" : "var locationData = entity[getVariableValue(parameterObject['datastream_name'])];\nvar identifier = entity['provision.administration.identifier'];\nif (locationData._value._received) {\n var condition;\n var notificationDescription = getVariableValue(parameterObject['notificationDescription']);\n var notificationSeverity = getVariableValue(parameterObject['notificationSeverity']);\n var notificationPiority = getVariableValue(parameterObject['notificationPiority']);\n if (locationData._value._previous) {\n condition = getDistance(getVariableValue(parameterObject['latitude']), getVariableValue(parameterObject['longitude']), locationData._value._current.value.position.coordinates[1], locationData._value._current.value.position.coordinates[0]) \u003e getVariableValue(parameterObject['distance']) \u0026\u0026 getDistance(getVariableValue(parameterObject['latitude']), getVariableValue(parameterObject['longitude']), locationData._value._previous.value.position.coordinates[1], locationData._value._previous.value.position.coordinates[0]) \u003c getVariableValue(parameterObject['distance']);\n } else {\n condition = getDistance(getVariableValue(parameterObject['latitude']), getVariableValue(parameterObject['longitude']), locationData._value._current.value.position.coordinates[1], locationData._value._current.value.position.coordinates[0]) \u003e getVariableValue(parameterObject['distance']);\n }\n if (condition \u0026\u0026 (getVariableValue(parameterObject['entityKeys']) === 'ALL' || getVariableValue(parameterObject['entityKeys']).indexOf(identifier._value._current.value) !== -1)) {\n openAlarm(null, ruleName, ruleName, notificationSeverity, notificationPiority, notificationDescription);\n }\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "checkDistance" ,
7 "parameters" : [
8 {
9 "name" : "datastream_name" ,
10 "schema" : "string" ,
11 "value" : "entity.location"
12 },
13 {
14 "name" : "latitude" ,
15 "schema" : "number" ,
16 "value" : 40.47
17 },
18 {
19 "name" : "longitude" ,
20 "schema" : "number" ,
21 "value" : -3.66
22 },
23 {
24 "name" : "distance" ,
25 "schema" : "integer" ,
26 "value" : 2000
27 },
28 {
29 "name" : "entityKeys" ,
30 "schema" : "string" ,
31 "value" : "ALL"
32 },
33 {
34 "name" : "notificationDescription" ,
35 "schema" : "string" ,
36 "value" : "Checks if entity is farther than a defined distance"
37 },
38 {
39 "name" : "notificationSeverity" ,
40 "schema" : "string" ,
41 "value" : "INFORMATIVE"
42 },
43 {
44 "name" : "notificationPiority" ,
45 "schema" : "string" ,
46 "value" : "HIGH"
47 }
48 ],
49 "type" : {
50 "datastreams" : [
51 {
52 "name" : "entity.location" ,
53 "prefilter" : true
54 }
55 ],
56 "name" : "DATASTREAM"
57 }
58 }
collectAreas
DATASTREAM
ADVANCED
false
Calculate entity.area datastream (and its derivatives) based on entity.location datastream
1 {
2 "active" : false ,
3 "description" : "Calculate entity.area datastream (and its derivatives) based on entity.location datastream" ,
4 "javascript" : "var locationData = entity[getVariableValue(parameterObject['datastream_location_name'])];\nvar resourceType = entity.resourceType._value._current.value;\nif (resourceType \u0026\u0026 resourceType === 'entity.device' \u0026\u0026 locationData._value._received \u0026\u0026 locationData._value._current) {\n var commsValues = {};\n var values = {};\n var areasCurrent = getSortedAreas(locationData._value._current.value.position.coordinates, true);\n values[getVariableValue(parameterObject['datastream_area_name'])] = JSON.parse(areasCurrent);\n collectDatastreams(values, commsValues,false);\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "collectAreas" ,
7 "parameters" : [
8 {
9 "name" : "datastream_area_name" ,
10 "schema" : "string" ,
11 "value" : "entity.areas"
12 },
13 {
14 "name" : "datastream_location_name" ,
15 "schema" : "string" ,
16 "value" : "entity.location"
17 }
18 ],
19 "type" : {
20 "datastreams" : [
21 {
22 "name" : "entity.location" ,
23 "prefilter" : true
24 }
25 ],
26 "name" : "DATASTREAM"
27 }
28 }
countAccountingStart
DATASTREAM
ADVANCED
false
Count accounting start in subscription
1 {
2 "active" : false ,
3 "description" : "Count accounting start in subscription" ,
4 "javascript" : "var gmt0ResetHour = getVariableValue(parameterObject['gmt0_reset_time']).length === 0 ? '00:00:00Z' : getVariableValue(parameterObject['gmt0_reset_time']) + 'Z';\n\nvar resetDailyDate = getDailyResetDateWithZuluHour(gmt0ResetHour);\n\nvar gprsList = entity['device.communicationModules[].subscription.mobile.presence.gprs'];\nif (gprsList) {\n var commsValues = {};\n var values = {};\n var dpValues = {};\n var dpCommsValues = {};\n var totalDevice = 0.0;\n var activeCollect = false;\n gprsList.forEach(function(data, index) {\n var data = gprsList[index];\n if (data._value \u0026\u0026 data._value._received \u0026\u0026 data._value._current.value === 'START') {\n var commsIdentifier;\n if (data._index.value \u0026\u0026 data._index.value._current) {\n commsIdentifier = data._index.value._current.value;\n }\n commsIdentifier = commsIdentifier === undefined ? '' : commsIdentifier;\n var counterDatastream = getVariableValue(parameterObject['subscription_accounting_datastream']);\n if (counterDatastream) {\n var counterDatastreamMessage = getCommsDatastreamFromEntity(counterDatastream,commsIdentifier);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterDatastreamMessage, 1.0, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (counterDatastreamMessage != null) {\n dpCommsValues[counterDatastream] = {};\n dpCommsValues[counterDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[counterDatastream]) { \n commsValues[counterDatastream] = {}; \n } \n commsValues[counterDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n totalDevice = totalDevice + 1.0;\n }\n });\n if (activeCollect \u0026\u0026 entity.resourceType._value._current.value === 'entity.device') {\n var counterDatastream = getVariableValue(parameterObject['device_accounting_datastream']);\n if (counterDatastream) {\n var counterDatastreamMessage = getDatastreamFromEntity(counterDatastream);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterDatastreamMessage, totalDevice, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (counterDatastreamMessage != null) {\n dpValues[counterDatastream] = counterValueWithReset.preValue;\n }\n }\n values[counterDatastream] = counterValue;\n activeCollect = true;\n }\n }\n if (Object.keys(dpValues).length \u003e 0 || Object.keys(dpCommsValues).length \u003e 0) { \n collectDataPoints(entity.resourceType._value._current.value, entity['provision.administration.identifier']._value._current.value, dpValues, dpCommsValues, getVariableValue(parameterObject['ttl_datapoints_collector']));\n }\n\n if (activeCollect) {\n collectDatastreams(values, commsValues, true, true);\n }\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "countAccountingStart" ,
7 "parameters" : [
8 {
9 "name" : "subscription_accounting_datastream" ,
10 "schema" : "string" ,
11 "value" : "device.communicationModules[].subscription.counters.presence.accountingStartLastDay"
12 },
13 {
14 "name" : "device_accounting_datastream" ,
15 "schema" : "string" ,
16 "value" : "device.counters.presence.accountingStartLastDay"
17 },
18 {
19 "name" : "ttl_datapoints_collector" ,
20 "schema" : "integer" ,
21 "value" : -1
22 },
23 {
24 "name" : "gmt0_reset_time" ,
25 "schema" : "string" ,
26 "value" : "00:00:00"
27 }
28 ],
29 "type" : {
30 "datastreams" : [
31 {
32 "fields" : [
33 {
34 "alias" : "gprs current and previous value" ,
35 "field" : "value"
36 }
37 ],
38 "name" : "device.communicationModules[].subscription.mobile.presence.gprs" ,
39 "prefilter" : true
40 }
41 ],
42 "name" : "DATASTREAM"
43 }
44 }
countPings
DATASTREAM
ADVANCED
false
Count number of ping [OK/NOK/NOK consecutives] to get information in mobile net
1 {
2 "active" : false ,
3 "description" : "Count number of ping [OK/NOK/NOK consecutives] to get information in mobile net" ,
4 "javascript" : "var ipList = entity['device.communicationModules[].subscription.presence.ip'];\n\n\nvar gmt0ResetHour = getVariableValue(parameterObject['gmt0_reset_time']).length === 0 ? '00:00:00Z' : getVariableValue(parameterObject['gmt0_reset_time']) + 'Z';\nvar resetDailyDate = getDailyResetDateWithZuluHour(gmt0ResetHour);\n\n\nif (ipList) {\n var commsValues = {};\n var values = {};\n var dpValues = {};\n var dpCommsValues = {};\n var totalOkDevice = 0.0;\n var totalNokDevice = 0.0;\n var hasOkAnySubscription = false;\n var activeCollect = false;\n var reinject = false;\n\n ipList.forEach(function(data, index) {\n var data = ipList[index];\n if (data._value \u0026\u0026 data._value._received \u0026\u0026 data._value._current.source \u0026\u0026 data._value._current.source === 'DEVICE_PING') {\n //Getting comms context info\n var commsIdentifier;\n var operationalStatus;\n if (data._index.value \u0026\u0026 data._index.value._current) {\n commsIdentifier = data._index.value._current.value;\n operationalStatus = getCommsDatastreamFromEntity('device.communicationModules[].operationalStatus', commsIdentifier);\n } \n commsIdentifier = commsIdentifier === undefined ? '' : commsIdentifier;\n\n var pingNokDatastream = 'device.communicationModules[].subscription.counters.presence.pingNOKLastDay';\n var pingOkDatastream = 'device.communicationModules[].subscription.counters.presence.pingOKLastDay';\n var pingNokConsecutiveDatastream = 'device.communicationModules[].subscription.counters.presence.consecutivePingNOK';\n var availabilityDatastream = 'device.communicationModules[].subscription.counters.availabilityLastDay';\n\n var okPings = 0.0;\n var nokPings = 0.0;\n var reset = false;\n var countPingKO = !operationalStatus || !operationalStatus._current.value || operationalStatus._current.value !== getVariableValue(parameterObject['ignored_operational_status']);\n\n if (data._value._current.value === 'OK') {\n //At de moment that is received a ok ping, this rule will collect some datastreams\n activeCollect = true;\n\n hasOkAnySubscription = true;\n\n //Saving ping-ok counter value\n var pingOkDatastreamValue = getCommsDatastreamFromEntity(pingOkDatastream, commsIdentifier); \n var pingOkDataWithReset = getDailyCounterValueFromMessageWithReset(pingOkDatastreamValue, 1.0, resetDailyDate);\n var okPings = pingOkDataWithReset.value;\n if (!commsValues[pingOkDatastream]) {\n commsValues[pingOkDatastream] = {};\n }\n commsValues[pingOkDatastream][commsIdentifier] = okPings;\n\n //Getting ping-nok counter value - multiple uses\n var counterNokValue = getCommsDatastreamFromEntity(pingNokDatastream, commsIdentifier);\n \n if (pingOkDataWithReset.reset) {\n //Saving ping-ok counter dataPoint\n if (pingOkDataWithReset.preValue != null) {\n reset = true;\n dpCommsValues[pingOkDatastream] = {};\n dpCommsValues[pingOkDatastream][commsIdentifier] = pingOkDataWithReset.preValue;\n }\n \n //Reset of datapoint and datastream of ping-nok counter\n if (counterNokValue != null) {\n reset = true;\n dpCommsValues[pingNokDatastream] = {};\n dpCommsValues[pingNokDatastream][commsIdentifier] = counterNokValue._current.value;\n }\n if (!commsValues[pingNokDatastream]) {\n commsValues[pingNokDatastream] = {};\n }\n commsValues[pingNokDatastream][commsIdentifier] = 0.0;\n }\n\n //Reset of datastream ping-nok-consecutive by received pingOK\n if (!commsValues[pingNokConsecutiveDatastream]) {\n commsValues[pingNokConsecutiveDatastream] = {};\n }\n commsValues[pingNokConsecutiveDatastream][commsIdentifier] = 0.0;\n\n //Loading preValue of ping-nok counter to get new availability value\n nokPings = reset ? 0.0 : ((counterNokValue !== undefined \u0026\u0026 counterNokValue !== null \u0026\u0026 counterNokValue._current !== null) ? counterNokValue._current.value : 0.0);\n \n totalOkDevice = totalOkDevice + 1.0;\n } else {\n //Ping-nok only is counted if operational status is distinct to defined in parameter\n if (countPingKO) {\n //If operationalStatus is ok in ping-ko then will collect some datastreams\n activeCollect = true;\n reinject = true;\n\n //Saving ping-nok counter value\n var pingNOkDataWithResetMessage = getCommsDatastreamFromEntity(pingNokDatastream, commsIdentifier);\n var pingNOkDataWithReset = getDailyCounterValueFromMessageWithReset(pingNOkDataWithResetMessage, 1.0, resetDailyDate);\n var nokPings = pingNOkDataWithReset.value;\n if (!commsValues[pingNokDatastream]) {\n commsValues[pingNokDatastream] = {};\n }\n commsValues[pingNokDatastream][commsIdentifier] = nokPings;\n \n //Saving ping-nok-consecutive counter value\n var nokConsecutivePingsDsValue = getCommsDatastreamFromEntity(pingNokConsecutiveDatastream, commsIdentifier);\n var nokConsecutivePings = getCounterValue(nokConsecutivePingsDsValue ? nokConsecutivePingsDsValue._current : undefined, 1.0);\n if (!commsValues[pingNokConsecutiveDatastream]) {\n commsValues[pingNokConsecutiveDatastream] = {};\n }\n commsValues[pingNokConsecutiveDatastream][commsIdentifier] = nokConsecutivePings;\n\n //Getting ping-ok counter value - multiple uses\n var counterOkValue = getCommsDatastreamFromEntity(pingOkDatastream, commsIdentifier);\n\n if (pingNOkDataWithReset.reset) {\n //Saving ping-ok counter dataPoint\n if (pingNOkDataWithReset.preValue != null) {\n reset = true;\n dpCommsValues[pingNokDatastream] = {};\n dpCommsValues[pingNokDatastream][commsIdentifier] = pingNOkDataWithReset.preValue;\n }\n\n //Reset of datapoint and datastream of ping-nok counter\n if (counterOkValue != null) {\n reset = true;\n dpCommsValues[pingOkDatastream] = {};\n dpCommsValues[pingOkDatastream][commsIdentifier] = counterOkValue._current.value;\n }\n if (!commsValues[pingOkDatastream]) {\n commsValues[pingOkDatastream] = {};\n }\n commsValues[pingOkDatastream][commsIdentifier] = 0.0;\n }\n\n //Loading preValue of ping-ok counter to get new availability value\n okPings = reset ? 0.0 : ((counterOkValue !== undefined \u0026\u0026 counterOkValue !== null \u0026\u0026 counterOkValue._current !== null) ? counterOkValue._current.value : 0.0);\n \n totalNokDevice = totalNokDevice + 1.0;\n }\n }\n\n if (reset) {\n //Reset, saving availability dataPoint\n var dpCounterAvailability = getCommsDatastreamFromEntity(availabilityDatastream, commsIdentifier);\n if (dpCounterAvailability != null) {\n if (!dpCommsValues[availabilityDatastream]) {\n dpCommsValues[availabilityDatastream] = {};\n }\n var dpCounterAvailabilityValue = dpCounterAvailability \u0026\u0026 dpCounterAvailability._current ? dpCounterAvailability._current.value : 0.0;\n dpCommsValues[availabilityDatastream][commsIdentifier] = isNaN(parseFloat(dpCounterAvailabilityValue)) ? 0.0 : dpCounterAvailabilityValue;\n }\n }\n var availability = okPings * 100 / (okPings + nokPings);\n\n if (!commsValues[availabilityDatastream]) {\n commsValues[availabilityDatastream] = {};\n }\n commsValues[availabilityDatastream][commsIdentifier] = isNaN(availability) ? 0.0 : availability;\n }\n });\n\n if (activeCollect \u0026\u0026 entity.resourceType._value._current.value === 'entity.device') {\n //Device's counters\n\n //consecutive-ping-nok\n var pingNokConsecutiveDatastream = 'device.counters.presence.consecutivePingNOK';\n var nokConsecutivePings = 0.0;\n if (!hasOkAnySubscription) {\n var datastreamValue = getDatastreamFromEntity(pingNokConsecutiveDatastream);\n nokConsecutivePings = getCounterValue(datastreamValue ? datastreamValue._current : undefined, totalNokDevice);\n }\n values[pingNokConsecutiveDatastream] = nokConsecutivePings;\n \n //ping-nok\n var pingOkDatastream = 'device.counters.presence.pingOKLastDay';\n var pingOkDsValueWithResetMessage = getDatastreamFromEntity(pingOkDatastream);\n var pingOkDsValueWithReset = getDailyCounterValueFromMessageWithReset(pingOkDsValueWithResetMessage, totalOkDevice, resetDailyDate);\n if (pingOkDsValueWithReset.reset \u0026\u0026 pingOkDsValueWithReset.preValue != null ) {\n dpValues[pingOkDatastream] = pingOkDsValueWithReset.preValue;\n }\n values[pingOkDatastream] = pingOkDsValueWithReset.value;\n \n //ping-ok\n var pingNokDatastream = 'device.counters.presence.pingNOKLastDay';\n var pingNokDsValueWithResetMessage = getDatastreamFromEntity(pingNokDatastream);\n var pingNokDsValueWithReset = getDailyCounterValueFromMessageWithReset(pingNokDsValueWithResetMessage, totalNokDevice, resetDailyDate);\n if (pingNokDsValueWithReset.reset \u0026\u0026 pingNokDsValueWithReset.preValue != null ) {\n dpValues[pingNokDatastream] = pingNokDsValueWithReset.preValue;\n }\n values[pingNokDatastream] = pingNokDsValueWithReset.value;\n\n\n //availability\n var availabilityDatastream = 'device.counters.availabilityLastDay';\n if (dpValues[pingOkDatastream] || dpValues[pingNokDatastream]) {\n var dpCounterAvailability = getDatastreamFromEntity(availabilityDatastream);\n if (dpCounterAvailability != null) {\n var dpCounterAvailabilityValue = dpCounterAvailability \u0026\u0026 dpCounterAvailability._current ? dpCounterAvailability._current.value : 0.0;\n dpValues[availabilityDatastream] = isNaN(parseFloat(dpCounterAvailabilityValue)) ? 0.0 : dpCounterAvailabilityValue;\n }\n }\n\n var availability = pingOkDsValueWithReset.value * 100 / (pingOkDsValueWithReset.value + pingNokDsValueWithReset.value);\n values[availabilityDatastream] = isNaN(availability) ? 0.0 : availability;\n }\n} \nif (Object.keys(dpValues).length \u003e 0 || Object.keys(dpCommsValues).length \u003e 0) {\n collectDataPoints(entity.resourceType._value._current.value, entity['provision.administration.identifier']._value._current.value, dpValues, dpCommsValues, getVariableValue(parameterObject['ttl_datapoints_collector']));\n}\nif (activeCollect) {\n collectDatastreams(values, commsValues, true, reinject);\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "countPings" ,
7 "parameters" : [
8 {
9 "name" : "ignored_operational_status" ,
10 "schema" : "string" ,
11 "value" : "DISABLED"
12 },
13 {
14 "name" : "ttl_datapoints_collector" ,
15 "schema" : "integer" ,
16 "value" : -1
17 },
18 {
19 "name" : "gmt0_reset_time" ,
20 "schema" : "string" ,
21 "value" : "00:00:00"
22 }
23 ],
24 "type" : {
25 "datastreams" : [
26 {
27 "fields" : [
28 {
29 "alias" : "ip current and previous value" ,
30 "field" : "value"
31 }
32 ],
33 "name" : "device.communicationModules[].subscription.presence.ip" ,
34 "prefilter" : true
35 }
36 ],
37 "name" : "DATASTREAM"
38 }
39 }
diagnosticFailed
OPERATION
EASY
false
Diagnostic with error in some operation
1 {
2 "actions" : {
3 "close" : [
4 {
5 "enabled" : false ,
6 "ruleToClose" : "diagnosticFailed"
7 }
8 ],
9 "open" : [
10 {
11 "description" : "Diagnostic with error in some operation" ,
12 "enabled" : false ,
13 "name" : "diagnosticFailed" ,
14 "priority" : "HIGH" ,
15 "severity" : "URGENT"
16 }
17 ],
18 "sendEmail" : [
19 {
20 "enabled" : false ,
21 "name" : "diagnosticFailed" ,
22 "recipients" : [],
23 "subject" : "Diagnostic failed" ,
24 "template" : "Diagnostic with error in operation {{$datastream: operation.name}}"
25 }
26 ],
27 "sendTrap" : [
28 {
29 "enabled" : false ,
30 "enterpriseOID" : "1.3.6.1.4.1.32784" ,
31 "name" : "diagnosticFailed" ,
32 "recipients" : [
33 {
34 "ip" : "172.19.18.95" ,
35 "port" : 8080
36 }
37 ],
38 "trapOID" : "1.100.2" ,
39 "variables" : [
40 {
41 "1.1.1" : "$datastream: provision.administration.organization._current.value"
42 },
43 {
44 "1.1.2" : "$datastream: provision.administration.channel._current.value"
45 },
46 {
47 "1.1.3" : "$datastream: provision.device.identifier._current.value"
48 },
49 {
50 "1.1.4" : "$datastream: provision.administration.serviceGroup._current.value"
51 },
52 {
53 "1.7.1" : "$datastream: operation.name"
54 },
55 {
56 "1.7.2" : "$datastream: operation.result"
57 },
58 {
59 "1.7.3" : "$datastream: operation.state"
60 },
61 {
62 "1.9.1" : "diagnosticFailed"
63 },
64 {
65 "1.9.2" : "diagnosticFailed"
66 },
67 {
68 "1.9.3" : "Diagnostic with error in some operation"
69 },
70 {
71 "1.9.4" : "HIGH"
72 },
73 {
74 "1.9.5" : "URGENT"
75 }
76 ]
77 }
78 ]
79 },
80 "active" : false ,
81 "condition" : {
82 "filter" : {
83 "and" : [
84 {
85 "eq" : {
86 "operation.error" : true
87 }
88 }
89 ]
90 }
91 },
92 "description" : "Diagnostic with error in some operation" ,
93 "mode" : "EASY" ,
94 "name" : "diagnosticFailed" ,
95 "type" : {
96 "name" : "OPERATION" ,
97 "operationName" : "REFRESH_INFO"
98 }
99 }
messageFlowRateExceeded
EVENT
EASY
false
Message flow rate exceeded, not process message
1 {
2 "actions" : {
3 "close" : [
4 {
5 "enabled" : false ,
6 "ruleToClose" : "messageFlowRateExceeded"
7 }
8 ],
9 "open" : [
10 {
11 "description" : "Message flow rate exceeded, not process message" ,
12 "enabled" : false ,
13 "name" : "messageFlowRateExceeded" ,
14 "priority" : "MEDIUM" ,
15 "severity" : "URGENT"
16 }
17 ]
18 },
19 "active" : false ,
20 "condition" : {
21 "filter" : {
22 "and" : [
23 {
24 "eq" : {
25 "event.name" : "messageFlowRateExceeded"
26 }
27 }
28 ]
29 }
30 },
31 "description" : "Message flow rate exceeded, not process message" ,
32 "mode" : "EASY" ,
33 "name" : "messageFlowRateExceeded" ,
34 "type" : {
35 "eventName" : "messageFlowRateExceeded" ,
36 "name" : "EVENT"
37 }
38 }
mobileICCMismatch
DATASTREAM
EASY
false
Collected ICC does not match with provisioned
1 {
2 "actions" : {
3 "close" : [
4 {
5 "enabled" : false ,
6 "ruleToClose" : "mobileICCMismatch" ,
7 "subEntityDatastreamId" : "$datastream: provision.device.communicationModules[].subscriber.mobile.icc._current.value"
8 }
9 ],
10 "open" : [
11 {
12 "description" : "Collected ICC does not match with provisioned" ,
13 "enabled" : false ,
14 "name" : "mobileICCMismatch" ,
15 "priority" : "LOW" ,
16 "severity" : "INFORMATIVE" ,
17 "subEntityDatastreamId" : "$datastream: provision.device.communicationModules[].subscriber.mobile.icc._current.value"
18 }
19 ]
20 },
21 "active" : false ,
22 "condition" : {
23 "filter" : {
24 "and" : [
25 {
26 "neq" : {
27 "device.communicationModules[].subscriber.mobile.icc._current.value" : "$datastream: provision.device.communicationModules[].subscriber.mobile.icc._current.value"
28 }
29 }
30 ]
31 }
32 },
33 "description" : "Collected ICC does not match with provisioned" ,
34 "mode" : "EASY" ,
35 "name" : "mobileICCMismatch" ,
36 "type" : {
37 "datastreams" : [
38 {
39 "fields" : [
40 {
41 "alias" : "mobile icc current and previous value collected" ,
42 "field" : "value"
43 }
44 ],
45 "name" : "device.communicationModules[].subscriber.mobile.icc" ,
46 "prefilter" : true
47 },
48 {
49 "fields" : [
50 {
51 "alias" : "mobile icc current and previous value provisioned" ,
52 "field" : "value"
53 }
54 ],
55 "name" : "provision.device.communicationModules[].subscriber.mobile.icc" ,
56 "prefilter" : false
57 }
58 ],
59 "name" : "DATASTREAM"
60 }
61 }
mobileICCValueChanged
DATASTREAM
EASY
false
Compare current with previous values of one datastream
1 {
2 "actions" : {
3 "close" : [
4 {
5 "enabled" : false ,
6 "ruleToClose" : "mobileICCValueChanged" ,
7 "subEntityDatastreamId" : "$datastream: provision.device.communicationModules[].subscriber.mobile.icc._current.value"
8 }
9 ],
10 "open" : [
11 {
12 "description" : "Compare current with previous values of one datastream" ,
13 "enabled" : false ,
14 "name" : "mobileICCValueChanged" ,
15 "priority" : "MEDIUM" ,
16 "severity" : "INFORMATIVE" ,
17 "subEntityDatastreamId" : "$datastream: provision.device.communicationModules[].subscriber.mobile.icc._current.value"
18 }
19 ]
20 },
21 "active" : false ,
22 "condition" : {
23 "filter" : {
24 "and" : [
25 {
26 "neq" : {
27 "device.communicationModules[].subscriber.mobile.icc._current.value" : "$datastream:device.communicationModules[].subscriber.mobile.icc._previous.value"
28 }
29 }
30 ]
31 }
32 },
33 "description" : "Compare current with previous values of one datastream" ,
34 "mode" : "EASY" ,
35 "name" : "mobileICCValueChanged" ,
36 "type" : {
37 "datastreams" : [
38 {
39 "fields" : [
40 {
41 "alias" : "mobile icc current and previous value" ,
42 "field" : "value"
43 }
44 ],
45 "name" : "device.communicationModules[].subscriber.mobile.icc" ,
46 "prefilter" : true
47 }
48 ],
49 "name" : "DATASTREAM"
50 }
51 }
presenceReachableAllInterfaces
DATASTREAM
ADVANCED
true
Current value of datastream has an unusual value with margen temporal or no
1 {
2 "active" : true ,
3 "description" : "Current value of datastream has an unusual value with margen temporal or no" ,
4 "javascript" : "var unifiedPresenceList = entity[getVariableValue(parameterObject['datastream_name'])];\nvar presenciaTotal = entity['presenciaTotal'];\nvar hasUnifiedPresence = false;\nvar values = {};\nvar commsValues = {};\n\nif (unifiedPresenceList \u0026\u0026 (presenciaTotal == undefined || presenciaTotal._value._received == undefined)) {\n unifiedPresenceList.forEach(function(data, index) {\n if (data._value._received) {\n hasUnifiedPresence |= data._value._current.value === getVariableValue(parameterObject['threshold']) || data._value._current.value === getVariableValue(parameterObject['extra_threshold']) \u0026\u0026 (data._value._previous \u0026\u0026 (data._value._previous.value !== getVariableValue(parameterObject['threshold']) || data._value._previous !== getVariableValue(parameterObject['extra_threshold'])));\n } else {\n hasUnifiedPresence |= data._value._current.value === getVariableValue(parameterObject['threshold']) || data._value._current.value === getVariableValue(parameterObject['extra_threshold']);\n }\n });\n if (hasUnifiedPresence) {\n closeAlarmByAlarmName(null, getVariableValue(parameterObject['rule_to_close']));\n values[getVariableValue(parameterObject['collect_datastream_to'])] = true;\n collectDatastreams(values, commsValues);\n }\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "presenceReachableAllInterfaces" ,
7 "parameters" : [
8 {
9 "name" : "datastream_name" ,
10 "schema" : "string" ,
11 "value" : "device.communicationModules[].subscription.presence.unifiedPresence"
12 },
13 {
14 "name" : "notification_description" ,
15 "schema" : "string" ,
16 "value" : "Presence reachable"
17 },
18 {
19 "name" : "notification_severity" ,
20 "schema" : "string" ,
21 "value" : "CRITICAL"
22 },
23 {
24 "name" : "notification_priority" ,
25 "schema" : "string" ,
26 "value" : "HIGH"
27 },
28 {
29 "name" : "threshold" ,
30 "schema" : "string" ,
31 "value" : "IP"
32 },
33 {
34 "name" : "extra_threshold" ,
35 "schema" : "string" ,
36 "value" : "GPRS"
37 },
38 {
39 "name" : "collect_datastream_to" ,
40 "schema" : "string" ,
41 "value" : "presenciaTotal"
42 },
43 {
44 "name" : "rule_to_close" ,
45 "schema" : "string" ,
46 "value" : "presenceUnreachableAllInterfaces"
47 }
48 ],
49 "type" : {
50 "datastreams" : [
51 {
52 "fields" : [
53 {
54 "field" : "._current.value"
55 }
56 ],
57 "name" : "device.communicationModules[].subscription.presence.unifiedPresence" ,
58 "prefilter" : true
59 }
60 ],
61 "name" : "DATASTREAM"
62 }
63 }
presenceUnreachableAllInterfaces
DATASTREAM
ADVANCED
true
Current value of datastream has an unusual value with margen temporal or no
1 {
2 "active" : true ,
3 "description" : "Current value of datastream has an unusual value with margen temporal or no" ,
4 "javascript" : "var unifiedPresenceList = entity[getVariableValue(parameterObject['datastream_name'])];\nvar presenciaTotal = entity['presenciaTotal'];\n\nvar lostUnifiedPresence = true;\nvar hasReceived = false;\nvar values = {};\nvar commsValues = {};\n\n\nif (unifiedPresenceList \u0026\u0026 (presenciaTotal == undefined || presenciaTotal._value._received == undefined)) {\n unifiedPresenceList.forEach(function(data, index) {\n lostUnifiedPresence \u0026= data._value._current.value !== getVariableValue(parameterObject['threshold']) \u0026\u0026 data._value._current.value !== getVariableValue(parameterObject['extra_threshold']);\n hasReceived |= data._value._received != undefined;\n });\n if (lostUnifiedPresence \u0026\u0026 hasReceived) {\n\n\t\tvar notificationDescription = getVariableValue(parameterObject['notification_description']);\n\t\tvar notificationSeverity = getVariableValue(parameterObject['notification_severity']);\n\t var notificationPriority = getVariableValue(parameterObject['notification_priority']);\n\n openAlarm(null, ruleName, ruleName, notificationSeverity, notificationPriority, notificationDescription);\n values[getVariableValue(parameterObject['collect_datastream_to'])] = false;\n collectDatastreams(values, commsValues);\n }\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "presenceUnreachableAllInterfaces" ,
7 "parameters" : [
8 {
9 "name" : "datastream_name" ,
10 "schema" : "string" ,
11 "value" : "device.communicationModules[].subscription.presence.unifiedPresence"
12 },
13 {
14 "name" : "notification_description" ,
15 "schema" : "string" ,
16 "value" : "Presence unreachable"
17 },
18 {
19 "name" : "notification_severity" ,
20 "schema" : "string" ,
21 "value" : "CRITICAL"
22 },
23 {
24 "name" : "notification_priority" ,
25 "schema" : "string" ,
26 "value" : "HIGH"
27 },
28 {
29 "name" : "threshold" ,
30 "schema" : "string" ,
31 "value" : "IP"
32 },
33 {
34 "name" : "extra_threshold" ,
35 "schema" : "string" ,
36 "value" : "GPRS"
37 },
38 {
39 "name" : "collect_datastream_to" ,
40 "schema" : "string" ,
41 "value" : "presenciaTotal"
42 }
43 ],
44 "type" : {
45 "datastreams" : [
46 {
47 "fields" : [
48 {
49 "field" : "._current.value"
50 }
51 ],
52 "name" : "device.communicationModules[].subscription.presence.unifiedPresence" ,
53 "prefilter" : true
54 }
55 ],
56 "name" : "DATASTREAM"
57 }
58 }
receivedBanned
DATASTREAM
EASY
false
Received data for a banned entity
1 {
2 "actions" : {
3 "close" : [
4 {
5 "enabled" : false ,
6 "ruleToClose" : "receivedBanned"
7 }
8 ],
9 "open" : [
10 {
11 "description" : "Received data for a banned entity" ,
12 "enabled" : false ,
13 "name" : "receivedBanned" ,
14 "priority" : "MEDIUM" ,
15 "severity" : "URGENT"
16 }
17 ]
18 },
19 "active" : false ,
20 "condition" : {
21 "filter" : {
22 "and" : [
23 {
24 "eq" : {
25 "provision.device.administrativeState._current.value" : "BANNED"
26 }
27 }
28 ]
29 }
30 },
31 "description" : "Received data for a banned entity" ,
32 "mode" : "EASY" ,
33 "name" : "receivedBanned" ,
34 "type" : {
35 "datastreams" : [
36 {
37 "fields" : [
38 {
39 "field" : "._current.value"
40 }
41 ],
42 "name" : "provision.device.administrativeState" ,
43 "prefilter" : false
44 }
45 ],
46 "name" : "DATASTREAM"
47 }
48 }
securityConfigMismatch
EVENT
EASY
false
Security error validate, device validation failedSecurity error validate, device validation failed
1 {
2 "actions" : {
3 "close" : [
4 {
5 "enabled" : false ,
6 "ruleToClose" : "securityConfigMismatch"
7 }
8 ],
9 "open" : [
10 {
11 "description" : "Security error validate, device validation failedSecurity error validate, device validation failed" ,
12 "enabled" : false ,
13 "name" : "securityConfigMismatch" ,
14 "priority" : "MEDIUM" ,
15 "severity" : "URGENT"
16 }
17 ]
18 },
19 "active" : false ,
20 "condition" : {
21 "filter" : {
22 "and" : [
23 {
24 "eq" : {
25 "event.name" : "securityConfigMismatch"
26 }
27 }
28 ]
29 }
30 },
31 "description" : "Security error validate, device validation failedSecurity error validate, device validation failed" ,
32 "mode" : "EASY" ,
33 "name" : "securityConfigMismatch" ,
34 "type" : {
35 "eventName" : "securityConfigMismatch" ,
36 "name" : "EVENT"
37 }
38 }
subscriptionActivation
DATASTREAM
ADVANCED
false
Check if subscription is administrativeState = ACTIVE for a configured operator
1 {
2 "actionsDelay" : "" ,
3 "active" : false ,
4 "description" : "Check if subscription is administrativeState = ACTIVE for a configured operator" ,
5 "javascript" : "if((entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._received \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._received !== undefined \u0026\u0026 entity['provision.device.communicationModules[].subscription.mobile.homeOperator'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.mobile.homeOperator'][0]._value._current \u0026\u0026 entity['provision.device.communicationModules[].subscription.mobile.homeOperator'][0]._value._current.value === getVariableValue(parameterObject['operator_name']) \u0026\u0026 (entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._current \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._current.value === 'ACTIVE' \u0026\u0026 ((entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._previous === undefined) || (entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._previous.value !== 'ACTIVE'))))){var parameters;var subscriptionId = entity['provision.device.communicationModules[].subscription.identifier'][0]._value._current.value;executeOperation(subscriptionId,'ADMINISTRATIVE_STATUS_CHANGE','10800000',getVariableValue(parameterObject['api_key']),null,null,null,'10802000','DELAYED','{\"admsts\":\"ACTIVE\"}');}" ,
6 "mode" : "ADVANCED" ,
7 "name" : "subscriptionActivation" ,
8 "parameters" : [
9 {
10 "name" : "operator_name" ,
11 "schema" : "string" ,
12 "value" : "Sigfox Operator"
13 },
14 {
15 "name" : "api_key" ,
16 "schema" : "string" ,
17 "value" : "User api key"
18 }
19 ],
20 "type" : {
21 "datastreams" : [
22 {
23 "fields" : [
24 {
25 "alias" : "administrative state" ,
26 "field" : "._current.value"
27 },
28 {
29 "alias" : "administrative state previous" ,
30 "field" : "._previous.value"
31 }
32 ],
33 "name" : "provision.device.communicationModules[].subscription.administrativeState" ,
34 "prefilter" : true
35 },
36 {
37 "fields" : [
38 {
39 "alias" : "home operator" ,
40 "field" : "._current.value"
41 }
42 ],
43 "name" : "provision.device.communicationModules[].subscription.mobile.homeOperator" ,
44 "prefilter" : false
45 }
46 ],
47 "eventName" : "" ,
48 "name" : "DATASTREAM" ,
49 "operationName" : ""
50 }
51 }
subscriptionSuspension
DATASTREAM
ADVANCED
false
Check if subscription is administrativeState = SUSPENSION for a configured operator
1 {
2 "actionsDelay" : "" ,
3 "active" : false ,
4 "description" : "Check if subscription is administrativeState = SUSPENSION for a configured operator" ,
5 "javascript" : "if((entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._received \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._received !== undefined \u0026\u0026 entity['provision.device.communicationModules[].subscription.mobile.homeOperator'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.mobile.homeOperator'][0]._value._current \u0026\u0026 entity['provision.device.communicationModules[].subscription.mobile.homeOperator'][0]._value._current.value === getVariableValue(parameterObject['operator_name']) \u0026\u0026 (entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._current \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._current.value === 'SUSPENDED' \u0026\u0026 (entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._previous === undefined || entity['provision.device.communicationModules[].subscription.administrativeState'] \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value \u0026\u0026 entity['provision.device.communicationModules[].subscription.administrativeState'][0]._value._previous.value !== 'SUSPENDED')))){var parameters;var subscriptionId = entity['provision.device.communicationModules[].subscription.identifier'][0]._value._current.value;executeOperation(subscriptionId,'ADMINISTRATIVE_STATUS_CHANGE','10800000',getVariableValue(parameterObject['api_key']),null,null,null,'10802000','DELAYED','{\"admsts\":\"SUSPENDED\"}');}" ,
6 "mode" : "ADVANCED" ,
7 "name" : "subscriptionSuspension" ,
8 "parameters" : [
9 {
10 "name" : "operator_name" ,
11 "schema" : "string" ,
12 "value" : "Sigfox Operator"
13 },
14 {
15 "name" : "api_key" ,
16 "schema" : "string" ,
17 "value" : "User api key"
18 }
19 ],
20 "type" : {
21 "datastreams" : [
22 {
23 "fields" : [
24 {
25 "alias" : "administrative state" ,
26 "field" : "._current.value"
27 },
28 {
29 "alias" : "administrative state previous" ,
30 "field" : "._previous.value"
31 }
32 ],
33 "name" : "provision.device.communicationModules[].subscription.administrativeState" ,
34 "prefilter" : true
35 },
36 {
37 "fields" : [
38 {
39 "alias" : "home operator" ,
40 "field" : "._current.value"
41 }
42 ],
43 "name" : "provision.device.communicationModules[].subscription.mobile.homeOperator" ,
44 "prefilter" : false
45 }
46 ],
47 "eventName" : "" ,
48 "name" : "DATASTREAM" ,
49 "operationName" : ""
50 }
51 }
sumSessionBytes
DATASTREAM
ADVANCED
true
Sum traffic bytes can get information in mobile net
1 {
2 "active" : true ,
3 "description" : "Sum traffic bytes can get information in mobile net" ,
4 "javascript" : "var gmt0ResetHour = getVariableValue(parameterObject['gmt0_reset_time']).length === 0 ? '00:00:00Z' : getVariableValue(parameterObject['gmt0_reset_time']) + 'Z';\nvar resetDayOfMonth = getVariableValue(parameterObject['reset_day_of_month']).length === 0 ? '01' : getVariableValue(parameterObject['reset_day_of_month']);\n\nvar resetDailyDate = getDailyResetDateWithZuluHour(gmt0ResetHour);\nvar resetMonthlyDate = getMonthlyResetDateWithZuluHourAndDayOfMonth(gmt0ResetHour, resetDayOfMonth);\n\nvar gprsList = entity['device.communicationModules[].subscription.mobile.presence.gprs'];\nif (gprsList) {\n var commsValues = {};\n var values = {};\n var activeCollect = false;\n var totalBytesDevice = 0.0;\n var sentBytesDevice = 0.0;\n var receivedBytesDevice = 0.0;\n var dpValuesDaily = {};\n var dpCommsValuesDaily = {};\n var dpValuesMonthly = {};\n var dpCommsValuesMonthly = {};\n gprsList.forEach(function(data, index) {\n if (data._value \u0026\u0026 data._value._received \u0026\u0026 data._value._current.value === 'STOP') {\n var commsIdentifier;\n var session;\n if (data._index \u0026\u0026 data._index.value \u0026\u0026 data._index.value._current) {\n commsIdentifier = data._index.value._current.value;\n }\n session = entity['device.communicationModules[].subscription.session'][index];\n commsIdentifier = commsIdentifier === undefined ? '' : commsIdentifier;\n if (session._value._received) {\n if (session._value._current.value.sentBytes || session._value._current.value.receivedBytes) {\n var value = 0.0 + (session._value._current.value.sentBytes ? session._value._current.value.sentBytes : 0);\n value = value + (session._value._current.value.receivedBytes ? session._value._current.value.receivedBytes : 0);\n var dailyDatastream = getVariableValue(parameterObject['daily_subscription_total_datastream']);\n if (dailyDatastream) {\n var counterValueWithResetMessage = getCommsDatastreamFromEntity(dailyDatastream, commsIdentifier);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterValueWithResetMessage, value, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (!dpCommsValuesDaily[dailyDatastream]) {\n dpCommsValuesDaily[dailyDatastream] = {};\n }\n if (counterValueWithReset.preValue != null) {\n dpCommsValuesDaily[dailyDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[dailyDatastream]) {\n commsValues[dailyDatastream] = {};\n }\n commsValues[dailyDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n var monthlyDatastream = getVariableValue(parameterObject['monthly_subscription_total_datastream']);\n if (monthlyDatastream) {\n var counterValueWithResetMessage = getCommsDatastreamFromEntity(monthlyDatastream, commsIdentifier);\n var counterValueWithReset = getMonthlyCounterValueFromMessageWithReset(counterValueWithResetMessage, value, resetMonthlyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (!dpCommsValuesMonthly[monthlyDatastream]) {\n dpCommsValuesMonthly[monthlyDatastream] = {};\n }\n if (counterValueWithReset.preValue != null) {\n dpCommsValuesMonthly[monthlyDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[monthlyDatastream]) {\n commsValues[monthlyDatastream] = {};\n }\n commsValues[monthlyDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n totalBytesDevice = totalBytesDevice + value;\n }\n if (session._value._current.value.sentBytes) {\n sentBytesDevice = sentBytesDevice + session._value._current.value.sentBytes;\n var value = session._value._current.value.sentBytes + 0.0;\n var dailyDatastream = getVariableValue(parameterObject['daily_subscription_sent_datastream']);\n if (dailyDatastream) {\n var counterValueWithResetMessage = getCommsDatastreamFromEntity(dailyDatastream, commsIdentifier);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterValueWithResetMessage, value, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (!dpCommsValuesDaily[dailyDatastream]) {\n dpCommsValuesDaily[dailyDatastream] = {};\n }\n if (counterValueWithReset.preValue != null) {\n dpCommsValuesDaily[dailyDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[dailyDatastream]) {\n commsValues[dailyDatastream] = {};\n }\n commsValues[dailyDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n var monthlyDatastream = getVariableValue(parameterObject['monthly_subscription_sent_datastream']);\n if (monthlyDatastream) {\n var counterValueWithResetMessage = getCommsDatastreamFromEntity(monthlyDatastream, commsIdentifier);\n var counterValueWithReset = getMonthlyCounterValueFromMessageWithReset(counterValueWithResetMessage, value, resetMonthlyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (!dpCommsValuesMonthly[monthlyDatastream]) {\n dpCommsValuesMonthly[monthlyDatastream] = {};\n }\n var counter = getCommsDatastreamFromEntity(monthlyDatastream, commsIdentifier);\n if (counter != null) {\n dpCommsValuesMonthly[monthlyDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[monthlyDatastream]) {\n commsValues[monthlyDatastream] = {};\n }\n commsValues[monthlyDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n }\n if (session._value._current.value.receivedBytes) {\n receivedBytesDevice = receivedBytesDevice + session._value._current.value.receivedBytes;\n var value = session._value._current.value.receivedBytes + 0.0;\n var dailyDatastream = getVariableValue(parameterObject['daily_subscription_received_datastream']);\n if (dailyDatastream) {\n var counterValueWithResetMessage = getCommsDatastreamFromEntity(dailyDatastream, commsIdentifier);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterValueWithResetMessage, value, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (!dpCommsValuesDaily[dailyDatastream]) {\n dpCommsValuesDaily[dailyDatastream] = {};\n }\n if (counterValueWithReset.preValue != null) {\n dpCommsValuesDaily[dailyDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[dailyDatastream]) {\n commsValues[dailyDatastream] = {};\n }\n commsValues[dailyDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n var monthlyDatastream = getVariableValue(parameterObject['monthly_subscription_received_datastream']);\n if (monthlyDatastream) {\n var counterValueWithResetMessage = getCommsDatastreamFromEntity(monthlyDatastream, commsIdentifier);\n var counterValueWithReset = getMonthlyCounterValueFromMessageWithReset(counterValueWithResetMessage, value, resetMonthlyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n if (reset) {\n if (!dpCommsValuesMonthly[monthlyDatastream]) {\n dpCommsValuesMonthly[monthlyDatastream] = {};\n }\n if (counterValueWithReset.preValue != null) {\n dpCommsValuesMonthly[monthlyDatastream][commsIdentifier] = counterValueWithReset.preValue;\n }\n }\n if (!commsValues[monthlyDatastream]) {\n commsValues[monthlyDatastream] = {};\n }\n commsValues[monthlyDatastream][commsIdentifier] = counterValue;\n activeCollect = true;\n }\n }\n }\n }\n });\n if (activeCollect \u0026\u0026 entity.resourceType._value._current.value === 'entity.device') {\n var dailyTotalDatastream = getVariableValue(parameterObject['daily_device_total_datastream']);\n if (dailyTotalDatastream) {\n var counterValueWithResetMessage = getDatastreamFromEntity(dailyTotalDatastream);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterValueWithResetMessage, totalBytesDevice, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n values[dailyTotalDatastream] = counterValue;\n if (reset) {\n if (counterValueWithReset.preValue != null) {\n dpValuesDaily[dailyTotalDatastream] = counterValueWithReset.preValue;\n }\n }\n activeCollect = true;\n }\n var monthlyTotalDatastream = getVariableValue(parameterObject['monthly_device_total_datastream']);\n if (monthlyTotalDatastream) {\n var counterValueWithResetMessage = getDatastreamFromEntity(monthlyTotalDatastream);\n var counterValueWithReset = getMonthlyCounterValueFromMessageWithReset(counterValueWithResetMessage, totalBytesDevice, resetMonthlyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n values[monthlyTotalDatastream] = counterValue;\n if (reset) {\n if (counterValueWithReset.preValue != null) {\n dpValuesMonthly[monthlyTotalDatastream] = counterValueWithReset.preValue;\n }\n }\n activeCollect = true;\n }\n var dailySentDatastream = getVariableValue(parameterObject['daily_device_sent_datastream']);\n if (dailySentDatastream) {\n var counterValueWithResetMessage = getDatastreamFromEntity(dailySentDatastream);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterValueWithResetMessage, sentBytesDevice, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n values[dailySentDatastream] = counterValue;\n if (reset) {\n if (counterValueWithReset.preValue != null) {\n dpValuesDaily[dailySentDatastream] = counterValueWithReset.preValue;\n }\n }\n activeCollect = true;\n }\n var monthlySentDatastream = getVariableValue(parameterObject['monthly_device_sent_datastream']);\n if (monthlySentDatastream) {\n var counterValueWithResetMessage = getDatastreamFromEntity(monthlySentDatastream);\n var counterValueWithReset = getMonthlyCounterValueFromMessageWithReset(counterValueWithResetMessage, sentBytesDevice, resetMonthlyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n values[monthlySentDatastream] = counterValue;\n if (reset) {\n if (counterValueWithReset.preValue != null) {\n dpValuesMonthly[monthlySentDatastream] = counterValueWithReset.preValue;\n }\n }\n activeCollect = true;\n }\n var dailyReceivedDatastream = getVariableValue(parameterObject['daily_device_received_datastream']);\n if (dailyReceivedDatastream) {\n var counterValueWithResetMessage = getDatastreamFromEntity(dailyReceivedDatastream);\n var counterValueWithReset = getDailyCounterValueFromMessageWithReset(counterValueWithResetMessage, receivedBytesDevice, resetDailyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n values[dailyReceivedDatastream] = counterValue;\n if (reset) {\n if (counterValueWithReset.preValue != null) {\n dpValuesDaily[dailyReceivedDatastream] = counterValueWithReset.preValue;\n }\n }\n activeCollect = true;\n }\n var monthlyReceivedDatastream = getVariableValue(parameterObject['monthly_device_received_datastream']);\n if (monthlyReceivedDatastream) {\n var counterValueWithResetMessage = getDatastreamFromEntity(monthlyReceivedDatastream);\n var counterValueWithReset = getMonthlyCounterValueFromMessageWithReset(counterValueWithResetMessage, receivedBytesDevice, resetMonthlyDate);\n var reset = counterValueWithReset.reset;\n var counterValue = counterValueWithReset.value;\n values[monthlyReceivedDatastream] = counterValue;\n if (reset) {\n if (counterValueWithReset.preValue != null) {\n dpValuesMonthly[monthlyReceivedDatastream] = counterValueWithReset.preValue;\n }\n }\n activeCollect = true;\n }\n }\n if (Object.keys(dpValuesDaily).length \u003e 0 || Object.keys(dpCommsValuesDaily).length \u003e 0) {\n collectDataPoints(entity.resourceType._value._current.value, entity['provision.administration.identifier']._value._current.value, dpValuesDaily, dpCommsValuesDaily, getVariableValue(parameterObject['ttl_datapoints_collector_daily']));\n }\n if (Object.keys(dpValuesMonthly).length \u003e 0 || Object.keys(dpCommsValuesMonthly).length \u003e 0) {\n collectDataPoints(entity.resourceType._value._current.value, entity['provision.administration.identifier']._value._current.value, dpValuesMonthly, dpCommsValuesMonthly, getVariableValue(parameterObject['ttl_datapoints_collector_monthly']));\n }\n if (activeCollect) collectDatastreams(values, commsValues, true, true);\n}" ,
5 "mode" : "ADVANCED" ,
6 "name" : "sumSessionBytes" ,
7 "parameters" : [
8 {
9 "name" : "daily_subscription_total_datastream" ,
10 "schema" : "string" ,
11 "value" : "device.communicationModules[].subscription.counters.totalBytesLastDay"
12 },
13 {
14 "name" : "daily_subscription_sent_datastream" ,
15 "schema" : "string" ,
16 "value" : "device.communicationModules[].subscription.counters.sentBytesLastDay"
17 },
18 {
19 "name" : "daily_subscription_received_datastream" ,
20 "schema" : "string" ,
21 "value" : "device.communicationModules[].subscription.counters.receivedBytesLastDay"
22 },
23 {
24 "name" : "monthly_subscription_total_datastream" ,
25 "schema" : "string" ,
26 "value" : "device.communicationModules[].subscription.counters.totalBytesLastMonth"
27 },
28 {
29 "name" : "monthly_subscription_sent_datastream" ,
30 "schema" : "string" ,
31 "value" : "device.communicationModules[].subscription.counters.sentBytesLastMonth"
32 },
33 {
34 "name" : "monthly_subscription_received_datastream" ,
35 "schema" : "string" ,
36 "value" : "device.communicationModules[].subscription.counters.receivedBytesLastMonth"
37 },
38 {
39 "name" : "daily_device_total_datastream" ,
40 "schema" : "string" ,
41 "value" : "device.counters.totalBytesLastDay"
42 },
43 {
44 "name" : "daily_device_sent_datastream" ,
45 "schema" : "string" ,
46 "value" : "device.counters.sentBytesLastDay"
47 },
48 {
49 "name" : "daily_device_received_datastream" ,
50 "schema" : "string" ,
51 "value" : "device.counters.receivedBytesLastDay"
52 },
53 {
54 "name" : "monthly_device_total_datastream" ,
55 "schema" : "string" ,
56 "value" : "device.counters.totalBytesLastMonth"
57 },
58 {
59 "name" : "monthly_device_sent_datastream" ,
60 "schema" : "string" ,
61 "value" : "device.counters.sentBytesLastMonth"
62 },
63 {
64 "name" : "monthly_device_received_datastream" ,
65 "schema" : "string" ,
66 "value" : "device.counters.receivedBytesLastMonth"
67 },
68 {
69 "name" : "ttl_datapoints_collector_daily" ,
70 "schema" : "integer" ,
71 "value" : -1
72 },
73 {
74 "name" : "ttl_datapoints_collector_monthly" ,
75 "schema" : "integer" ,
76 "value" : -1
77 },
78 {
79 "name" : "gmt0_reset_time" ,
80 "schema" : "string" ,
81 "value" : "00:00:00"
82 },
83 {
84 "name" : "reset_day_of_month" ,
85 "schema" : "string" ,
86 "value" : "01"
87 }
88 ],
89 "type" : {
90 "datastreams" : [
91 {
92 "fields" : [
93 {
94 "alias" : "gprs current value" ,
95 "field" : "value"
96 }
97 ],
98 "name" : "device.communicationModules[].subscription.mobile.presence.gprs" ,
99 "prefilter" : true
100 }
101 ],
102 "name" : "DATASTREAM"
103 }
104 }