Job Management Partner 1/Software Distribution Administrator's Guide Volume 2

[Contents][Glossary][Index][Back][Next]

4.22 dcmstsw.exe (monitoring the job status)

This section explains the dcmstsw command that monitors the job execution status. You can execute this command on the managing server for JP1/Software Distribution Manager and JP1/Software Distribution Client (relay system).

Organization of this section
(1) Function
(2) Format
(3) Arguments
(4) Parameters in a parameter file and corresponding command arguments
(5) Command format not using a parameter file
(6) Return codes
(7) Notes
(8) Example

(1) Function

In the managing server, this command monitors the execution status of the job that is specified in a parameter file or in a command line, and starts an external program when a specified execution status is reached.

(2) Format

dcmstsw.exe [monitoring-interval] [monitoring-condition] /i parameter-filename
            [/LC {ON|OFF}]

(3) Arguments

(4) Parameters in a parameter file and corresponding command arguments

You can also use command arguments to specify the template used for exporting and outputting file format instead of specifying these parameters in a parameter file. The table below shows the correspondence between the contents of a parameter file and the command arguments.

Table 4-20 Correspondence between parameter file contents and arguments (dcmstsw command)

Parameter file specification contents Description Specification Command argument
Tag Parameter
JOB_ATTRIBUTE job_generator Job name X --
jobno Job number R /jn value
job_folder Job folder path O#1 /l value
unsuspended Whether a distribution being suspended exists X --
USER_PROGRAM_INSTALLATION_CONDITIONS external_program_executed_before_installation External program executed before installation (collection) X --
external_program_executed_after_installation External program executed after installation (collection) X --
external_program_error_handler External program error handler X --
external_program_handler External program handler R /ep value
exit Notification method for the results of an external program X --
action Disposition of processing error X --
wait Monitoring method X --
timeout Maximum execution limit O#2 /wt value
wait_code Wait code O#3 /wc value

Legend:
R: required.
O: optional.
X: not required (ignored if specified).
--: Cannot be specified in a command argument.

#1
The default is to monitor the job execution status by searching all folders or files at and below the root folder level.

#2
Specify a value greater than the monitoring interval. The default is 86,400 seconds (1 day).

#3
Specify either job execution status or maintenance code. A job execution status, however, can be specified only for a managing server for JP1/Software Distribution Manager. If you specify a job execution status for JP1/Software Distribution Client (relay system), an error occurs and return code 3 is returned.
Specify either Job status or Maintenance code. For details about the values that can be specified, see 4.26.21 USER_PROGRAM_INSTALLATION_CONDITIONS (specifying an external program).
This parameter is optional on the managing server for JP1/Software Distribution Manager. The default is to execute an external program upon the occurrence of a job execution error.
This parameter cannot be omitted on the managing server for JP1/Software Distribution Client (relay system).

(5) Command format not using a parameter file

The following is the command format to be used when an argument only is specified without using a parameter file:

dcmstsw.exe [monitoring-interval] [monitoring-condition]
            /jn job-number [/l job-folder-path]
            /ep external-program-handler [/wt maximum-execution-limit] [/wc wait-code]
            [/LC {ON|OFF}]

(6) Return codes

The following explains the return codes that the dcmstsw command may return:

Code Meaning Action
0 Normal termination. None.
1 Unable to open parameter file, or invalid file format. Check the parameter file specification or coding format.
2 Invalid value in command argument. Check the settings for the command argument.
3 Error during connection to managing server, or an execution status was specified in a basic database environment or in JP1/Software Distribution Client (relay system). Check the version of the managing server. If an execution status is specified in the monitoring code, check to see if the managing server is JP1/Software Distribution Manager.
4 Specified external program not found. Check the path for the external program.
5 Maximum execution limit exceeded; job not terminated. Check the job execution status.
12 Other errors occurred. Check the event log.
Possible causes of error include a system error, invalid command argument syntax, and denied processing.

If JP1/Base is linked to manage JP1/Software Distribution users, see 1.3.3 Setting for executing commands.

(7) Notes

(8) Example

The following is an example of executing an external program C:\aaa.exe when all jobs executed in the local managing server have terminated normally, with a command monitoring interval of 5 minutes and a maximum execution limit of 1 hour.

(a) Creating a parameter file

Specify the job number that was output to the result output file for the dcmjexe command in a parameter file as follows:

If the result output file for the dcmjexe command is saved, the file can be specified as a parameter file.

** dcmstsw Parameter File Sample
 
JOB_ATTRIBUTE{
job_generator= invoice-file-0001-collection
jobno= JB02100720481602
job_folder= \batch-definition
}
(b) Command execution

If the result output file from execution of the dcmjexe command is saved in the file C:\DMbat\para\.txt, specify the dcmstsw command as follows:

dcmstsw.exe 300 ALL /i C:\DMbat\para.txt /ep C:\aaa.exe /wt 3600 /wc NORMAL