Start of Content Area

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

Purpose

One of the functions of CCMS agents is monitoring files. Originally created to monitor log files for particular search patterns (such as ERROR), the function was continually extended and now offers a large number of options for monitoring any files:

      Select the Files that Are to Be Monitored

You can use the name and directory to determine which files are to be monitored. A separate subtree is created in the alert monitor for every file that fulfills this naming condition. If there are no files that match the naming condition, you can optionally have a corresponding alert generated.

      Select the File Content that Is to Be Monitored

You can search in any text files for text patterns. If the log file agent finds the search pattern, an alert is generated (you can define the properties of the alert, such as its color or severity, yourself), and the corresponding line of the monitored file is displayed in the alert monitor.

      Select the General File Properties that Are to Be Monitored

You can monitor the file size, and depending on the configuration, have an alert generated if the size rises above or falls below a defined threshold value. You can also monitor the period of time since the file was last changed.

      Select the Time Periods for the File Monitoring

You can restrict the file monitoring to particular week days, days, months, or times.

The results of the file monitoring are transferred to the central monitoring system with which the CCMS agent is registered, and may be displayed in the alert monitor (more information: Log File Monitoring Monitor). You can also adjust the properties of the nodes in the subtrees for file monitoring.

The file monitoring is especially suited to monitoring log files. You can monitor different 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.

Prerequisites

File monitoring with CCMS agents was extensively revised and extended with Patch Collection 2007/6 of the CCMS agents. You should therefore make sure that you have an agent that has at least this status.

In general, a CCMS agent can only monitor those files that it has permission to read. Depending on the agent, the following condition must be fulfilled for this:

      The SAPCCM4X agent can monitor files to which the user <SID>adm(UNIX) or SAPService<SID>(Microsoft Windows) has access, since the agent must always run under this user.  

      The SAPCCMSR agent can monitor the files that the user under which this agent is running can access.

Process Flow

The configuration for file monitoring uses log file templates (more information: Structure of the Log File Templates of the Log File Agent). These log file templates contain parameters with which you can configure all of the above functions. There are two ways in which you can make sure that the CCMS agent reads the log file templates:

      The log file templates follow a naming convention and are in a particular directory.

The log file agent independently and automatically identifies log file templates if they fulfill the following conditions:

       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 AS Java 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 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

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

      The log file templates are specified in the configuration file of agent SAPCCMSR.INI

The second option is that you can specify the log file template in the SAPCCMSR.INI: Configuration File for the SAP Agents. Use the parameter LogFile to specify a log file template. SAPCCMSR.INI can contain multiple entries of the following format:

LogFile <full path/file name of log file template 1>
LogFile <full path/file name of log file template 2>

The log file templates must be standard files (not links, for example), with a size no larger than 2 kilobytes in size (without comments).

Note

       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 files are no longer monitored, 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

 

 

End of Content Area