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:
-
Action definition file for log file trapping
Specify the format of the monitored log file, the retry settings when monitoring fails and any other settings. For details, see Action definition file for log file trapping in 16. Definition Files.
-
Log information definition file (jevlogd.conf)
Specify the maximum size and number of storable log files used for log file trapping. In most circumstances, you can use the default settings.
For details, see Log information definition file in 16. Definition Files.
- Organization of this subsection
(1) Starting a log file trap
To start a log file trap:
-
Create an action definition file for log file trapping.
-
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
-
Edit the action definition file for log file trapping.
-
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
-
Edit the log information definition file (jevlogd.conf).
-
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:
-
Use a log-file trap startup definition file (jevlog_start.conf).
In a log-file trap startup definition file, specify the log file traps that you want to start and the startup options for those log file traps. The log file traps you specify will start automatically when the log file trap management server (daemon) starts.
For details on the log-file trap startup definition file, see Log-file trap startup definition file in 16. Definition Files.
If you use a log-file trap startup definition file, check whether the required log file traps have started by viewing the startup record (KAVA3661-I) and startup results (KAVA3662-I) output to the log-file trap startup execution results log.
-
In Windows, create batch files and use the JP1/Base startup control to set up the batch files.
Create batch files and specify the appropriate jevlogstart command in each file. After that, in the start sequence definition file (JP1SVPRM.DAT), write ReadyCommand= followed by each batch file name specified by full path.
For details on the start sequence definition file, see Start sequence definition file (Windows only) in 16. Definition Files.
-
In UNIX, specify the jbs_start command.
Specify the command so that the log file trapping starts after the event service and the log-file trap management daemon have started.
-
Execute the jevlogstart command as a JP1/AJS job.
(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 you can specify in the LANG environment variable, see 3.4.1 Setting the language (UNIX only).
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