[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] 24x7 Script Archive


24x7 API - Examples of Using Job Definition Language Commands

1. About This Example
This example demonstrates how to setup 24x7 Scheduler to accept and execute new jobs submitted by using email messages


2. Email Listener Job

First create a job that will check all incoming email messages. Name is as Email Listener. If a message has "Create dynamic job" subject this job will save the attached JDL file (for example: dynamic.jdl) in the default temporary directory (for example: c:\temp) then will run 24x7 command with /SCRIPT  c:\temp\dynamic.jdl parameters.

The 24x7 Scheduler will process previously saved c:\temp\dynamic.jdl file and will create a new job whose definition is specified in this file.

Set Email Listener job to run often, for example every 10 minutes. Specify "email message" with the subject "Create dynamic job" as the job trigger. Make sure to check Save Attachments option. Specify 24x7 /SCRIPT  c:\temp\dynamic.jdl command to be executed after receiving the specified message.

Save changes.

Now you can use the 24x7 Scheduler to dynamically create jobs that will run programs, update database, etc on the remote computer running 24x7 Scheduler. Such dynamic jobs on demand can be created from anywhere in the world. From now on, all you will need is to send an email message with the desired job definition specified in the dynamic.jdl file. Imagine a situation when you are at home and you got an email notice from 24x7 Scheduler running in the office that the job "Overnight data load" failed. You know what you to do, so you can quickly create a new dynamic.jdl file with the Fix It instructions.


3. Example of DYNAMIC.JDL file

; Create new one-time job to run RAS Dial-Up Networking in HOST mode
ADD
; Specify generic job properties
NAME=Dynamic job created via e-mail message
JOB_TYPE=C
SCHEDULE_TYPE=O
START_DATE=01/10/99
START_TIME=10:00
; Run RAS dialer
COMMAND=rasphone.exe
; Wait 5 seconds to allow RAS dialer to initialize
INIT_TIMEOUT=5
; Send keystroke to enter HOST mode then start Listener
SEND_KEYSTROKE=Y
KEYSTROKE={ENTER}{ENTER}
ASYNC=Y
DESCRIPTION=This jobs starts RAS dialer in HOST mode
; Save all changes to submit this new job
SAV