Job Management Partner 1/Asset Information Manager Planning and Setup Guide

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

7.3.1 Executing jamTakeOperationLog.bat

This subsection gives the function, format, options, return value, notes about command execution, and an execution example of jamTakeOperationLog.bat, which outputs all operation log entries using a search pattern. It also explains how to register tasks in Windows Task Scheduler and execute jamTakeOperationLog.bat on a regular basis.

Note that jamTakeOperationLog.bat is stored in the following folder:

asset-information-manager-installation-folder\exe

Organization of this subsection
(1) Function
(2) Format
(3) Options
(4) Return value
(5) Notes on command execution
(6) Execution example
(7) Settings for executing jamTakeOperationLog.bat on a regular basis

(1) Function

jamTakeOperationLog.bat outputs all applicable entries of operation logs to a CSV file using the search pattern registered by the Operation Log List job menu. For details about the provided default search pattern, see 2.7.1(2)(a) Search patterns provided as default patterns in the manual Administrator's Guide. For details about how to register or update search patterns, see 2.7.1(2)(b) Registering or updating a search pattern in the manual Administrator's Guide.

You can also register jamTakeOperationLog.bat in Windows Task Scheduler and execute it on a regular basis. For the settings required for registering jamTakeOperationLog.bat in Task Scheduler, see (7) Settings for executing jamTakeOperationLog.bat on a regular basis.

(2) Format

jamTakeOperationLog.bat -p "search-pattern-name" -f output-file-name -s collection-start-date [-e collection-end-date] [-x extended-output-item]

(3) Options

-p "search-pattern-name"
Specifies the search pattern to be used as the search condition. Specify a registered name. This option is required. If the search pattern name contains a double quotation mark ("), add two additional ones. For example, if the search pattern name is "copy to removable", specify -p """copy to removable""".

-f output-file-name
Specifies a full path to the CSV file to be used for outputting the search result. This option is required.

-s collection-start-date
Specifies the start date for collecting operation logs. This option is required.
You can specify the collection start date using one of the formats shown below. The -s Mx[MDy] and -s Dz options are useful when executing tasks on a regular basis.
  • -s yyyymmdd[hhmm] (where yyyy is an integer between 1900 and 9999)
    Specifies the collection start date. Time can be omitted.
  • -s Mx[MDy] (where x is an integer between 0 and 999, y is an integer between 1 and 31)
    Specifies collection of operation logs beginning with the yth day of x months prior to the task execution date. Day of the month (MDy) can be omitted. If day of the month is omitted, operation logs beginning with the first day of x months prior to the task execution date are collected. For example, to collect operation logs beginning with August 1 when the task execution date is October 1, specify -s M2MD1 or -s M2.
  • -s Dz (where z is an integer between 0 and 999)
    Specifies the collection of operation logs beginning with z days prior to the task execution date. For example, to collect operation logs beginning with September 10 when the task execution date is October 1, specify -s D21.

-e collection-end-date
Specifies the end date for operation log collection. This option can be omitted. If it is omitted, operation logs up to the task execution date are collected. The -e Mx[MDy] and -e Dz options are useful when executing tasks on a regular basis.
Specify the collection end date using one of the following formats:
  • -e yyyymmdd[hhmm] (where yyyy is an integer between 1900 and 9999)
    Specifies the date on which to end collection. Time can be omitted.
  • -e Mx[MDy] (where x is an integer between 0 and 999, y is an integer between 1 and 31)
    Specifies collection of operation logs up to the yth day of x months prior to the task execution date. Day of the month (MDy) can be omitted. If day of the month is omitted, operation logs up to the last day of x months prior to the task execution date are collected. For example, to collect operation logs up to September 30 when the task execution date is October 1, specify -e M1MD30 or -e M1.
  • -e Dz (where z is an integer between 0 and 999)
    Specifies collection of operation logs up to that from z days prior to the task execution date. For example, to collect operation logs up to September 20 when the task execution date is October 1, specify -e D11.

-x extended-output-item
Specifies the item to be output among Group name, User name, and Location in the asset information (AssetInfo) that is assigned from Host name in the operation log. This option can be omitted.
You can specify the extended output item in the format -x extended-output-item-code. You can specify more than one extended output item code.
The following are the extended output item codes:
  • G
    Group name
  • U
    User name
  • L
    Location name
To specify multiple codes, select desired codes consecutively such as -x GUL.
If the same host name occurs more than once in the operation log, information about Group name, User name, and Location name in the first asset information assigned is output.

(4) Return value

Returns one of the following return values:

Return value Description
0 Normal termination.
2 Invalid parameter.
3 The specified search pattern was not found.
4 JP1/Software Distribution connection error occurred.
6 JP1/Software Distribution connection error occurred.
7 Invalid environment.
8 DLL loading error occurred.
9 Error occurred in the operation log output facility.
10 Error occurred during registry information collection.
11 Error occurred during jamscript.exe execution.

If the return value is between 4 and 9 inclusive, check the content of ASTMESn.LOG. If the return value is between 4 and 6 inclusive, a database connection error occurred. Therefore, check the content of ASTCIMn.LOG as well.

(5) Notes on command execution

A user with administrator permissions must execute jamTakeOperationLog.bat.

(6) Execution example

In the following execution example, operation logs that match the search pattern Files copied to external media and the corresponding Group name and User name are output for the period beginning three months prior to the execution date and ending on the day before the execution date. For example, when the task is executed on October 1, 2006, operation logs for the period between July 1, 2006 and September 30, 2006 are output.

 

jamTakeOperationLog.bat -p "copy detected" -f c:\temp\operationlog.csv -s M3 -e D1 -x GU

The period in which to collect operation logs can also be specified using one of the formats listed below besides -s M3 -e D1.

(7) Settings for executing jamTakeOperationLog.bat on a regular basis

To execute jamTakeOperationLog.bat on a regular basis, you need to register the tasks that execute jamTakeOperationLog.bat in Windows Task Scheduler. To enable the command prompt to directly interpret the execution form of jamTakeOperationLog.bat, when registering the task, you need to specify the following in Run on the Task tab in the Properties dialog box:

 

%COMSPEC% /D /S /C "jamTakeOperationLog.bat-execute-form"

jamTakeOperationLog.bat-execute-form is the same as that described in (2). Be sure to enclose the specification in double quotation marks (").

Run specification example
%COMSPEC% /D /S /C ""C:\Program Files\HITACHI\jp1asset\exe\jamTakeOperationLog.bat" -p "copy detected" -f c:\temp\OperationLog.csv -s M3 -e D1"

After registration, %COMSPEC% is replaced with the CMD.EXE execution path.