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:
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.
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.
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.
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:
With these files, the agent reads newly added entries and saves its last read position.
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.
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.
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:
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 agent independently and automatically identifies log file templates if they fulfill the following conditions:
Agent | Naming Convention of the Log File Templates |
---|---|
Instance agent |
*<SysID>_<InstNo>*logmon.ini or *<SysID>_ABAP_<InstNo>*logmon.ini |
Host agent |
*logmon.ini |
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 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).