This section explains the exit program called when a job registered on Jobscheduler ends.
[Windows]
The system searches for the jobexit.bat file first, and then in jobexit.exe as the exit program. The exit program found in the search will be used. If jobexit.bat is found, jobsexit.exe will not be called up even if it exists.
If you want to use this exit to perform custom processing, create an exit program with the same name and store it in the following directory:
<Systemwalker installation directory>\MpWalker.JM\bin |
[UNIX]
The system searches for and calls the jobsch.job.exit file as the exit program.
If you want to use this exit to perform custom processing, create an exit program with the same name and store it in the following directory:
Solaris/Linux:
/opt/FJSVJOBSC/bin |
HP-UX:
/opt/FHPJOBSCH/bin |
AIX:
/usr/FAIXJOBSC/bin |
Appropriate execution privileges are required to execute the exit program. If relevant privileges are not set, the exit program will not be called.
Parameters Passed to the Exit Program
The parameters passed to the exit program are as follows:
|
In Systemwalker Operation Manager EE, the number of parameters is six.
This parameter is used in Systemwalker Operation Manager EE.
In the temporary file, job information is stored as follows:
Job name |
The following explanations describe each of the types of information shown above:
Depending on execution attributes, the following contents are stored.
If a child job net is registered as a job, the name of the child job net will be stored.
If a linked job net is registered as a job, the name of the linked job net will be stored.
This is a job name. If the job name is omitted, the string registered as a command will be stored.
This is a job workunit name.
This is a job workunit name.
This is a command name.
This is a job completion code (0 to 256 characters).
The job status is one of the following four strings.
Indicates completed.
Indicates pseudo-normal completion.
Indicates abended.
Indicates canceled.
The temporary file is created in the following directories:
In the work directory under the database directory of Jobscheduler
The name of the file is created in JOBnnn.tmp (nnn is appended by the system) format.
/var/tmp directory
/tmp directory
Since the temporary file is not deleted on the Jobscheduler side, you must delete it from the exit program.
If the exit is not registered, the temporary file is not created.
About the Job in Passed Status
If the execution condition of the following job is specified in Condition concerning completion code of preceding job, the job end exit will not be activated on a job that ends with the Passed status.
A job that is waiting using the OR condition and is then canceled because of the OR condition of the following job will be processed as follows:
The status of a job that is started and then canceled will be "canceled", and the completion code is 248 or 249.
If a job is canceled without being started, its job end exit is not started.
Cautions
Prevent time-consuming process because it may cause delay of execution for job nets and groups.
The execution user at the exit is the logon account of Jobscheduler service. [Windows]
The execution user at the exit is a root account. [UNIX]
Program Example
Below is an example program for the job end exit:
[Windows]
/* When a job ends, sends the following messages to "MANAGEMENT" server. Job name is ended !! code = completion code */ #include <stdio.h> #include <string.h> #include <process.h> main(int argc, char *argv[]) { FILE *fp; char jobname[100]; char jobcode[100]; char cmdline[256]; errno_t err; err = fopen_s(&fp,argv[4], "r"); fgets(jobname, 99, fp); jobname[strlen(jobname)] = '\0'; fgets(jobcode, 99, fp); jobcode[strlen(jobcode)] = '\0'; fclose(fp); sprintf_s(cmdline,sizeof(cmdline) "NET SEND MANAGEMENT %s is ended !! code = %s", jobname, //job name jobcode); //completion code system(cmdline); _unlink(argv[4]); // temp file is deleted exit(0); }
[Solaris]
/* Example program for the job end exit (for UNIX) which outputs a job completion message with a job name and completion code on the console */ #include <syslog.h> #include <stdio.h> main(int argc, char **argv) { FILE *fp; char jobname[100]; char jobcode[100]; memset (jobname, 0x00, sizeof (jobname)); memset (jobcode, 0x00, sizeof (jobcode)); fp = fopen(argv[4], "r"); fgets(jobname, sizeof (jobname), fp); jobname[strlen(jobname)-1] = '\0'; fgets(jobcode, sizeof(jobcode), fp); jobcode[strlen(jobcode)-1] = '\0'; fclose(fp); openlog ("jobsch", LOG_CONS, LOG_USER); syslog (LOG_WARNING, "WARNING: job end. project=%s, net_name=%s, net_comment=%s, job name=%s, job_code=%s", argv[1], argv[2], argv[3], jobname, jobcode); closelog(); unlink (argv[4]); exit(0); }