This section explains the exit program called when an on-demand job ends.
[Windows]
The system searches for the exit program first in mjesexit.bat and then in mjesexit.exe, and calls the exit program found. If mjesexit.bat is found, mjesexit.exe will not be called 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 exit program in the mjes.job.exit.
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/FJSVMJS/usr/lib/mjes |
HP-UX:
/opt/FHPMJS/usr/lib/mjes |
AIX:
/opt/FAIXMJS/usr/lib/mjes |
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:
argc : Number of parameters (9) |
This parameter is used in Systemwalker Operation Manager EE. 0 is set in Systemwalker Operation Manager SE.
Cautions
Under UNIX, the on-demand job end exit is called with job owner privileges. If the -cu option was not used to specify the client user name, the user that starts the qsub command becomes the job owner. Under Windows, the on-demand job end exit is called with the privileges of the service startup account.
The exit program is started as a new process and its end is not waited for. Even if this exit process is not completed, the relevant job is seen to have been completed and the next job in the queue is started.
Even if there is an error in the execution of the exit process, Systemwalker Operation Manager will do nothing.
If an on-demand job end exit exists but is not called for some reason, a message will be output to the SYSLOG/event log.
Program Example
The following are some examples of on-demand job exit programs:
[Windows]
/* If the job completion code is other than "0", the following message is sent to the "MANAGEMENT" server: Job name is ended !! code = completion code */ #include <stdio.h> #include <string.h> #include <process.h> main(int argc, char *argv[]) { char cmdline[256]; int job_code = 0; job_code = atoi(argv[6]); if (job_code != 0) { sprintf(cmdline, "NET SEND MANAGEMENT %s is ended !! code = %s", argv[1], //job name argv[6]); //completion code system(cmdline); } exit(0); }
[Solaris]
/* If the job completion code is other than "0", a message is output to the console. The job name, job number, and the job completion code are output. */ #include <syslog.h> #include <stdio.h> main(int argc, char **argv) { int job_code = 0; job_code = atoi(argv[6]); if (job_code != 0) { openlog("mjes.job.exit", LOG_CONS, LOG_USER); syslog(LOG_WARNING, "WARNING: job end. job_name=%s, job_number=%s, job_code=%s", argv[1], argv[2], argv[6]); closelog(); } exit(0); }