This tool applies to viewLinc 5.1.3 and later 5.1 Service Updates. Earlier versions and viewLinc 5.2.x are out of scope.
Identification
- Tool name
-
fix_all_open_alarms.py
- Type
-
Vaisala-supplied Python script, executed by the Python interpreter included with the viewLinc installation.
- Distribution
-
Provided to the customer by Vaisala Technical Support as part of a documented support engagement. The script is not part of the viewLinc product installer and is removed from the customer system after use.
- Applicable versions
-
viewLinc 5.1.3 and later 5.1 Service Updates.
- Execution mode
-
Command-line, executed on the viewLinc server with viewLinc services stopped. The script needs to be deployed from the same folder that viewLinc was installed in (default: C:\Program Files\Vaisala\Vaisala viewLinc\python).
Function
The script finds historical alarm records in viewLinc 5.1 that contain an activation event but no matching deactivation event, then writes a synthetic deactivation event so the alarm no longer appears active.
- Reads activation records from the historical database for the specified month.
- Reads deactivation records from the historical database from that month onward.
- Reads alarm ticket records from the active configuration database (viewLinc.sqlite).
- Identifies activations, by ticket identifier, with no matching deactivation in either the historical database or the active configuration database.
- For each such record, writes a deactivation event to the historical database with a timestamp set about 24 hours after the activation timestamp (specifically, 86,400.4 seconds later).
Two-stage execution
The script runs in two stages so the operator can review the records before any database changes are written.
| Stage | Behavior |
|---|---|
| Inspection (no write) | Command:
The script reports the alarm records it would modify. No data is written to the
historical database in this stage. |
| Repair (write) | Command:
The script writes a synthetic deactivation record for each open activation
identified in the inspection stage. |
Characteristics of the inserted deactivation record
- The deactivation timestamp is set to about 24 hours after the alarm's activation timestamp (specifically, 86,400.4 seconds later). It does not represent the actual time the alarming condition ended and should not be interpreted that way.
- Only records that contain an activation event but no matching deactivation event are modified. Other historical records, including activation events, acknowledgement events, comments, and sensor measurement data, are not changed.
- The tool only affects the historical database. It reads the active configuration database (viewLinc.sqlite) to exclude alarm tickets that are still active, but it does not modify that database.
- Records inserted by the tool use the same format as deactivation events generated during normal system operation. The historical database has no separate field to distinguish a tool-inserted deactivation record from one generated normally.
| Because the inserted deactivation timestamp uses a fixed offset of about 24 hours after activation rather than the actual end of the alarm, the historical database will not reflect the true duration of the affected alarms after the tool is run. |