SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Remote job dependencies

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Remote job dependencies
Author Message
Greig



Joined: 15 Mar 2001
Posts: 49

Post Remote job dependencies Reply with quote

For jobs with dependencies, I have my JAL scripts examine the exit code of a process and create a semaphore file if they are successful (the file is created using JAL - I find this more flexible than using the "Create semaphore on completion" property) and send an email if unsuccessful. This has worked very well.

Now I wish to use a remote agent to run jobs and I need to be able to tell that a process has completed with an error (non zero exit code) or has completed without error. Can I do this using only JAL? The remote processes can run for hours, so the master scheduler has to run them asynchronously.

Thu May 10, 2001 10:55 am View user's profile Send private message
Jeremy



Joined: 06 Dec 2000
Posts: 17

Post Re: Remote job dependencies Reply with quote

I solve this problem by having the remote job drop a semaphore on the master scheduler using the UNC. In the main job on the master scheduler, I start the asynchronous remote jobs and then have it loop watching for the semaphore files to be dropped and react as needed.

: For jobs with dependencies, I have my JAL scripts examine the exit code of a
: process and create a semaphore file if they are successful (the file is
: created using JAL - I find this more flexible than using the "Create
: semaphore on completion" property) and send an email if unsuccessful.
: This has worked very well.

: Now I wish to use a remote agent to run jobs and I need to be able to tell
: that a process has completed with an error (non zero exit code) or has
: completed without error. Can I do this using only JAL? The remote
: processes can run for hours, so the master scheduler has to run them
: asynchronously.

Thu May 10, 2001 11:13 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Remote job dependencies Reply with quote

Setup 2 jobs: one is the main job to be ran on the remote host an asynchronous job, and another is to watch for a semaphore file. In the remote job you will analyze exit code and create some file which then you wil send back to the main scheduler using FileTransfer statement. Your second job will watch for that file and when found read it and depending on the file contents do you need to do. The file contents is up to you and can be something simple as OK or FAIL or more complicated such as a dynamic script that can be later executed on the main scheduler using @SCRIPT tag.

For this scenario, make sure to run main scheduler as a server in the Master mode, also make sure to specify different port numbers for the Agent and Master. On the remote, create a profile that will point to the master and thus will allow backward connection from Agent to Master.

Another approach is to use GetRemoteVariable/SetRemoteVariable statements instead of transferring files so that when the job is complete on the agent it calls SetRemoteVariable to set some global variable on the master. Your other job would periodically check that variable. Although this method sounds simpler than using files but it will cause more load on the master.

Good luck

: For jobs with dependencies, I have my JAL scripts examine the exit code of a
: process and create a semaphore file if they are successful (the file is
: created using JAL - I find this more flexible than using the "Create
: semaphore on completion" property) and send an email if unsuccessful.
: This has worked very well.

: Now I wish to use a remote agent to run jobs and I need to be able to tell
: that a process has completed with an error (non zero exit code) or has
: completed without error. Can I do this using only JAL? The remote
: processes can run for hours, so the master scheduler has to run them
: asynchronously.

Thu May 10, 2001 11:21 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Remote job dependencies Reply with quote

Thanks, for help. I send a similar suggestion, but it took me longer than it took for you.

By the way, this thing will be easier in version 3, which will support process exit code conditions, support JobRemoteRun in asynchronous jobs, and also support scripts in notification events so you can put complete business logic into a single job.

: I solve this problem by having the remote job drop a semaphore on the master
: scheduler using the UNC. In the main job on the master scheduler, I start
: the asynchronous remote jobs and then have it loop watching for the
: semaphore files to be dropped and react as needed.

Thu May 10, 2001 11:28 am View user's profile Send private message
Greig



Joined: 15 Mar 2001
Posts: 49

Post Re: Remote job dependencies Reply with quote

Can the Master act as an agent for the remote agent to FileTransfer to, or are you suggesting I have a second agent running on the master machine to enable this transfer.

I did think about using global variables to indicate success or failure. Could you explain further why this will have load implications (do you mean that running a job to check the variable will cost more that the file watch trigger?).

I cannot use UNC because the two machines cannot see each other. Also, when is version 3 likely to be released.

Thank you for your assistance.

: Setup 2 jobs: one is the main job to be ran on the remote host an
: asynchronous job, and another is to watch for a semaphore file. In the
: remote job you will analyze exit code and create some file which then you
: wil send back to the main scheduler using FileTransfer statement. Your
: second job will watch for that file and when found read it and depending
: on the file contents do you need to do. The file contents is up to you and
: can be something simple as OK or FAIL or more complicated such as a
: dynamic script that can be later executed on the main scheduler using
: @SCRIPT tag.

: For this scenario, make sure to run main scheduler as a server in the Master
: mode, also make sure to specify different port numbers for the Agent and
: Master. On the remote, create a profile that will point to the master and
: thus will allow backward connection from Agent to Master.

: Another approach is to use GetRemoteVariable/SetRemoteVariable statements
: instead of transferring files so that when the job is complete on the
: agent it calls SetRemoteVariable to set some global variable on the
: master. Your other job would periodically check that variable. Although
: this method sounds simpler than using files but it will cause more load on
: the master.

: Good luck

Thu May 10, 2001 11:39 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Remote job dependencies Reply with quote

: Can the Master act as an agent for the remote agent to FileTransfer to, or
: are you suggesting I have a second agent running on the master machine to
: enable this transfer.

Sure, it can. It is the same server component.

: I did think about using global variables to indicate success or failure.
: Could you explain further why this will have load implications (do you
: mean that running a job to check the variable will cost more that the file
: watch trigger?).

You are right, checking value of (i.e., getting and settings) a global variable "cost more" than checking for a file in this case.

: I cannot use UNC because the two machines cannot see each other. Also, when
: is version 3 likely to be released.

I guess it will be available sometime next week.

: Thank you for your assistance.

Thu May 10, 2001 12:27 pm View user's profile Send private message
Greig



Joined: 15 Mar 2001
Posts: 49

Post Re: Remote job dependencies Reply with quote

I have tried this out and when the remote agent tries to FileTransfer the file back to the master, this fails. The trace on the agent states that it was unable to connect to the server, suggesting it wasn't started. The configuration details are definately correct.

: Sure, it can. It is the same server component.

: You are right, checking value of (i.e., getting and settings) a global
: variable "cost more" than checking for a file in this case.

: I guess it will be available sometime next week.

Fri May 11, 2001 5:38 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Remote job dependencies Reply with quote

Is the main scheduler running in the Master mode (e.i. "multi-instance synchronization" is enabled)?, If yes, does it listen on the same or different port?

: I have tried this out and when the remote agent tries to FileTransfer the
: file back to the master, this fails. The trace on the agent states that it
: was unable to connect to the server, suggesting it wasn't started. The
: configuration details are definately correct.

Fri May 11, 2001 7:40 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.