SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
help needed using remotejobcreate

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
help needed using remotejobcreate
Author Message
Dominic Klein



Joined: 23 Nov 2001
Posts: 132

Post help needed using remotejobcreate Reply with quote

I need advice please ...
I am running a job on a Remote Agent which works fine, but I want to email the results afterwards - the problem being that we are using MAPI and Outlook is not installed on the remote server. So what I am trying to do is create a remote job on the master scheduler which emails the result :

// declare script variables
Dim( job_script, string )
Dim( job_id, number )
Dim( job_definition, string )
Dim( mail_subject String)
Dim(mail_body, String)

command to execute program on remote agent
store results in mail_subject and mail_body

It works up to here ...........................

ConcatEx("JOB_TYPE=S\r\n", &

"SCHEDULE_TYPE=O\r\n", &

"ASYNC=N\r\n", &

"SKIP=N\r\n", &

"DESCRIPTION=This job emails the result to IT and runs on the Master Scheduler\r\n", &

"SCRIPT=MailSend \"NOVA\", \"SCHEDULE12\", \"Dominic Klein\", mail_subject, mail_body", &

"SCRIPT=JAL", &

job_definition )

// create remote job - THIS NEXT LINE FALLS OVER WITH EXIT CODE -1
RemoteJobCreate( "SCHEDULER", job_definition, job_id )

I think the name of the master schedulker is SCHEDULER - how do I know for certain ?


Thu May 16, 2002 11:44 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: help needed using remotejobcreate Reply with quote

There are several different errors in the script and the way you want to it, that's why it doesn't work. First of all the job definition to be created should look like definitions in the job templates (see .INI files in the Templtes subdirectory).

Anyway, I would like to propose a more simple solution:

1. Create script job on the master with the following script

RunJob "your remote job id or name here"
GetRemoteVariable "remote agent name here", "global.mail_subject", subject
GetRemoteVariable "remote agent name here", "global.mail_body", body
MailSend "NOVA", "SCHEDULE12", "Dominic Klein", subject, body

2. In the remote job add at the end

Dim global.mail_subject, string
Dim global.mail_body, string
Set global.mail_subject, "message subject here"
Set global.mail_body, "message you want to send"

3. Set the new job schedule to match the current remote job schedule
Set current remote job schedule to [no schedule]

This way you can transfer any information from remote agents.

: I need advice please ...
: I am running a job on a Remote Agent which works fine, but I want to email
: the results afterwards - the problem being that we are using MAPI and
: Outlook is not installed on the remote server. So what I am trying to do
: is create a remote job on the master scheduler which emails the result :
: // declare script variables
: Dim( job_script, string )
: Dim( job_id, number )
: Dim( job_definition, string )
: Dim( mail_subject String)
: Dim(mail_body, String)

: command to execute program on remote agent
: store results in mail_subject and mail_body

: It works up to here ...........................

: ConcatEx("JOB_TYPE=S\r\n", &

: "SCHEDULE_TYPE=O\r\n", &

: "ASYNC=N\r\n", &

: "SKIP=N\r\n", &

: "DESCRIPTION=This job emails the result to IT and runs on the Master
: Scheduler\r\n", &

: "SCRIPT=MailSend \"NOVA\", \"SCHEDULE12\",
: \"Dominic Klein\", mail_subject, mail_body", &

: "SCRIPT=JAL", &

: job_definition )

: // create remote job - THIS NEXT LINE FALLS OVER WITH EXIT CODE -1
: RemoteJobCreate( "SCHEDULER", job_definition, job_id )

: I think the name of the master schedulker is SCHEDULER - how do I know for
: certain ?

Thu May 16, 2002 12:24 pm View user's profile Send private message
Dominic Klein



Joined: 23 Nov 2001
Posts: 132

Post Re: help needed using remotejobcreate Reply with quote

yes that works really well - I am pleased, thanks v. much

Fri May 17, 2002 6:45 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.