Start of Content Area

Process documentation Central Monitoring of Files   Locate the document in its SAP Library structure

Purpose

One of the functions of monitoring with SAP NetWeaver management 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 agent is registered, and may be diaplyed 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

In general, an agent can only monitor files of this type for which the user under which the agent is running has read authorization. The agents run under the following users:

      Host agent: SAPadm

      Instance agent: <SID>adm (UNIX) or SAPService<SID> (Microsoft Windows)

Process Flow

The configuration for file monitoring uses log file templates (more information: Structure of the Log File Templates for Monitoring Files). 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 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

Instance agent

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

Host agent

*logmon.ini

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

Agent

Directory of the Log File Templates

Instance agent

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

Host agent

UNIX: /usr/sap/hostctrl/logmon

Microsoft Windows: [drive]:\Program Files\SAP\hostctrl\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 Parameters of the Configuration File SAPCCMSR.INI. 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 Parameters of the Configuration File SAPCCMSR.INI). 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 DelTreeto 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 Infrastructure of the SAP NetWeaver Management Agents Start Page

 

End of Content Area