Entering content frame

Process documentation Monitoring Log Files with CCMS Agents Locate the document in its SAP Library structure

Purpose

One of the functions of CCMS agents is monitoring log files. You can use this log file agent, which is integrated into all agents, to monitor log files for particular search patterns, the last change time, or for their existence. This means that you can search any text files (such as database alert logs or ITS log files) for any text patterns, assign alerts to them, and display the results in the Alert Monitor.

If the agent finds the line for which it is searching, it transfers it to the central monitoring system. You decide the details of the message using entries in the configuration file of the log file agent:

     Color and severity of the alert or the message

     Assigned message

     Assigned analysis method and auto-reaction method (local and central)

     Specifications about the position in the alert monitoring tree

In addition, you can monitor the existence and the last change date of particular log files, or display lines that contain a certain search pattern in the Alert Monitor.

Prerequisites

In general, a CCMS agent can only monitor those files that it has permission to read. In the case of the SAPCCM4Xagent, these are the files to which the <SID>adm user (UNIX) or the SAPService<SID> (Microsoft Windows) has access to, as this agent must always run under this user. In the case of the SAPCCMSR agent, these are the files that the user under which the agent is running has permission to read.

Process Flow

You can use CCMS agents to monitor the following types of log files:

     Log files that are continuously written by the application and are therefore constantly growing  (such as the Oracle alert log alert_<SID>.log)

With these files, the agent reads newly added entries and saves its last read position.

     Log files that are rewritten under the same name by the application after each restart (such as the dev_w* files of the SAP application server)

With these files, the agent reads newly added entries and saves its last read position. Due to the smaller size of the log file, it automatically recognizes the restart of an application and in this case starts reading from the start of the file again.

     Log files that are created by the application with a new name each time (such as brbackup, brconnect, and so on).

The agent reads newly added entries and saves its last read position. It automatically recognizes the newest log files of a type, so that the current log file can always be monitored.

You can activate log file monitoring in the CCMS Agent configuration file SAPCCMSR.INI. Use the parameter LogFile, to specify a configuration file for each file to be monitored that contains the details of the monitoring (Log File Template). SAPCCMSR.INI can contain multiple entries with the following format:

LogFile <Full file name of the configuration file 1>
LogFile <Full file name of the configuration file 2>

Note

For each log file template, you can specify a search criterion for the name of a log file (that can apply to more than one log file) and various text patterns that are to be monitored.

The log file agent also automatically detects log file templates, if they meet the following conditions; therefore, you do not need to specify these log file templates in SAPCCMSR.INI:

     The names of the templates follow the following naming conventions for each agent:

Agent

Naming Convention of the Log File Templates

SAPCCMSR
SAPCM3X

*logmon.ini

SAPCCMSR –j2ee

*<SysID>_<InstNo>*logmon.ini

SAPCCM4X

*<SysID>_ABAP_<InstNo>*logmon.ini

Note

<SysID> and <InstNo> are the system ID and the instance number of the monitored ABAP or Java instance. The J2EE Engine automatically generates suitable templates and stores these in the specified (cross-instance) directory. Since the shared memory of the CCMS agents SAPCCMSR –j2ee and SAPCCM4X are only to contain the log monitoring tree for the monitored Engine (ABAP or Java), system ID and instance number are part of the naming convention for the templates.

This ensures that each SAPCCMSR –j2ee agent only monitors the log files of its own Java instance. It also means that in the case of an ABAP+Java system, that the SAPCCM4X agent only monitors the log files of the associated ABAP instance.

     The templates are standard files (not links, for example), and are not larger than 2 kilobytes in size (without comments).

     The templates are in the following folders, depending on the type of the agent:

Agent

Directory of the Log File Templates

SAPCCMSR –j2ee

UNIX: /usr/sap/ccms/<SysID>_<InstNo>/logmon

Microsoft Windows: [drive]:\usr\sap\ccms\<SysID>_<InstNo>\logmon

SAPCCM4X

$DIR_LOGGING\logmon, that is, by default <instance directory>\log\logmon

SAPCCMSR
SAPCM3X

UNIX: /usr/sap/tmp/logmon

Windows: [drive]:\usr\sap\prfclog\logmon

This graphic is explained in the accompanying text

You can also use the parameter LogFileDir in SAPCCMSR.INI to set the folder in which the log file agent automatically detects log file templates yourself (see SAPCCMSR.INI: Configuration File for the CCMS Agents). However, since this means that the log file templates in the standard directory are no longer read, and the corresponding log files are no longer mentioned, we do not recommend this procedure.

You can use the optional entry LogFileParam DelTree to specify that subtrees should be deleted in the Alert Monitor if the associated log files no longer exist.

Example

See Example Log File Templates

This graphic is explained in the accompanying text CCMS Agents, Advanced Functions of the CCMS Agents start page

 

Leaving content frame