TN AppSvr251 Using Ping in AppServer to test connectivity
Last updated: March 19th, 2025Description
- Author: Brian Schneider
- Published: March 19th, 2025
Details:
Description
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)
Details
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.
Trigger:
I chose periodic, but you can choose a condition that makes sense in your environment. Make sure you mark the script as "Runs asynchronously".
Body:
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;
endif;
Me.TriggerPing = False;