Hitachi

JP1 Version 12 JP1/Base User's Guide


11.1.2 Setting up a log file trap

The following describes the procedures for starting a log file trap, changing the settings, checking the operating status, checking the settings, and stopping a log file trap. Set up a log file trap in the following files:

Organization of this subsection

(1) Starting a log file trap

To start a log file trap:

  1. Create an action definition file for log file trapping.

  2. Execute the jevlogstart command.

    The log file trapping starts, the ID is output to the standard output or to the syslog file. Take note of this ID as you will need it when stopping a log file trap or updating a definition file.

    Also, you can specify a monitoring target name using the jevlogstart command. After the monitoring target name is specified, use the jevlogstop, jevlogreload, and jevlogstat commands to specify and operate the monitoring target names.

    For details on the jevlogstart command, see jevlogstart in 15. Commands.

(2) Changing a setting

The following describes how to change settings in an action definition file for log file trapping and a log information definition file (jevlogd.conf).

(a) Changing a setting in the action definition file for log file trapping

  1. Edit the action definition file for log file trapping.

  2. Apply the settings.

    If a parameter other than MARKSTR or ACTDEF is modified:

    Restart the log file trapping function. Execute jevlogstop {ID-number|-a monitoring target name}, and then execute the jevlogstart command.

    If the modified parameter is MARKSTR or ACTDEF:

    Execute jevlogreload { ID-number|-a monitoring target name} without stopping log file trapping to apply the settings.

For details on the jevlogstart command, see jevlogstart in 15. Commands.

For details on the jevlogreload command, see jevlogreload in 15. Commands.

(b) Changing a setting in the log information definition file

  1. Edit the log information definition file (jevlogd.conf).

  2. Start the log-file trap management service (daemon).

(3) Checking the operating status

To check the operating status of a log file trap, execute the following command. From the return value, you can verify the status of the log file trap specified by the ID number in the command argument or monitoring target name.

jevlogstat{ID-number|-a monitoring target name}

You can also use the following command to display a list of IDs and monitoring target names of the log file traps in progress:

jevlogstat ALL 

For details on the jevlogstat command, see jevlogstat in 15. Commands.

(4) Checking the settings

To check the action definition information of the active log file trap, execute the following command. The execution result will be displayed on screen in the format of the action definition file for log file trapping.

jbsgetopinfo -o logtrap [-i ID-number|-a monitoring target name]

For details on the jbsgetopinfo command, see jbsgetopinfo in 15. Commands.

(5) Stopping a log file trap

To stop a log file trap, execute the following command:

jevlogstop {ID-number|-a monitoring target name}

To stop all the active log file traps, execute the following command:

jevlogstop ALL

For details on the jevlogstop command, see jevlogstop in 15. Commands.

(6) Starting a log file trap automatically

Upon restarting the system, active log file traps stop and are not restarted automatically. To restart the log file traps automatically when you restart the system, use the following procedure:

(7) Setting the language for log file traps (in UNIX)

You can set the language type for a log file trap by specifying the LANG environment variable when you start the trap. For details on the values that can be specified for the LANG environment variable, see 3.4.2 Setting the language (for UNIX).

The following describes how to specify UTF-8 as the language for log file traps.

(a) Specifying LANG at jevlogstart command execution

You can monitor log information output in UTF-8 encoding by using the jevlogstart command to start a log file trap with UTF-8 specified in the LANG environment variable.

Example of using a script to start a log file trap
#!/bin/sh
LANG=ja_JP.utf8
export LANG
jevlogstart -a abc /home/hitachi/abc.log

(b) Specifying LANG in the log-file trap startup definition file

Specify UTF-8 as the startup LANG value in the START_OPT parameter (for the log file trap management daemon) and the START_OPT_CLS parameter (for a logical host) of the log-file trap startup definition file.

Format of log-file trap startup definition file
START_OPT=[<startup-LANG>] monitored-name:jevlogstart-command-options
START_OPT_CLS=[cluster-ID][<startup-LANG>]monitored-name: jevlogstart-command-options