|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionHow do you monitor and troubleshoot a legacy system that fails silently? We run nightly batch processes to extract data from a legacy system. These processes fail fairly often without giving any indication that there was a problem. The legacy system is outside our control and is scheduled to be replaced. We have no way of making the system more reliable, but we came up with a simple way to detect failures. There are many commercial software packages for monitoring processes, but we wrote our own because we thought we could write our own monitor in less time than it would take to evaluate third party packages. Our simple solution was adequate for our needs, we understand it thoroughly, and we can customize it however we like. We used to schedule a batch file that would kick off scripts that interact with the legacy system. We replaced the batch file with a PowerShell script, and we inserted a manager application between the scheduled script and the legacy processes. This manager application, called One advantage of using PowerShell to control the process is that it provides far greater diagnostic information when things go wrong. However, the biggest improvement comes from the Using the Code
You can use The SMTP server name is specified in the The program also writes status information to a file RunAndWait.exe.log. RunAndWait.exe requires three arguments in order.
Any additional arguments to RunAndWait.exe are passed on as arguments to the child process. There is no limit on the number of additional arguments. Launching RunAndWait.exe without any arguments will print an explanation of the expected arguments. Example 1RunAndWait.exe 30 0 c:\tools\MyProg.exe
In this example, RunAndWait.exe will launch MyProg.exe, wait 30 minutes, expect a success and expect an exit code of 0. If the program does not complete within 30 minutes, or if the exit code is not 0, email notifications will be sent out and a record written to the log file. Example 2RunAndWait.exe 20 * c:\tools\MyProg.exe myfile.txt
In this example, RunAndWait.exe will launch MyProg.exe with the argument myfile.txt and will wait 20 minutes for the process to run to completion. If the program does not complete within 20 minutes, email notifications will be sent out and a record written to the log file. In this example, the error code is not examined. Points of Interest
History
|
|||||||||||||||||||||||||||||||||||