Skip to main content

Monitoring module "diagnostics"

Description

The task of the "diagnostics" monitoring module is to monitor different types of input data with regard to defined criteria and then write the resulting alarm information to the smartCORE alarm database.

As a result, this database can be used for further processing of the alarm messages, such as transmission to the cloud.

The types of monitored input data include, among others

  • Boolean channels
  • Integer channels with (enumerated) (error) value range
  • Analog channels with measured values
  • Two-channel combinations (error streams) consisting of error code and error level

In addition, current values from smartCORE channels are recorded as part of the compilation of alarm messages (so-called snapshots) and user-defined metadata is integrated.

Interfaces & protocols used

  • smartCORE alarm database

JSON configuration

The following sections list sample configurations and discuss the module parameters involved.

Example configuration (monitoring a Boolean channel)

In this example, a Boolean channel is monitored for the value true.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "channelvalues",
"pollingIntervalMs": 1000,
"messages": [
{
"messageLevel": "WARNING",
"context": "Some WARNING occurred",
"channel": "someBooleanChannel",
"activation": "high"
}
]
}
}

Example configuration (monitoring the exceeding of a channel value with stabilization delays and hysteresis)

In this example, an integer or floating point channel is monitored for exceeding the value of 42.0. In the example, it is necessary for the overshoot to last for at least 5 seconds in order to be triggered or for deactivation that it does not occur for at least 10 seconds and that the value of the channel is below the threshold value minus its hysteresis.

An event-related message is also generated that contains the current value, the previous extremum, i.e. maximum in this case, and the threshold value.

This message is updated both when the value is initially exceeded and when it is deactivated. In addition, this message is also updated if the current value deviates from the last reported extremum by more than the hysteresis.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "channelvalues",
"pollingIntervalMs": 1000,
"messages": [
{
"messageLevel": "WARNING",
"context": "Some WARNING occurred",
"messageEvent": "Some WARNING occurred (current value ${value} > ${boundary}) (maximum value ${minmax} on ${minmaxDate} at ${minmaxTime})",
"channel": "someValueChannel",
"boundary": 42.0,
"hysteresis": 7.0,
"activation": "high",
"stabilizationSecondsRaise": 5,
"stabilizationSecondsRelease": 10,
}
]
}
}

Example configuration (monitoring of enumerated channel values)

In this example, an integer channel is monitored, whereby the value ranges (17, 77-99) are interpreted as trigger conditions, the value ranges (31-39, 66, 69-71) as deactivation conditions and all other ranges as invalid alarm conditions.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "channelvalues",
"pollingIntervalMs": 1000,
"messages": [
{
"messageLevel": "WARNING",
"context": "Some WARNING occurred",
"messageEvent": "Some WARNING occurred",
"messageFailure": "INVALID error occurred",
"channel": "someEnumeratedChannel",
"activation": "enum",
"valuesHigh": "17.77-99",
"valuesLow": "31-39,66,69-71"
}
]
}
}

Example configuration (monitoring an error stream)

In this example, a so-called error stream is monitored. This consists of the two sourceErrorCode and sourceErrorLevel channels, which must be synchronized in time. Both integer and string error code channels are supported, whereas the error level channel must contain integer values.

In the example, both the user-specified error code "47:11" and all unknown error codes are monitored.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "errorstream",
"pollingIntervalMs": 1000,
"sourceErrorCode": "Some.Name.Space.ErrorCodeChannel",
"sourceErrorLevel": "Some.Name.Space.ErrorLevelChannel",
"messages": [
{
"errorCode": "47:11",
"messageLevel": "WARNING",
"context": "WARNING ${errorCode} occurred",
"messageEvent": "WARNING ${errorCode} occurred"
},
{
"isTemplate": true,
"messageLevel": "WARNING",
"context": "UNKNOWN WARNING ${errorCode} occurred",
"messageEvent": "UNKNOWN WARNING ${errorCode} occurred"
}
]
}
}

Example configuration (monitoring of a Boolean channel, use of metadata)

In this example, a Boolean channel is monitored for the value true. The aim of this example is to illustrate the addition of user-specific metadata to alarm messages.

Metadata in the form of a JSON object is added for this purpose as part of the compilation of the alarm message, whereby the global metadata is always supplemented by the metadata specified in the message or replaced at the top level of the JSON object.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "channelvalues",
"pollingIntervalMs": 1000,
"globalMetadata": {
"actionToBePerformed": "some action",
"consequences":[
"consequence1",
"consequence2"
]
},
"messages": [
{
"messageLevel": "WARNING",
"context": "Some WARNING occurred",
"channel": "someBooleanChannel",
"boundary": 0,
"activation": "high",
"metadata": {
"actionToBePerformed": "some CRITICAL action",
"consequences":[
"some SEVERE consequence",
"consequence1",
"consequence2"
],
"additionalRemarks":[
"some REMARK"
]
}
}
]
}
}

Example configuration (monitoring of a Boolean channel, use of snapshot channels)

In this example, a Boolean channel is monitored for the value true. The aim of this example is to illustrate the addition of a user-specified snapshot of channel values to alarm messages.

For this purpose, a snapshot of various smartCORE channels is taken at the time of the initial occurrence of the alarm condition, which consists of the combination of all global and message-related snapshot channels.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "channelvalues",
"pollingIntervalMs": 1000,
"globalSnapshot": [
"someGps.Location",
"someOutsideTemperature"
]
"messages": [
{
"messageLevel": "WARNING",
"context": "Some WARNING occurred",
"channel": "someBooleanChannel",
"boundary": 0,
"activation": "high",
"snapshot": [
"somePressure",
"someTemperature",
"someQuantity",
]
}
]
}
}

Example configuration (monitoring of a Boolean channel, use of snapshot groups)

In this example, a Boolean channel is monitored for the value true. This example also illustrates the use of so-called snapshot groups.

{
"module": "diagnostics",
"factory": "diagnostics",
"config": {
"activationMode": "channelvalues",
"pollingIntervalMs": 1000,
"snapshotGroups": [
{
"name": "gpsInfoChannels",
"channels": [
"GPS.Location",
"GPS.Altitude",
"GPS.SatCount"
]
},
{
"name": "EngineOilPTQChannels",
"channels": [
"Engine.Oil.Pressure",
"Engine.Oil.Temperature",
"Engine.Oil.Quantity"
]
}
],
"globalSnapshot": [
"gpsInfoChannels",
"someOutsideTemperature"
]
"messages": [
{
"messageLevel": "WARNING",
"context": "Some WARNING occurred",
"channel": "someBooleanChannel",
"boundary": 0,
"activation": "high",
"snapshot": [
"Engine.Revs",
"EngineOilPTQChannels"
]
}
]
}
}

Global module parameters

All module parameters are discussed in the following section.

parameter namerequireddata typemeaningful value rangedefault valuedescription
pollingIntervalMsNoINT1 -1000 (1 s)processing interval [ms]
globalMetadataNoJSON ObjectEMPTY JSON ObjectJSON Object with any user-specified metadata
globalSnapshotNoJSON Array of STRINGEMPTY JSON ArrayJSON Array, which contains a global list of channels whose values are to be captured selectively at the time of alerting
snapshotGroupsNoJSON Array of JSON ObjectEMPTY JSON Arraysee below
activationModeYESSTRINGNO default valueActivation mode, either channel value monitoring ("channelvalues") or error stream monitoring ("errorstream")
messagesYESJSON Array of JSON ObjectNO default valuesee below

Global snapshot groups "snapshotGroups"

Several channels to be recorded as part of a snapshot can be configured in the form of a snapshot group as a JSON object, whose name can then be used as a channel name in the further course of the configuration. It makes sense to name these groups in such a way that existing channel names are not overwritten, as the names of these groups are first resolved into the names of their components.

parameter namerequireddata typemeaningful value rangedefault valuedescription
nameYESSTRINGName or alias of the snapshot group
channelsJAJSON Array of STRINGList of all summarized channel names

Configuration of the "messages" alarm messages

The "messages" alarm messages are configured in the form of JSON objects and in different ways depending on the type of monitoring.

The common configuration parameters of these JSON objects are

Parameter nameRequiredData typeSensible value rangeDefault valueDescription
messageLevelYESSTRINGinfo, action, service, warning, alarm, error, fatalNO default valueseverity of the alarm message
contextYESSTRINGContext of the alarm message
messageEventNoSTRINGAlarm message when alarm is triggered
needAcknowledgeNoBOOLEANfalse, truefalsean acknowledgement is required on the cloud side
keepAcknowledgedStatusNoBOOLEANfalse, truefalseshould the acknowledged status be retained
stabilizationSecondsRaiseNoINTEGER1 -0Stabilization delay after which the alarm is to be triggered (the initial time of the first occurrence of the alarm condition is reported)
stabilizationSecondsReleaseNoINTEGER1 -0Stabilization delay after which the alarm is to be deactivated (the initial time of the first occurrence of the deactivation condition is reported)
metadataNoJSON objectEMPTY JSON objectUser-defined metadata that can potentially overwrite the global metadata
snapshotNoJSON Array of STRINGEMPTY JSON ArrayChannels to be captured during the initial occurrence of the alarm condition. The global snapshot "globalSnapshot" is combined with the snapshot groups specified and resolved here (from "snapshotGroups") and channels specified individually here.

Configuration of channel value monitoring ("activationMode" = "channelvalues")

As part of the value monitoring of a smartCORE channel, the above-mentioned configuration object is supplemented by the following parameters, whereby the following parameters must be defined for threshold value monitoring

Parameter nameRequiredData typeSensible value rangeDefault valueDescription
channelYESSTRINGNO default valueName of the monitored smartCORE channel
boundaryYESINTEGER or FLOAT0Threshold value, exceeding or falling below which leads to the initial fulfillment of the alarm condition
activationYESSTRINGlow, high, minimum, maximum, positiveEdge, negativeEdgeNO default valueType of alarm activation. ("low" => undershoot, "high" => overshoot, "minimum" => undershoot with monitoring of the minimum, "maximum" => overshoot with monitoring of the maximum, "positiveEdge" => overshoot (only initial, stateless alarming), "negativeEdge" => undershoot (only initial, stateless alarming)

In the case of range monitoring, i.e. if the value of a channel comes from an enumeration (enum), the following additional parameters can be specified.

Parameter nameRequiredData typeSensible value rangeDefault valueDescription
channelYESSTRINGNO default valueName of the monitored smartCORE channel
valuesLowSELECTION SELECTSTRING"0"Specification of the value ranges corresponding to a deactivated alarm condition
valuesHighCHOICESTRING"0"Specification of the value ranges that correspond to a triggered alarm condition
activationYESSTRINGenumNO default valueType of alarm activation. Only enum makes sense in this configuration.

Either one or both of the above-mentioned value range specifications valuesLow or valuesHigh can be used here. If only one specification is used, the other corresponds to the opposite of this specification. If, on the other hand, both specifications are used, the value ranges not covered correspond to an invalid alarm condition. For this purpose, an invalid alarm message can be specified in the form of the following additional parameter

parameter namerequireddata typemeaningful value rangedefault valuedescription
messageFailureNoSTRINGAlarm message if alarm condition is invalid

Configuration of channel value monitoring ("activationMode" = "errorstream")

A so-called error stream can also be monitored. This generally consists of two synchronized smartCORE channels that contain the error code on the one hand and the error level on the other.

These two channels are configured as global module parameters as follows

Parameter nameRequiredData typeMeaningful value rangeDefault valueDescription
sourceErrorCodeYESSTRINGNO default valuesmartCORE channel containing a time-variable error code
sourceErrorLevelYESSTRINGNO default valuesmartCORE channel that contains a synchronous error level

The sourceErrorCode channel is a channel that provides either integer values or strings. The sourceErrorLevel channel, on the other hand, provides integer values.

Furthermore, a neutral error level can be specified in the global module configuration as follows

parameter namerequireddata typemeaningful value rangedefault valuedescription
neutralErrorCodeNoSTRING0Neutral error level at which NO alarm is triggered

The individual alarm messages (in this case relating to different error codes) are configured as shown above. The following parameters must also be specified

parameter namerequireddata typemeaningful value rangedefault valuedescription
errorCodeCHOICESTRINGError code monitored by this monitoring unit
isTemplateCHOICEBOOLEANfalse, truefalseIs this a monitoring unit for unknown error codes (wildcard)?

If errorCode is specified, the corresponding alarm message is created in response to the error code. A template, on the other hand, configures alarm messages for all unknown error codes.

Module information

InformationValue
AuthorsoptiMEAS Measurement and Automation Systems GmbH
since smartCORE2.6
Module typeConsumer
DependenciesNONE