Simple ICMP Service Monitor






3.69/5 (9 votes)
May 26, 2005
3 min read

77759

2141
An example of a moderately useful network utility.
Introduction
This simple lightweight application provides a solution for monitoring access to potentially critical network services.
Background
Working as a Network Administrator in an environment where the number of servers managed is continually growing, I had been looking for a simple utility like this one. I began the project in February and during my research came across FreePing available here. I reworked the UI and put together the source to "clone" it since I had already put in a great deal of effort at that point, and I was still interested in actually seeing how to write the code. FreePing is a nice utility and is available from tools4ever as a free download.
The ICMP class used in this demonstration was graciously provided as open source here. The timer was adapted from Mike Gold's EGG Timer demo which is available here.
How it Works
Once the Start button is pressed, the program reads the ini file and issues a ping for all of the hosts listed in the file. A separate thread is created for each host and it is passed the list view row as a parameter to allow it to control the information for that host's row. Threads are used to keep the user interface from waiting until the scan is completed to regain control.
At the completion of the scan initiation, a new thread is created which calls the Elapsed Time timer. This routine provides the information for the countdown clock located in the upper right portion of the main form. When the timer reaches 0, it is stopped and a call to the Monitors initialization routine is placed. The same routine is accessed by the Start button. This creates the Elapsed time loop needed to repeat the scans on regular intervals.
Points of Interest
This program was a learning experience and is the first application development I have undertaken. (I keep my rookie status.) This program demonstrates techniques for updating listview information, simple ini file creation without using interop services, a demonstration of how to load a CHM help file, and techniques for creating new execution threads.
It was for me a great learning project, which produced an application that I wanted, hopefully it will provide some useful purpose for others as well. The code is documented and should be easy to read but, I'll let you judge.
There is room for improvement, of course and I will be adding some features to the final revision.
History
June 2005
Aesthetics
- Added a toolbar to allow for quick access to the application's functions.
- Added a status bar and a progress bar to communicate with the user.
Functionality
- Re-wrote a large portion of the code, which allowed the correction of minor logic flaws.
- Corrected an error in packet reception which gave false results.
- Added new features to allow the user to adjust some of the program's parameters.
- Help file: updated the help file to reflect the changes.