I’ll be updating this with details from my IRIS project that I’m working on. In short, IRIS is a network device monitor I’m creating in VB.NET. The goal is to be able to monitor network device’s online or offline status utilizing a simple ‘ping’. This tool will be useful for IS or other System Administrators that occasionally find the need to see if a server is down. I will be uploading the source code shortly. I am in need of help to convert the existing, working, project to a multi-threaded application to facilitate scanning multiple groups of devices at one time and also separating the ‘leg work’ from the UI for better user experience.
I’m using Visual Studio 2005 Express and an Access database with a Table for each Device group. I have 3 groups: Device1, Device2, Device3. Each Table has a field for Device Name, IP address, and Notes that are used to populate a “Details” ListView for each Device Group. Each ListView has controls to “Start a Scan”, record online and offline Devices in separate ComboBoxes.
The main form consists of 3 tabs: Options, Devices and Device Data. The Options tab is used for display settings, email and taskbar notifications, file output enable/disable, font and color settings etc. The Devices tab is where the Device groups are loaded into 3 separate ListViews. This is where the actual scan takes place by iterating through the lists 1 Item at a time and pinging it for a response. The Device Data tab consists of 3 DataGridViews used for editing the tables in the database for the corresponding device group.
A scan will iterate through the ListView one item at a time. It pings the device, and sets the Items Forecolor to Green or Red depending on the the response (Up or Down).
At the end of every scan, a text file with the Offline devices, the Online count and the Offline count and uploads it our company’s Intranet Sharepoint site into a Document Library. Then, a Flash file displayed on one of the Sharepoint pages displays the contents of the text file. This makes the results available to everyone so that only one copy of the program needs to be ran. The completion of a scan also sends an email with the same contents of the text file. The email settings are configurable.
Currently, the program works fine! I have all ListViews populating at runtime for each device group. I also have “import” functions to load the device table data into its own DataGridView on the Device Data tab. Scanning works correctly for a list as it iterates through one item at a time, and based on an “accuracy” setting, will ping the device that many times before declaring an offline or online status.
Where I’m Struggling:
I need help converting the current code into multi-thread-friendly code to allow the scanning of multiple device groups simultaneously and allowing for form interaction while a scan is taking place. As it stands now, I am only able to scan one list at a time, and if a lot of devices in a row are down, the Interface will become “frozen” to the user. I want to separate this scanning code from the interface.
Because I have created the program to about 80% completion already, and most of it using the “drag-and-drop” method of adding controls, I am encountering MANY “cross-thread” errors in my attempts to implement threading.
- Recording time device is seen as offline (included in email and web stats)
- Recording length of completed scan
- Recording number of successful scans (within the program)
- Recording number of times device is seen as offline (ie: 5 Failed Attempts)
- Ability to import from spreadsheet
- Audible alarms for all device types (currently I only have audio notifications for Device 1)
- Application-level access prevents devices from being known until logged in
- Several options for sorting, viewing select devices, colors, font sizes
- Output to Excel spreadsheet
- An option to “Import Devices” from a Spreadsheet into the 3 ListViews
I think this will be a valuable tool for many people when completed. I’d like to make it open source, but not sure how all that works (providing source, files, etc. if someone with experience with this could help me out, that’d be great). I would really love to get some very knowledgeable VB and .NET programmers’ input and feedback on this application. Also, at some point, I’d like to “port” this to ASP.NET to run completely via web browser.
I appreciate you taking the time to read all that! If you’re interested in helping or want to send a friendly suggestion or comment, please don’t hesitate!