Hitachi

JP1 Version 12 JP1/Base User's Guide


jcocmdlog

Organization of this page

Function

The jcocmdlog command is executed on a manager host (i.e. host on which JP1/IM - Manager is installed).

This command outputs a history of commands executed in the Execute Command window of JP1/IM - View, or a history of commands executed by the automated action function. The history is output to the standard output in CSV format.

Format

jcocmdlog [-window]
          [-act]
          [-dir execution-log-directory]
          [-h logical-host-name]
          [-ext]
          [-date {date-time | [start-date-time],[end-date-time]}]

Required execution permission

In Windows: None (If User Account Control (UAC) for Windows is enabled, you must execute the command from the administrator console.)

In UNIX: None.

Command directory

In Windows:

installation-folder\bin\

In UNIX:

/opt/jp1base/bin/

Arguments

-window

Outputs a history of commands executed in the Execute Command window of JP1/IM - View.

-act

Outputs a history of commands executed by the automated action function.

If neither -window or -act option is specified, a history of commands is output for commands executed in the Execute Command window of JP1/IM - View, and for commands executed by the automated action function.

If you use the jcocmddef command (with -actresult OFF) to suppress output, the output result will not contain detailed information. (Only the KAVB2401-I message is output.) Detailed information is output by default, and when output suppression has been disabled by the jcocmddef command (with the -actresult ON option).

-dir execution-log-directory

Directs execution log output to the specified directory. If you omit this option, output is directed to the current execution log.

-h logical-host-name

Specify the logical host if you are using JP1/Base in a cluster system. If you omit this option, the host name set in the environment variable JP1_HOSTNAME is assumed. If the environment variable JP1_HOSTNAME is not set, the physical host name is assumed. If you specify the -dir option, this option is ignored.

-ext

Outputs the reception times for commands executed in the Execute Command window of JP1/IM - View, and for commands executed by the automated action function. The display format is YYYY/MM/DD, hh:mm:ss. The executed command names and messages are enclosed by double quotation marks. If an executed command name or a message contains a double quotation mark, another double quotation mark is added to the right or left of the command name or message. If you do not specify the -ext option, the display format for reception times is YYYY/MM/DD, hh:mm:ss. The executed command names or messages are not enclosed by double quotation marks.

Examples

  • When the -ext option is specified:

    Window,2005/04/01,14:16:23,hostA,"jcochstat -k HELD -n 1003",2420,0,"KAVB2013-I Terminated the ""jcochstat -k HELD -n 1003"" command. pid=2420 terminate code=0"
  • When the -ext option is not specified:

    Window,04/01/05 14:16:23,hostA,jcochstat -k HELD -n 1003,2420,0,KAVB2013-I Terminated the "jcochstat -k HELD -n 1003" command. pid=2420 terminate code=0

-date {date-time | [start-date-time],[end-date-time]}

Specifies a date and time range for log output. If you omit this option, the whole log is output.

Specify the date and time or starting and ending date and time in the format date (YYYYMMDD: years, months, and days) and time (hhmmss: hours, minutes, and seconds) shown below. You can omit the time.

  • -date date-time

    Outputs log data recorded on a specified date or during a specified time period.

    (Example) -date 2005030317

    Outputs log data recorded during the 17th hour on 2005/03/03 (17:00:00 to 17:59:59).

  • -date [start-date-time],[end-date-time]

    Outputs log data recorded during the time period for the specified starting and ending date and time.

    If you omit the time, the following is assumed:

    Start: 000000 (00:00:00)

    End: 235959 (23:59:59)

    • -date start-date-time,end-date-time

      Outputs log data recorded during the time period for the specified starting and ending date and time.

      (Example) -date 2005030317,2005030416

      Outputs log data recorded during the time period from 2005/03/03 17:00:00 to 2005/03/04 16:59:59.

    • -date start-date-time,

      Outputs log data recorded on or after the specified starting date and time.

      (Example) -date 200503031724,

      Outputs log data recorded on or after 2005/03/03 17:24:00.

    • -date ,end-date-time

      Outputs log data recorded on or before the specified ending date and time.

      (Example) -date ,200503031724

      Outputs log data recorded on or before 2005/03/03 17:24:59.

    • -date ,

      This is the same as omitting the -date option. Thus, all log data is output.

Return values

0

Normal end

4

Processing was interrupted because the command execution log file was being used.

-1

Abnormal end

Output format

Command execution results are output in the comma-separated value (CSV) format. The format for each output record is as follows:

execution-type, message-reception-time, command-executing-host-name, executed-command, process-ID, termination-code, message

The execution type value is either Window (indicates that the command was executed in the Execute Command window of JP1/IM - View) or Action (indicates that the command was executed by the automated action function).

There is a maximum of 256 bytes per line of command execution result output. If the output result exceeds 256 bytes, the output is split into multiple lines.

A field that contains no data is simply output as a comma.