1

My company operates on a WAN. Each of our branches operates on a certain range of IPs (192.168.0.100, 192.168.1.100, 192.168.2.100 for example).

I want to monitor the connection. I've written a quick console application in C# that pings each address every 5 seconds and logs the result in a CSV file. Is this sufficient? I'm getting quite a lot of TimedOut errors, though the address might be available on the next test (so it's not down, but timing out) - why might this be happening? Am I pinging too frequently or? I've set a generous timeout period.

Thanks.

Edit: I should have said, there is no 'server' at each branch, just a router configured to be part of the WAN - so there is there anything more I can do other than test connectivity?

5 Answers 5

5

About checking basic network connectivity between points across a WAN. Under normal conditions a regular Ping trace should show stable connectivity.
However, in your case (over WAN links) your connectivity appears to be weak.
By that I mean, there may be intermittent packet loss over your WAN path.

About checking Server Application availability. Now, that is a different ball-game.
You need to use tests that involve the server protocol (TCP and HTTP/HTTPS if it is a web server).
Because, your 'server' may be reachable but the service may be broken or shutdown.

Update from your comment:
If there is no way to have even one confirmed address beyond the router to check if that network is reachable, you should consider classical methods: Setup Network-Management on the routers and work towards a web-based tracking framework.

3
  • Apologies, I should have stipulated - there isn't a server at each branch as such, just a router configured to be part of the WAN - unless the router qualifies as a 'server'. So there is no software availability to check - right? Just whether or not the router is 'available' to 'route connections'?
    – Chris
    Apr 17, 2012 at 13:02
  • In that case, a better test would be to ping a machine 'behind' each router -- to confirm that it is alive itself and also 'routing'.
    – nik
    Apr 17, 2012 at 13:35
  • Good idea. Trouble is computers are dynamically assigned IP addresses (and they're all turned off at night). I could scan 192.168.1.1-255 until I got a reply, but there's no way for my program to know if a PC has just been turned off or rebooted during the day or if the connection has dropped, I don't think?
    – Anonymous
    Apr 17, 2012 at 13:47
1

In my opinion, yo really want a richer test that ensures some of the services (www, file share, etc) are available. Ping only tells you the base OS is running. There are free tools like Nagios, ZenOSS & monit that do this already.

1

You may want to investigate some type of SNMP software - it's designed for exactly what you want to do. Net SNMP is open source and quite popular.

1

Because you are checking clients that have unknown IPs, you might need to install an agent on them to 'check in' to a master (SNMP/WMI) seem like the best solution. You can schedule jobs to query back to the master using the OS scheduler (cron, at, etc). For example, your php script on the master might accept parameters like so:

http://master/collector-script.php?ip=1.2.3.4&id=computer12

Schedule a curl or wget, etc using cygwin on windows to hit that URI. The collector script would keep all of this in a database and if X minutes goes by without a response from one of the computers, it could send you an email. You could write something like this in under an hour, but they sell software that does this too.

However, if you wanted to simply test outbound random services, here are some other solutions:

Is my website up? For example, a simple page that you can curl and check if the response was a 200 (OK), with the expected data. But you would also want to know what the response time was. Is it taking 200ms or 20s to give you the answer?

A simple database query on a php page could test the database service as well as a web page and the php service.

WMI/SNMP is one way to pull various tidbits of info about the operating system. For example, CPU usage, disk space, running processes, etc. Of the two SNMP might be easier to implement.

Also, ping is a slice in time. It tells you that this particular slice in time responded, but it doesn't tell you about everything between the pings. If you are windows, and all you want to see is if the OS/networking is up on a remote host, you could try one of these 2 utilities:

http://www.pingplotter.com/freeware.html http://en.wikipedia.org/wiki/PathPing

These give a picture of network health too. Linux has similar tools too, such as:

httping -h hostname.com

Which will send an http request to any port you desire.

Of course there is also the trusty telnet:

telnet yoursite.com 80

Be careful though too, often pings are blocked for security reasons, so it's possible that you won't get a response. Host firewalls could block the pings, too.

0

Depends on what you mean by available: pinging does verify the connection to the physical server but not the server software and its ability to respond to incoming requests. The timeouts could come from dropped pings anywhere between the source and the server. A traceroute (tracert, in Windows) will show you where pings are being dropped. Neither will tell you about your server's (software's) responsiveness.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .