About

The Internet Health Monitor consists of a service that regularly pings an internet host and a client program that users can use to check-up on the monitor's status. The monitor keeps a score of the network health and decreases it every time a ping fails and increments it up to a certain value every time a ping succeeds. When the score reaches zero, the monitor performs an action, such as visiting a router's reset web page. Monitoring then pauses for a minute while the device resets before resuming.

The client provides user feedback on the whole process, informing them when the score reaches zero, or if the monitor itself goes offline.

Platform: Microsoft .NET 2.0

License: You are more than welcome to use this to take over the world, just don't come crying to me when that doesn't work out for you. Install at your own risk, don't claim it's your work, and don't charge other people for it.

Download

Documentation

Installation is relatively simple.  A typical installation will just install the client and a complete installation will install both client and service.  You should only install the service on one computer.

The installation will also ask you for basic configuration information - the monitor server for the client and details about the service, emailing and router for the service.

Configuring the Service

In the directory you installed the service, will be a file called MonitorService.exe.config. This is the XML configuration file for the service.  You should touch only the bits below:

configuration\monitorEngine

Contains the settings for the bit that does the actual monitoring.

engine\@timerInterval
The number of milliseconds between pings.
engine\@maxFailures
The score that the monitor will top out at.
engine\@failScore
The amount that the monitor takes from the score after a failed ping.  The reset action is taken after at least @maxFailures ÷ @failScore.
engine\@successScore
The amount that the monitor adds to the score after a successful ping if score < maxFailures.
engine\@resetter
The IDeviceResetter that the monitor will execute on reset.  See Extending the service below.
engine\@pingHost
The domain name or IP address to ping.
engine\@sendEmail
"true" if the service should send an email after a reset; otherwise, "false".
engine\@emailFrom
The address to put in the from field of the email (needs to be a valid style of address)
engine\@emailTo
The address to put in the to field of the email (only 1 address, must be valid)
engine\@emailSmtpServer
The domain name or IP address of the SMTP server to use to send email
httpReset\@url
The HTTP URL to request for a reset (must use the HTTP scheme)
httpReset\@verb
The HTTP verb to use in the reset request
httpReset\@userName
The user name to use in the reset request
httpReset\@password
The password to use in the reset request
configuration\system.diagnostics\source[@name="MonitorEngine"]
Specifies the tracing listeners for the service.  By default the service logs everything to C:\Windows\System32\LogFiles\InternetHealthMonitor\actions.log and resets to the application event log.  Refer to the MSDN documentation for further guidance.
configuration\system.runtime.remoting
The service communicates with clients via .NET remoting.  This section controls its configuration.  You can change application\channels\channel\@port if you would prefer the service to remote over a different TCP port, but otherwise leave it alone.

Configuring the Client

To use the client you must update the configuration file, MonitorClient.exe.config, which can be found in the client's installation directory.  You should change the URL to match your server's details (which is usually only changing the bit where it says 'localhost' to the name of your server).

Using the Client

Once you've configured the client, you can launch it.  It will sit in the notification area and notify you when a reset occurs.  You can click on the icon to see the current score and see a nice linky thing that will force a reset.

Extending the Service

If you're feeling really clever, you can roll your own action to be executed when the monitor resets.  To do this in your preferred .NET language, simply create a new Class Library, referencing MonitorEngine.dll in the Service's installation folder and within that, create a class that implements MonitorEngine.IDeviceResetter.  IDeviceResetter has one method, ResetDevice, which is called by the engine when the score reaches 0.  One instance of IDeviceResetter is used to service all resets during the service's lifetime.