Hitachi

JP1 Version 11 Job Management: Getting Started (Scripting Language)


2.1.8 Defining job execution results and log output information

Job execution results are output to the spool directory. You can reference some of the output information as job execution logs. In the event of a problem, you can collect logs and investigate the cause of the problem. In the environment file, define the output destination and contents of these logs.

The following table lists the types of log information that are output while JP1/Advanced Shell is running, and where each type is stored.

Table 2‒5: Log information output while running JP1/Advanced Shell and the storage locations for the information

Log information

Information that is output

Storage location

Job execution log

Log of batch jobs

Under the spool root directory

System execution log

Comprehensive JP1/Advanced Shell execution log

Directory specified by the LOG_DIR parameter#in the environment file

#

If the parameter is omitted, the default value is used.

The following subsections explain the spool output information and how to define output information for each log.

Organization of this subsection

(1) Defining the spool output information

This subsection explains the spool-related parameters for each output information to be defined.

(a) Determining whether the spool job creation suppression functionality is to be used

The spool job creation suppression functionality enables you to prevent the spool directory's disk space usage from increasing continually. It also eliminates the need to delete unneeded directories and files from the spool directory.

Use the SPOOLJOB_CREATE parameter to enable the spool job creation suppression functionality. For details, see the description in SPOOLJOB_CREATE parameter in the manual JP1/Advanced Shell.

While using the spool job creation suppression functionality, the root job and child jobs will always operate in the minimum output mode.

The spool directory is necessary even when the spool job creation suppression functionality is used.

(b) Defining the path name of the spool root directory

The following parameter is used for defining the path name of the spool root directory:

  • SPOOL_DIR parameter: Defines the path name of the spool root directory.

(c) Changing the spool job directory or file permissions (UNIX only)

When a job is terminated, its execution results are output to the spool job directory created for that job. You can use the following parameters to change the permissions for the directory or the files under that directory:

  • PERMISSION_SPOOLJOB_DIR parameter

    Specify this parameter to change permissions for the spool job directory.

    The default is 700.

  • PERMISSION_SPOOLJOB_FILE parameter

    Specify this parameter to change permissions for the files under the spool job directory.

    The default is 600 (in .DBG files, 666).

(d) Defining the standard output and standard error for spool jobs

When a job is executed, JP1/Advanced Shell's information messages, warning messages, and job execution logs are output in addition to the job execution results. The standard output and the standard error output are output to files under the spool job directory.

Specify the minimum output mode in the following parameter or command option to suppress output of the standard output and the standard error output to files in the spool job directory, in situations such as when you are using only the results of a job with another program.

  • OUTPUT_MODE_ROOT parameter

    Specify the expansion output mode or the minimum output mode for the root job.

  • OUTPUT_MODE_CHILD parameter

    Specify the expansion output mode or the minimum output mode for the child jobs.

  • -m option of the adshexec command

    Specify the expansion output mode or the minimum output mode for the jobs.

  • -m option of the adshscripttool command

    Specify the minimum output mode for the child jobs.

If these parameters and option are omitted, expansion output mode is assumed, in which case the standard output and the standard error are output to files under the spool job directory.

In the minimum output mode, information messages and warning messages of JP1/Advanced Shell are not output to the standard output or the standard error output.Also, when jobs are terminated, job execution logs are not output to the standard error output. In addition, in the minimum output mode, messages whose output is suppressed are not output to the job execution logs under spool job directories.

For details regarding the differences in output messages among the expansion output mode and the minimum output mode, see Suppressing output of information and warning messages to job execution logs in JP1/Advanced Shell.

(2) Defining the information to be output to the job execution log

This subsection explains information related to the job execution log that is to be specified during the environment setup. For details about the information that is output to the job execution log, see 4.2.1 Job execution log.

(a) Defining the types of job execution logs to be output to the standard error

When a job is terminated, the information listed below is output as job execution logs to the standard error. The output job execution logs are displayed on the terminal screen used when the adshexec command is executed, and in JP1/AJS - View's Execution Results Details dialog box.

  • JOBLOG file (Messages indicating the job's execution status, including command execution results and file allocation results)

  • Job definition script

  • Contents of the standard error during job execution

To output only the contents of the standard error during job execution to the standard error, specify the parameter shown in the following to limit the contents of job execution logs to be output:

  • JOBEXECLOG_PRINT parameter

When the job has been executed in the minimum output mode, the job execution log will not be output to the standard error output when the job finishes regardless of the specification of the JOBEXECLOG_PRINT parameter.

(3) Defining the information to be output to the system execution log

The system execution log provides system administrators with a comprehensive execution history of batch jobs.

The log information is output to AdshLog.log under the directory specified by the LOG_DIR parameter in the environment file. The files are swapped (AdshLog_1.log, AdshLog_2.log, ..., AdshLog_N.log) according to conditions (such as maximum file size) specified in parameter settings. Because a new system execution log file is created when log files are swapped, the owner of each file will be the user at the time swapping occurs.

(a) Flow of output to the system execution log

The system execution log is the destination for log information about the batch jobs running in each job controller process. You can specify in the environment files the output destination for the system execution log, as well as parameters that control log file swapping (such as maximum file size and number of files). The following figure shows the flow of output to the system execution log.

Figure 2‒1: Flow of output to the system execution log

[Figure]

The system execution log is created as follows.

  • Messages to be output to the system execution log are collected and output in CSV format.

    For details about the messages that are output, see the description in Message output destinations in the manual JP1/Advanced Shell.

  • In time, log file swapping is performed and a backup is created.

    • Just before it exceeds the file size specified in the LOG_FILE_SIZE parameter in the environment file, the current system execution log file is renamed so that it becomes a backup file, and a new system execution log is created and message output continues to it.

    • The file name of the backup will be AdshLog_N.log (where N is an integer). N is assigned a number in ascending order from the newest backup, starting from 1.

    • The maximum number of backups to be created is specified in the LOG_FILE_CNT parameter in the environment file. When the number of backup files exceeds this value, the oldest backup file is deleted.

(b) Parameters required to output the system execution log

The following parameters are used for outputting system execution logs:

  • LOG_DIR parameter: Defines the path name of the directory to which system execution logs are to be output.

  • LOG_FILE_CNT parameter: Defines the number of files used for backing up system execution logs.

  • LOG_FILE_SIZE parameter: Defines the file size for output of system execution logs.

If multiple users output system execution logs to the same file, the LOG_FILE_CNT and LOG_FILE_SIZE parameter values specified by the last user who starts output of system execution logs take effect. Therefore, we recommend that you use the same value for LOG_FILE_CNT and LOG_FILE_SIZE.

(c) Contents of the system execution log

The following shows an example of a message output to the system execution log:

seqnum=1, date=2013-12-06T10:41:19.242+09:00, pgmid=adshexec, jobid=6, pid=2720, msgid=KNAX0004-I, msg="Job ID=000006, JP1NBQSQueueName=, scheduler job ID="
seqnum=2, date=2013-12-06T10:41:19.250+09:00, pgmid=adshexec, jobid=6, pid=2720, msgid=KNAX0091-I, msg="JOB1 The job started."
seqnum=3, date=2013-12-06T10:41:19.251+09:00, pgmid=adshexec, jobid=6, pid=2720, msgid=KNAX7901-I, msg="The adshexec command will wait for all asynchronous processes at the end of the job."
seqnum=4, date=2013-12-06T10:41:19.251+09:00, pgmid=adshexec, jobid=6, pid=2720, msgid=KNAX7902-I, msg="The adshexec command will run in tty stdin mode."

The following table lists and explains the data items that are added in front of the message texts in the system execution log:

Data items output to the system execution log

Meaning

seqnum

Message's serial number

date

Output date and time (in the format yyyy-mm-ddThh:mm:ss.sssTZD)

pgmid

Program ID

In a job controller, adshexec is output.

jobid

Job ID

pid

Process ID

msgid

Message ID of the output message

msg

Message text of the output message