Re: Ping an IP address on a Local Network

From: Rob Meade (robb.meade_at_NO-SPAM.kingswoodweb.net)
Date: 05/25/04


Date: Tue, 25 May 2004 21:08:21 GMT


"Devin" wrote...

> I am trying to figure out a way to ping IP address. This is because we
assign all of our IP address in house, and when we are assigning a new one,
we wish to verify that it is not already in use. THis functionality needs to
be webpage based though. Basically all I need is a way to tell a computer to
ping a certian IP, and tell me if it is in use or not. Any ideas? If someone
could provide some code that would do that it would be greatly appreciated.
Thank you.

Hi Devin,

I had to do something similar myself recently to see if our development
servers were running or not (cheap trick I guess)...

I had 2 options at the time (as I dont know .net inside out yet) - one was
to use SQL Server - have a stored procedure which does the actual pinging,
and then parse the results in the recordset when they are returned to the
webform (do a google search for "asp ping from sql server" and you'll
probably get the article immediately!)...

The other option I discovered was a http request method in .net - dont have
the code to hand, this was what we used in the end, with some exception
catching.

Once we got it to a 'yes' / 'no' kinda thing we went from there - built a
small status page for the boxes...

A colleague mentioned about just executing a shell command - meant little to
me - but I guess there's a way to fire a "ping xxx.xxx.xxx.xxx" directly
from the server via .net.

I hope this is of some use at least...

Regards

Rob



Relevant Pages

  • Re: Reconnect does not work TADOconnection
    ... On your timed ping, how often are you pinging the server to keep it active? ... We've dealt with similar issues using ADO and SQL Server. ... connection from SQL is dropped, the ADOConnection remains active until you ... Using an exception handler something like this: ...
    (borland.public.delphi.database.ado)
  • Re: Unable to ping some machines - others ok???
    ... The IP Address of the laptop ... The IP Address of the SQL server ... > decided to attempt to ping the machine to troubleshoot the issue. ... > successfully able to ping other machines on the LAN no probs. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: SQLSMS - Cannot Connect SQL Server 2000
    ... On the right-side make sure TCP/IP is enabled. ... I take it the NewXP computer can ping the laptop by both IP ... Rick Byham, SQL Server Books Online ...
    (microsoft.public.sqlserver.setup)
  • Re: Cant replicate between two servers
    ... Ping only tells ... you there's network connectivity. ... appropriate permissions to access SQL Server and of course, ...
    (microsoft.public.sqlserver.replication)
  • SMS 2003 MP Error to SQL Server
    ... I am getting the follwoing error in the SMS Console ... The SQL server site system is turned off, ... Verify that the SQL server site system is ... SMS Management Point does not have ...
    (microsoft.public.sms.setup)