Monitor Servers, Disk Space, and Memory
Customers frequently ask for a way to monitor server health, or the amount of free disk and memory space available. These tasks can be accomplished with Workstation Status Tag
To configure, create one Workstation Status tag for each server that runs your application. The Workstation tab of each tag holds a configuration field where you can select the workstation name.
A Workstation Status driver, configured to monitor the primary server.
Monitor Server Status
The Workstation Status tag will have a value of either 0 (meaning no error) or Invalid (meaning no connection). You can use this fact to create an alarm when a server is offline. In the following example, an Alarm tag was created as a child of the Workstation Status Driver, Primary Server. The triggering expression is
! Valid([Primary Server])
where [Primary Server] is the name of the Workstation Status tag in this example. Substitute the name of your own tag for your alarm expression.
The alarm is triggered when the connection to the parent tag, [Primary Server], is lost.
Add an On Delay of one or two seconds to the alarm configuration. Whenever the application restarts, there will be a moment between the tag starting and the workstation's status being reported. During that time, the driver's value will be INVALID and will trigger the alarm unless you configure a delay. This will also avoid alarms due to transient network interruptions.
Monitor Free Disk Space
Refer to Workstation Status Driver I/O Addressing for a list of workstation properties that you can monitor. For this example, the goal is to trigger an alarm when the free space on drive C: falls below 50Mb. (50Mb is 50*1024*1024 = 5324800 bytes)
To do this, create an I/O and Calculations tag as a child of your Workstation Status driver, configured as an analog. Key details of the configuration are shown in the following two figures.
Detail showing the read address of an Analog I/O tag attached to the Workstation Driver
Alarm setpoint detail from that same tag.
The disk space would be easier to read if measured in megabytes.
Do so with the Scaling tab, setting the Unscaled Process Data Max to 1048576
and the Scaled Process Data Max to 1.
Applying this to the previous example, you would then be able to use 50 as your alarm setpoint instead of 5324800.
To scale for gigabytes instead of megabytes, multiply the Unscaled Process Data Max by 1024 once more: 1073741824
Monitor Memory Space in Use
Refer to Workstation Status Driver I/O Addressing for a list of workstation properties that you can monitor. For this example, the goal is to trigger an alarm when the memory used by VTScada rises above a given level, or when the rate of change over a period of time remains positive.
To do this, create an I/O and Calculations tag as a child of your Workstation Status driver, configured as an analog and also a Rate of Change tag monitoring that I/O tag. Key details of the configuration are shown in the following figures.
In this example, the I/O tag is scaled from bytes (1048576 for the Unscaled Process Data Max) to megabytes (1 for the Scaled Process Data Max). High memory usage in this example is defined as 800Mb. Your value will differ. Monitor your system over several days to gain a sense of the normal memory requirement and choose an alarm setpoint above that.
Monitoring the memory in use:
Detail showing the read address of an Analog I/O tag attached to the Workstation Driver
Alarm setpoint detail from that same tag.
Monitor for increasing memory use over 15 minutes:
Detail of the Rate of Change tag. 900 seconds is a 15 minute period, refreshed every minute.
In this example, the rate of change must remain over 0.5 for five minutes (300s).