|Using ipMonitor's External Process Monitor and two ipMonitor utilities (sem_check.exe and sem_stamp.exe), it is possible to ensure that a task scheduled using the Windows Task Scheduler has run.|
Microsoft's Task Scheduler comes preinstalled with your Windows system. You can find it in the Control Panel.
Using the Task Scheduler, you can schedule a variety of tasks and system tools. Nearly any application or script (batch file) can be scheduled to run daily, weekly, monthly or at certain times (i.e. on system boot, user logon or system idle). The Task Scheduler automatically launches when you start Windows, and runs in the background.
To learn more about the Windows Task Scheduler, refer to the following links:
Before configuring the External Process Monitor or creating the desired task, proceed with the following:
|Click the ZIP icon to download resources designed to be used with this tutorial. The ZIP file includes two small executable utilities (sem_check.exe and sem_stamp.exe) and text instructions for configuring the task's timing parameters to work with those utilities.|
|Click the XML icon to download a preconfigured Monitor to be used with this tutorial.|
|Click the PDF icon to open a printable PDF version of this tutorial. It includes all the information found here, including images from the ipMonitor software, diagrams, and links to additional resources.|
|Monitor Name||Exec:: Task file|
|Monitor Type||External Process Monitor|
|Returns||Timing state (expired or valid) of the file generated by the scheduled task.|
|Monitoring Condition||Expected Return Value: 0
Monitor failure indicates that the file is older than 24 hours.
Note: Imported Monitors are initially disabled. This allows you to make changes to the default settings before the Monitor is enabled to go live in a production environment. Once the Monitor is imported, the following settings will need to be verified (and if necessary, modified) for the Monitor:
To learn more about modifying the above parameters, please refer to the ipMonitor Host System Setup section of this tutorial.
For detailed instructions regarding importing XML files into your ipMonitor installation, please refer to the tutorial entitled "How to Import and Export Configuration Settings".
In order to monitor a configured task on a remote system, proceed with the following setup instructions:
Note: The sem_stamp.exe executable will create a small file containing a time stamp. This is the file that will be monitored using the External Process Monitor.
The following example illustrates a batch file created to launch the scheduled task "robocopy". The sem_stamp.exe executable will then create a file named taskfile.txt under the \logs folder previously created.
NET USE \\remoteserver\IPC$ /USER:userid password
ROBOCOPY \\remoteserver\sourcepath \\localserver\destpath
NET USE \\remoteserver\IPC$ /DEL
Proceed with the following setup on the ipMonitor host machine after you've set up the desired task using Windows Task Scheduler on the remote system, as well as the batch file:
Note: For the purposes of this tutorial, we'll be referring to the preconfigured Monitor included in the XML resource download. Alternatively, you can create a new Monitor by clicking the Monitors menu option and then selecting Add a Monitor. Choose the External Process Monitor from the Windows Based category.
If using Windows 2000, the directory to enter would be c:\winnt\system32.
ipMonitor's flexible timing parameters provide the ability to intensify or lessen testing during each of a Monitor's four testing states: Up , Warn, Down and Lost. The Notification Control section determines how many test failures must occur before an Alert is sent, as well as the maximum number of Alerts that will be sent.
The timing parameters outlined below are recommendations only. You may have to alter them to suit your network environment.
The example outlined in this tutorial is based on a task scheduled to run every 24 hours. However, the utilities provided are flexible, allowing you to adapt them to multiple scenarios.
If you run the ipMonitor utilities without any switches, you will be presented with the options available for each. For some scenarios, both utilities need to be used with a switch.
To monitor a task scheduled to run every hour:
This setup will allow the file to be stale for no more then 60 minutes. If the 60-minute time period is exceeded, the Monitor will fail. Please note that you will also have to adjust the timing parameters of the Monitor to have it poll at least once every hour.
To monitor a task scheduled to run every week:
To monitor a task scheduled to run every month:
You may want to consider implementing a Maintenance Schedule in order to have the External Process Monitor enabled only once a month, or once a week, as needed.
For more information regarding the External Process Monitor, refer to the Monitors section of ipMonitor's Context-Sensitive Help system, then select Monitor Types, followed by External Process. The Context-Sensitive Help can be accessed by clicking the Help link located in the top right corner of ipMonitor's Administration web interface.
For information on other features and concepts related to those discussed in this article, refer to the following ipMonitor resources:
Last Updated: April 4, 2006 | What did you think of this topic?