Valhalla Legends Archive

Programming => General Programming => Topic started by: Grok on September 08, 2004, 04:25 PM

Title: System Reachable on Network
Post by: Grok on September 08, 2004, 04:25 PM
Using PING <address> you can see if an address is reachable on your network, assuming the firewall allows the echo.

What functions could I use to write a network monitor which would alert me when one of a list of interfaces became unreachable?  Raw sockets are required here, right?  Or am I off track already?

Windows 2000 would be the platform for the utility.
Title: Re:System Reachable on Network
Post by: Adron on September 08, 2004, 04:43 PM
Raw sockets would work. You just need to use the regular winsock functions, they work much like an udp socket except that you include the headers in your buffer.

There's also a special DLL that handles only the special case of sending / receiving ICMP for pings. It has long been undocumented by Microsoft, but highly compatible between operating systems. It might be documented somewhere now.
Title: Re:System Reachable on Network
Post by: Skywing on September 08, 2004, 04:55 PM
Iphlpapi lets you send pings.  Incidentally it's interface is the same as icmp.dll's.
Title: Re:System Reachable on Network
Post by: iago on September 10, 2004, 07:06 PM
It seems to me that the only way of doing it is polling with ping, or something similar to ping.

If you don't get a good solution by Monday, I'll find out from the guys at work how they tell.  We have a really cool siren that goes off when one of our servers goes down :-D
Title: Re:System Reachable on Network
Post by: Grok on September 11, 2004, 12:20 AM
Quote from: iago on September 10, 2004, 07:06 PM
It seems to me that the only way of doing it is polling with ping, or something similar to ping.

If you don't get a good solution by Monday, I'll find out from the guys at work how they tell.  We have a really cool siren that goes off when one of our servers goes down :-D

If there's a cheapo package out there already, I'm interested.  Otherwise I'll throw something together using IPHLPAPI.
Title: Re: System Reachable on Network
Post by: iago on September 28, 2004, 12:05 PM
I finally remembered to ask about this.  We use a program called "What's Up".  I have no idea how it works or if it costs anything to license, but it can be found here:

http://www.cns.yorku.ca/comnews/unixtools.htm
Title: Re: System Reachable on Network
Post by: Skywing on September 28, 2004, 01:20 PM
Quote from: iago on September 28, 2004, 12:05 PM
I finally remembered to ask about this.  We use a program called "What's Up".  I have no idea how it works or if it costs anything to license, but it can be found here:

http://www.cns.yorku.ca/comnews/unixtools.htm
The NOC here uses it.  I believe IPSwitch (http://www.ipswitch.com) is the manufacturer.
Title: Re: System Reachable on Network
Post by: Grok on September 28, 2004, 02:03 PM
I used to have WhatsUpGold for Windows 2000, but deleted/lost it a year or two ago.