TN AppSvr251 Using Ping in AppServer to test connectivity
This article from InSource shows how to use .NET in an ArchestrA object to test connectivity via simple ping command.
- Author: Lewis Talley
- Published: 09/19/2017
- Applies to: AppServer (Various)
The following details can be cut and pasted into your own ArchestrA object.
Declarations section of an object..
dim myPing as System.Net.NetworkInformation.Ping;
dim myPingReply as System.Net.NetworkInformation.PingReply
note I also added an attribute on the object that is a boolean to be able to generate an alarm.
I chose periodic, but you can choose a condition that makes sense in your environment. Make sure you mark the script as "Runs asynchronously".
myPing = new System.Net.NetworkInformation.Ping;
myPingReply = myPing.Send("****Node Name or IP Address Goes Here****");
''LogMessage ("************** " + myPingReply.Status.ToString() + "***Round trip time: " + myPingReply.RoundtripTime.ToString());
if (myPingReply.Status.ToString() <> "Success") then
Me.PingAlarm = true;
elseif (myPingReply.Status.ToString() == "Success") then
Me.PingAlarm = false;
Me.TriggerPing = False;