Application Scheduler

<< Click to Display Table of Contents >>

Navigation:  Monitoring with EventSentry > System Health Monitoring >

Application Scheduler

You can schedule to run any command-line application from within EventSentry for custom system monitoring. For example, you can use executable files, Perl, Visual Basic Script and other scripting languages to monitor virtually anything.

 

The application scheduler allows you to not only schedule applications at a set date and time, but also to run applications continuously every X minutes. Additionally, EventSentry can also log the output of the application to the event log with a dynamic severity (information or error). See Event Logs for all possible event log records logged by this feature.

 

warning_48

Executables launched with this feature will run under the same security account that the EventSentry agent is running under, the LocalSystem account by default. Take this into consideration when intending to run applications that require access to resources located on the network.

 

Embedded Scripts

The application scheduler can either launch existing scripts that are present on the host, or launch an embedded script.

 

clip0149

 

warning_48

Process and/or scripts launched by the application scheduler feature which display message boxes, license dialogs and similar will not work as they will indefinitely block. For example, this affects some of the Sysinternals utilities which tend to display a license dialog the first time they are run.

 

Scheduling an application to run at set date/time

To schedule an application to run at a preset date and time, for example every day at 3pm, click the plus button next to the schedule list. You will be presented with the following dialog:

 

clip0150

 

Set the Schedule Type to "Regular Schedule", and in the Date & Time area schedule the application to either run on certain weekdays, on certain days of the month or both.

 

The Process Timeout feature allows you to terminate a process if it runs longer than a certain amount  of minutes. Set this option to 0 (minutes) to let processes run until they terminate on their own.

 

Specify the file to be executed in the Filename field. You can either specify or select an existing script with the "Browse" button, or select an embedded script with the drop-down menu. Embedded scripts are specified with the @ symbol in front of the file, as shown in the screenshot above.

 

When Terminate child processes is checked, then all child processes that have been launched by Filename will be terminated recursively.

 

Scheduling an application to run periodically

To schedule an application to run continuously, for example every 5 minutes, click the plus button next to the schedule list. You will be presented with the following dialog:

 

clip0151

 

Set the Schedule Type to "Recurring Schedule" and configure the Recurring Schedule accordingly. You can further restrict the schedule and only have the application run during certain time period, for example between 8AM and 5PM.

 

Changing an Existing Schedule

You can change existing schedules by double-clicking on the entries in the schedule list.

 

info_48

When launching a script (e.g. VBScript), then it is recommended that point the Filename field to the scripting engine (e.g. cscript.exe) with the script file as the argument. For example

 

c:\windows\system32\cscript.exe c:\batch\files_count.vbs

 

to execute the file c:\batch\files_count.vbs.

 

Application Return Codes

If you want to take advantage of the return code analysis then it is recommend that you either call executable applications directly (e.g. ping.exe) or invoke scripts using a scripting engine that let you specify the return code (e.g. VBScript using cscript.exe). It is not recommended that you use batch files if the application return code is of significance.

 

If you check the "Log application return code 0 to event log", then EventSentry will log an information event showing the text output of the script you ran to the Application event log.

 

If you check the "Log application return code > 0 to event log", then EventSentry will log an error event showing the text output of the script you ran to the Application event log.

 

The next chapter, "Example Scripts", lists Visual Basic scripts that would work well with the Application Scheduler feature.