Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ PI Server Installation and Configuration (PI Server 2018)

Monitor the AF Health Check counter

  • Last UpdatedOct 02, 2024
  • 1 minute read

You can use a Windows PerfMon counter called AF Health Check to determine if both the AF application service and the SQL Server are running and responding. When they are responding, the counter returns a value of 1. Load balancers typically do not read this counter directly, but you can access the information it provides.

Note: This procedure requires the Windows Performance Monitor (perfmon) utility. It does not require the PI Performance Monitor interface.

  1. Run Internet Information Services (IIS) on the AF server.

  2. Create a page that will show the value of the perfmon counter (see code sample, later).

  3. Configure the hardware load balancer to read the content from this web page to determine the availability of AF.

Sample code to show the value of the perfmon counter

The following sample checks the value of the AF Health Check performance counter and then displays the status of the AF server on a web page.

<%@ Import Namespace = "System.Diagnostics" %>

<script runat="server">
sub Page_Load(sender as Object, e as EventArgs)
Dim perfAFHealth as New PerformanceCounter("PI AF Server", "Health")

If perfAFHealth.NextValue() = 0
lblperfAFHealth.Text = "DOWN"
ElseIf perfAFHealth.NextValue() = 1
lblperfAFHealth.Text = "UP"
Else lblperfAFHealth.Text = "INVALID"
End If
end sub
</script>


<!DOCTYPE html>
<html>
<head>
<title>AF Health Check</title>
<meta http-equiv="refresh" content="5" />
</head>
<body>

<form id="Form1" runat="server">
AF Health Status :
<asp:Label id="lblperfAFHealth" runat="server" />
</form>

</body>
</html>

TitleResults for “How to create a CRG?”Also Available in