Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Images updated

Overview

The Audit Trail is a security-relevant chronological set of records that provide documentary evidence of the activities that have affected a specific operation, procedure, or event at any time.

On this page:

Table of Contents
maxLevel3
minLevel2
stylenone


Configuring an Audit Trail

To use the Audit Trail function, Access Alarms  /Global Settings and check the Enable Audit Trail box to activate it.

Image RemovedImage Added

Besides the Enable option, you can choose which actions the Audit Trail database stores. Below is a list of the options each with an image of how they will be logged in the alarm window:

  • User Logon/Logoff: Stores informational data about user login/logout.
Image Removed
  • Image Added
  • Open/Close Displays: Stores informational data when displays are open or closed.
Image Removed
  • Image Added
  • Remote Connections: Stores information about remote client connections (Smart/Rich Clients).
Image Removed
  • Image Added
  • Custom Messages: Stores added custom messages.
Image Removed
  • Image Added
  • Tag Changes: Stores informational data of every tag change.
Image Removed
  • Image Added
  • Datasets (Insert/Updates or All Commands): Stores information about datasets.
Image Removed
  • Image Added
  • Operator Actions: Stores information about operator actions.
Image Removed
  • Image Added
  • Save Reports: Stores information when the save command is executed.
Image Removed
  • Image Added
  • System Warnings: Stores information related to the system.
Image Removed
  • Image Added


It is possible to enable any of these options during runtime by using the Alarm Namespace properties through the following syntax:

Code Block
@Alarm.GlobalSettings.AuditTrail.<Audit Trail Option>


Add an Alarm Window element to your display to visualize the stored Audit Trail data and select the Audit Trail option in the List field.Image RemovedImage Added


Custom Messages

One of the most important features of the Audit trail is the ability to add customizable messages to a historian database. To add custom messages in runtime, use the method below:

Code Block
@Alarm.GlobalSettings.AuditTrail.AddCustomMessage(string message, string areaName, string objectName, string value, string itemName, string auxValue, string comment)

Where:

  • message: The custom message to be added to the Audit.

  • areaName: The area related to this custom message.

  • objectName: The object related to this custom message.

  • value: The object value related to this custom message.

  • itemName: The item name.

  • auxValue: The auxiliary value.

  • comments: The comments.

The messages can either be text or a concatenation between text and real-time info from the project. For messages that are only text, only the message parameter is required:

Code Block
@Alarm.GlobalSettings.AuditTrail.AddCustomMessage("The day is sunny")

The following is an example on the usage of text and project info:

Code Block
@Alarm.GlobalSettings.AuditTrail.AddCustomMessage("User:  "  +  @Client.UserName  +  "  logged");



Add translations to custom messages

You can translate text to different languages, accessing Displays → Localization, and creating words in a custom dictionary. See the Displays Localization page for more details.

You must follow a specific syntax to apply translations to the custom messages in the Audit Trail.

  • If the message is text only, the default syntax is:
Code Block
@Alarm.GlobalSettings.AuditTrail.AddCustomMessage("tag changed value, AckRequired");
  • If the message is text and project info, you must add the curly brackets character ”{ }” before and after the project info. The message string should look like this:
Code Block
string message = "User: {" + @Client.UserName + "} logged"


Info
titleNote

If the alarm database contains the characters ” { ” and ” } ” in the Message column. The dictionary must also contain the brackets characters.

You must add another string element to the itemName input parameter, as seen below:

Code Block
string itemName = "{object}"

A final AddCustomMessage with localization capabilities should look like this:

Code Block
@Alarm.GlobalSettings.AuditTrail.AddCustomMessage("User:  {"  +  @Client.UserName  +  "}  logged", null, null, null, "{object}", null, null);



Translating Tags and Tables

To switch between languages, use the property:

Code Block
@Client.Localization = "" // for default dictionary
//or
@Client.Localization = "<Dictionary_Name>"

To have a translated Alarm Audit Trail with Custom Messages and Comments in Reports, the addition of a callback function on Script → Classes → ClientMain is required. This function is called every time the DataGrid object is modified. The Callback function syntax is as follows:

Code Block
public void OnReportCustomTableCell(string reportName, string columnName, System.Data.
DataRow row, System.Windows.Documents.TableCell tableCell)
{
// Insert Code Here
}

The code added to the callback function is as follows:

Code Block
public void OnReportCustomTableCell(string reportName, string columnName, System.Data.DataRow row, System.
Windows.Documents.TableCell tableCell)
{
if (row["ItemName"].ToString() == "{object}")
{
string[]  Message_Split_Parts  =  row[columnName].ToString().Split(’{’,  ’}’); string Translated_Message = "";

for (int i = 0; i <= Message_Split_Parts.Length - 1; i++) {

// Translate the custom message part
Translated_Message += @Client.Locale(Message_Split_Parts[i]);

Run  cellText  =  (tableCell.Blocks.FirstBlock  as  Paragraph).Inlines.FirstInline  as  Run;

// Replace the original message with the translated one. cellText.Text = Translated_Message;
}

}
}

The DataGrid language will depend on the dictionary that was enabled when the report was saved.


In this section:

Page Tree
root@parent
spacesV10