[Home] [Puzzles & Projects] [Delphi Techniques] [Math topics] [Library] [Utilities]
|
|
I wrote this Domain Monitor program shortly after moving this website to a new host and suffering reliability problems. The problems turned out to be transient, but the monitor program exists, so I though I'd post and document it here. After all, I may need it again sometime in the future. The idea is simple, it runs continuously submitting requests for a specified web page at specified intervals and records the results of each request, success or failure. Multiple domains can be monitored, each with it's own set of statostics. Two files are built for each URL monitored: a stats file with summary data, one record for each session that the monitor runs, and an error detail file with the time of each error. The program is controlled by a init file Urls.ini that specifies the required information. There's a General section with email information and a URL section for each web page to be monitored. Here's a sample: [General] ;
senders email address [URL2] Timers are used to trigger each transaction. The tag field of the timer contains the index of the monitorrecs array containing the appropriate statistics information. The completion of the transaction is captured by one of 3 events: Success, failure, Command failure. When the transaction completes a call is made to the UpdateStats procedure. If the stats file exists, the last record is read. If the start-time of the record matches the start-time of the program, the record is deleted and replaced by the current stats record. Otherwise the record is added to the stats file.
|
[Feedback] [Newsletters (subscribe/view)] [About me]Copyright © 2000-2018, Gary Darby All rights reserved. |