Job Management Partner 1/Automatic Job Management System 3 System Design (Work Tasks) Guide
The following provides precautions (items you should know in advance) for using the Monitoring log files job.
- Note
- The Monitoring Log Files job is executed using the log file trap functionality of JP1/Base. Before you execute the Monitoring Log Files job, start the log file trap management service of JP1/Base and the JP1/Base event service. If the log file trap management service of JP1/Base and the JP1/Base event service are not running, the Monitoring Log Files job waits until the services have started before executing. The operating conditions of the Monitoring Log Files job and the files and data that can be monitored depend on the log file trap functionality of JP1/Base. For details about the log file trap functionality, see the Job Management Partner 1/Base User's Guide. To execute a Monitoring Log Files job, you must allocate memory, disk space, and system resources for JP1/Base log file trapping. This is required for every Monitoring Log Files job. To estimate the JP1/Base resource requirements, see the Job Management Partner 1/Base User's Guide.
- Do not monitor log files that might be mounted or unmounted while a job is executed. If you monitor such files, monitoring might not operate normally, or the system might incorrectly assume that a new log file was created and read the file from the beginning.
The following figure gives an overview of the operation of the Monitoring Log Files job.
Figure 7-18 Overview of the operation of the Monitoring Log Files job
Examples of jobnets that use the Monitoring Log Files job are as follows:
- Execute the succeeding job when log data containing a specific character string is written to the log file.
- Monitor multiple log files and execute the succeeding job when log data containing a specific character string is written to one of the log files.
When you define Monitoring Log Files job, specify the name of the log file to be monitored and the character string to be monitored. You can use a regular expression to specify a character string.
The event job ends and the condition is satisfied when the specified log data is written to the log file and the log data is acquired from the log file.
- Cautionary notes
- When SEQ2 is selected as the output format for log files, if a file is renamed more than once during a file search interval, the acquired messages will be lost. For this reason, take care when specifying the file search interval.
If you want to edit a file renamed during monitoring with SEQ2 set, edit it after a new file is created and the specified file search interval elapses.
Figure 7-19 Examples when acquired messages are lost and not lost with SEQ2 selected
- If you want to select SEQ2 as the output format for log files, use one of the environments below that is appropriate for the OS of the host specified as the execution host.
Windows:
- JP1/AJS 08-00 or later
- JP1/Base 08-10 or later
UNIX:
- JP1/AJS 07-00 or later
- JP1/Base 07-00 or later
If you execute a job in any other environment, the job is placed in the Ended abnormally status.
- If you use version 06-00 to 06-71 of JP1/AJS2 - View to view the detailed definition of a job whose file output format is SEQ2, the file output format appears blank. At this time, if you click OK in the Detailed Definition dialog box, all the items defined as SEQ2 are re-defined as SEQ.
- If you specify multiple Monitoring Log Files jobs that reference the same log file (including the syslog), the load on the system is increased by the increased number of accesses to the log file. In this case, we recommend that you use the log file trap service of JP1/Base to define the operation of a single log file trap. Then use the JP1/Base JP1 event conversion facility to define a log file update as a JP1 event, and use the Receive JP1 Event job to monitor the created JP1 event.
- Do not attempt to monitor log files on a Windows network drive or UNIX NFS mount. JP1/AJS3 cannot monitor these files in the event of a network disconnection, and cannot determine whether such files are in use on another system.
- Do not attempt to monitor the following files (if you do, monitoring might not work properly):
- Special files and device files
- Log files containing records with binary data except at the end character of one line
- Files whose exact names are not known beforehand
- If you are monitoring the scheduler log and execute ajsalter -c COPY during monitoring, monitoring will no longer work properly.
- If the target log file is not found when log file monitoring starts, the job continues to search for the target log file until it is found. Therefore, log data that is written to the log file after monitoring starts but before the file is found could fall outside the scope of the Monitoring Log Files job.
- When you execute a Monitoring Log Files job, you can specify an option that abnormally ends the job if the target file is not found. In this case, if the file is not found when monitoring starts, the Monitoring Log Files job ends without searching for the target file.
- An item specified using a regular expression matches the condition if part of the specified character string matches. To require a full match, use a regular expression that explicitly specifies the full name. For information about the use of regular expressions in Windows, see the Job Management Partner 1/Base User's Guide. For information about regular expressions in UNIX, see your UNIX documentation.
- You might want to execute the Monitoring Log Files job as a start condition for a job that uses an OR condition to trap multiple data items. In this case, if log data written to the log file contains the specified data items, the condition is satisfied multiple times for the same log entry. You can avoid this problem by using the AND, OR, and NOT operators as shown in the following example, so that the second and subsequent items are combined with all the prior items.
- Example:
- To monitor Error, Warning, Information, and Notice, specify:
lftpd="Error"; lftpd="Warning":!"Error"; lftpd="Information":!"Error":!"Warning"; lftpd="Notice":!"Error":!"Warning":!"Information";
- When you use a relative path to specify a log file, the current directory is assumed as follows.
In Windows:
system-folder\system32
In UNIX:
Directory where the jajs_spmd command is executed
- In some cases, when several log file monitoring jobs are executed concurrently in Windows, a JP1/Base error message might be output and the jobs may end abnormally. If this occurs, refer to the Job Management Partner 1/Base User's Guide and take the appropriate corrective action for the JP1/Base error message.
Copyright (C) 2009, 2010, Hitachi, Ltd.
Copyright (C) 2009, 2010, Hitachi Solutions, Ltd.