 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Steve Franklin
Joined: 04 Apr 2008 Posts: 2 Country: United States |
|
problem with script |
|
I am evaluating the 24x7 scheduler. I am trying to get a JAL file to run successfully. My JAL file contains the following:
// Create new job object
Dim job_id, number
Dim return_code, number
JobCreate( job_id )
// Setup properties for the new job
// Specify generic job properties
JobModify( job_id, "NAME", "Activate DB job" )
JobModify( job_id, "DESCRIPTION", "This Activates DB2 databases" )
JobModify( job_id, "JOB_TYPE", "P" )
JobModify( job_id, "ASYNC", "Y" )
JobModify( job_id, "QUEUE", "StwQueue")
// Specify job schedule
JobModify( job_id, "SCHEDULE_TYPE", "O" )
JobModify( job_id, "COMMAND", "activatedb.bat" )
// Enable new job
JobEnable( job_id, TRUE )
JobRun( job_id )
I am opening a command prompt and using the following command to run the JAL above:
24x7 /script example2.jdl
This doesn't seem to create the job or do anything else. I validated the syntax and it is correct. Please help a beginner understand what I am doing wrong.
Thanks
|
|
Fri Apr 04, 2008 2:15 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
Hi Steve,
It sounds like you are confused a little bit. JAL <> JDL
JAL stands for Job Automation Language and this is one of the scripting languages that 24x7 supports for job automation. JAL scripts as well as job automation VBScripts are stored encrypted in the internal job database file.
On contrary JDL stands for Job Definition Language and this is a very limited thing basically less than a handful of commands that can be used to create jobs or modify jobs programmatically. JDL is very feature limited and supported only as a legacy interfaces. Far more powerful programmatic interfaces are available in the form of COM and Java API. A complete JDL example is available in the on-line help file. Check "Using JDL Files" topic for more details. Sample JDL file is also available in the 24x7 install directory, look for example.jdl and jdl.bat files.
Now, to run your JAL sample script, create a new job in 24x7, chose Script type for the job type, choose JAL as a scripting language, paste your script, Finish other job properties as required. Make sure the "detached" property is not checked for this particular job. Click Run Now to run the job.
Don't hesitate to ask if you have further questions.
|
|
Fri Apr 04, 2008 3:08 pm |
|
 |
Steve Franklin
Joined: 04 Apr 2008 Posts: 2 Country: United States |
|
|
|
What I am trying to do is to learn how to create a job without going through the GUI to do it. I want to be able to create a job using the JobCreate command. Can that be done? If yes, please explain. I am confused.
Thank you
|
|
Fri Apr 04, 2008 4:35 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
There are many methods available. How to create a job programmatically depends on the chosen method. Just to give you some ideas.
This is for 24x7 Windows-only Edition
-----------------------
JDL scripting legacy interface - allows to write DOS text file with commands to create new jobs and use them in batch files - example is available in the help and in the example.jdl file
JAL scripting - allows to do lots of things, FTP, file-operations, email-operations, etc....etc....etc... also supports JobXXX commands for creating and manipulatinf jobs programmatically from jobs running within 24x7 - a number of examples is available in the on-line help
DDE legacy interface - Allows to create jobs from programs that support DDE, for example from Excel - example is available in the on-line help
COM interface - allows to create and manage jobs locally and remotely - can be used to connect to any 24x7 server on the network. Can be used in any program supporting COM automation, for example in Visual Basic, VBScript, JSScript and many many other
Java interface - allows to create and manage jobs locally and remotely - can be used to connect to any 24x7 server on the network. Can be used in any Java program.
This is for 24x7 MP Edition
---------------------------------------
Full blown command console that can be used both interactively and in batch files to create and manage local jobs
Cross-platform JavaScript - allows to do lots of things, FTP, file-operations, email-operations, etc....etc....etc... also supports JobXXX commands for creating and manipulatinf jobs programmatically from jobs running within 24x7 - a number of examples is available in the on-line help
COM interface - allows to create and manage jobs locally and remotely - can be used to connect to any 24x7 server on the network. Can be used in any program supporting COM automation, for example in Visual Basic, VBScript, JSScript and many many other.
Java interface - allows to create and manage jobs locally and remotely - can be used to connect to any 24x7 server on the network. Can be used in any Java program.
---------------------------------------
So which method do you prefer? Tell me your preference and I will help you to find description and examples in the on-line help files.
|
|
Fri Apr 04, 2008 4:53 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|