Using Microsoft SQL Server 2000 and some ASP script, Mitch creates a function that will ping any remote server, digest and process the results, and then return a summary of that ping session through an ASP function.
Using ASP & SQL To Ping A Remote Server - An overview of the procedure (Page 2 of 6 )
Let me just start by providing a brief outline of what our function will do. The ASP function will be named GetPingStats(), will return a string of text and will accept one parameter, RemoteIP. RemoteIP can be a fully qualified domain name (such as www.devarticles.com), an internal network name (such as webserver1), or an IP address (such as 192.168.0.1). It doesn’t matter which it is, because the ping command will automatically resolve its I.P.
This function will execute a stored procedure on the SQL Server named sp_PingServer, which will accept the RemoteIP variable as its only parameter. This function will call an extended stored procedure, xp_cmdShell, which will start a thread of the ping command on the SQL servers’ machine.
The results of that ping command will be fed back to our GetPingStats() ASP function, which in turn will process the results. These results will then be returned as a simple string of HTML text to the calling ASP script.