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 ?
|