This section explains the exit program used when a job net registered on Jobscheduler ends in Completed, Pseudo-normal, Abended or Canceled.
[Windows]
If the job net ends in Completed or Pseudo-normal, the system searches for the normalexit.bat file first, and then the normalexit.exe file as the exit program. The exit program found will be used. If normalexit.bat is found, normalexit.exe will not be called up even if it exists.
If the job net ends in Abended or Canceled, the system searches for the jobschexit.bat file first, and then the jobschexit.exe file as the exit program. The exit program found will be used. If jobschexit.bat is found, jobschexit.exe will not be called up even if it exists.
If you want to use these exits 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]
If the job net ends in Completed or Pseudo-normal, the system searches for and calls the jobsch.exit.normal file as the exit program.
If the job net ends in Abended or Canceled, the system searches for and calls the jobsch.exit file as the exit program.
If you want to use these exits 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 eight.
This parameter is used in Systemwalker Operation Manager EE.
Information on each job in the job net is stored in the temporary file as shown below. The job name, completion code, and status are stored for each job.
Job name Completion code Status Job name Completion code Status ............ Job name Completion code Status
The following explanations describe each of the types of information shown above:
Depending on execution attributes, the following contents are 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 (numeric number between 0 and 256). Completion code for unexecuted job is 0.
The job status can be specified using one of the following seven strings:
Indicates completed.
Indicates pseudo-normal completion.
Indicates abended.
Indicates canceled.
Indicates the job was not started.
Indicates the job has been paused.
Indicates the job has been disabled.
The temporary file is created in the following directories:
In the work directory under the database directory of Jobscheduler
The name of the completed exit file is created in NMLnnn.tmp (nnn is appended by the system) format and that of the abended exit file is created in NETnnn.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 the completion code of preceding job, the job that ends with the Passed status will be processed as follows:
The job status (waiting /disabled/paused) before being passed will be passed as the job information.
The completion code is 0.
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 job status will be "canceled" regardless of whether the job was actually started.
The completion code is 248 or 249.
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]
If the current job net is operated (for example, disabled or deleted) at the exit, the job net operation may fail. This is because the processing performance is considered and the termination of a job net is not guaranteed when called at the exit. If you need to operate a job net at its exit, retry it for a certain time period as its operation may fail.
Program Example
Below is an example program for the job net abended exit:
[Windows]
/* When a job net abnormal completion occurs, sends the following messages to "MANAGEMENT" server. Job net name is abended !! code = completion code*/ #include <stdio.h> #include <process.h> main(int argc, char *argv[]) { char cmdline[256]; sprintf(cmdline, "NET SEND MANAGEMENT %s is abended !! code = %s", argv[2], //job net name argv[4]); //completion code system(cmdline); unlink(argv[6]); // temp file is deleted exit(0); }
[Solaris]
/* Example program for the job net abended exit (for UNIX), which outputs a job net abnormal completion message with a job net name and completion code to the console */ #include <syslog.h> #include <stdio.h> main(int argc, char **argv) { openlog ("jobsch", LOG_CONS, LOG_USER); syslog (LOG_WARNING, "WARNING: jobnet abnormal end. project=%s, net_name=%s, net_comment=%s, net_code=%s", argv[1], argv[2], argv[3], argv[4]); closelog(); unlink (argv[6]); exit(0); }