I have a table data collection item configured which pulls the alert messages from our printers. It consists of two columns: SNMP parameter .1.3.6.1.2.1.43.18.1.1.7 is the integer alert code (and I've set that as instance column), and .1.3.6.1.2.1.43.18.1.1.8 is the textual description of the alert.
I have a threshold set on that table which raises the SYS_TABLE_THRESHOLD_ACTIVATED event when the description is neither "Sleep" nor "Sleep mode on". The alarm gets raised properly when the printer has an alert message, but the SYS_TABLE_THRESHOLD_DEACTIVATED event is never raised. The reason for this is that the alert just gets removed from the table because it is no longer reported via SNMP and this does not trigger any events.
Is there any way to raise an SYS_TABLE_THRESHOLD_DEACTIVATED event when the line that triggered the SYS_TABLE_THRESHOLD_ACTIVATED event is removed from a table DCI?
One thing I've thought about is writing a transformation script that does something like this:
Of course, this doesn't work for the simple reason that NXSL does not offer any way to access the alarm list (i.e. the list which is shown in the Alarm Browser in the GUI), at least I couldn't find one.
There would need to be some way to get an alarm object associated with a specific node and DCI (e.g. GetAlarmWithKeyStartingWith as used above), and the NXSL alarm class would need to have at least a key attribute and a terminate() method.
I have a threshold set on that table which raises the SYS_TABLE_THRESHOLD_ACTIVATED event when the description is neither "Sleep" nor "Sleep mode on". The alarm gets raised properly when the printer has an alert message, but the SYS_TABLE_THRESHOLD_DEACTIVATED event is never raised. The reason for this is that the alert just gets removed from the table because it is no longer reported via SNMP and this does not trigger any events.
Is there any way to raise an SYS_TABLE_THRESHOLD_DEACTIVATED event when the line that triggered the SYS_TABLE_THRESHOLD_ACTIVATED event is removed from a table DCI?
One thing I've thought about is writing a transformation script that does something like this:
Code Select
idxCode = $1->getColumnIndex("Code");
nodeId = d2x($node->id, 8);
tableId = d2x(FindDCIByName($node, "printerAlert"), 8);
prefix = "DCTTHR_" . nodeId . "_" . tableId . "_"; // the keys look like DCTTHR_<node ID in hex>_<DCI ID in hex>_<instance ID>
alarms = GetAlarmWithKeyStartingWith(prefix);
foreach(alarm : alarms)
{
removeAlarm = true;
for (i = 0; i < $1->rowCount; i++)
{
if ($1->get(i, idxCode) == substr(alarm->key, length(prefix)) // instance part of the alarm key matches the code in the current row
{
removeAlarm = false;
}
}
if (removeAlarm)
{
alarm->terminate();
}
}
Of course, this doesn't work for the simple reason that NXSL does not offer any way to access the alarm list (i.e. the list which is shown in the Alarm Browser in the GUI), at least I couldn't find one.
There would need to be some way to get an alarm object associated with a specific node and DCI (e.g. GetAlarmWithKeyStartingWith as used above), and the NXSL alarm class would need to have at least a key attribute and a terminate() method.