Indication PolicyIndication and Hybrid PolicyThe Indication Policy is used to define two major types of Policies:
The main difference of these two types is that Hybrid policies are excluded from the global message filtering and only used for processing the output of the defined trigger. An Indication Policy becomes a Hybrid Policy when the "Type" field in the "Nagin trigger" section is not empty. For more information about Hybrid Policies see Chapter Hybrid Indication Policy. Indication Policy Details
Field Description Note: Use CTRL+Space in the policy fields to pop-up the variable list.
ConditionsThe Condition section contains a list of filtering rules for processing the incoming text messages Field Description
Nagin Trigger and LogfileMonitor TypesMandatory Nagin section for the Hybrid Policies, where you have to specify an interval, some trigger parameters and one
of the trigger type:
JAVA, NAGIN, Logfile Monitor, Logfile Transaction Monitor.
Supported Variables<$NAME> - Policy name <$AGENT_ID> <$AGENT_IP> <$AGENT_HOST> <$HOST> || <$MSG_NODE_NAME> || <$MSG_NODE> - hostname if different from Agent hostname <$OBJECT> || <$MSG_OBJECT> <$SEVERITY> || <$MSG_SEV> - one of "unknown","normal","minor","major","critical" <$APPLICATION> || <$MSG_APPL> <$GROUP> || <$MSG_GRP> <$ORIG_TEXT> || <$MSG_ORIG_TEXT> - originally submitted text <$OPTIONS> - prints all available optional variables in the following form: varname=value, ... Optional variables can be used as: <$varname> For more information see Chapter Supported Variables and Functions Indication Policy for SNMP trapsFor setting up an Indication Policy for SNMP traps you have to consider the following points: The SNMP Trap assignment group "SNMP-TrapReceiver" or at least the "SNMP package" and the "SNMPTrapd_Trigger" policy must be assigned to the specified agent to enable trap processing. Do not use a trigger for setting up an indication policy for SNMP traps. That means that the section "Nagin Trigger/LogFileMonitor Details" is not used for a trap indication policy. All conditions must have a filter for: The object field is used to filter the trap OID: OBJECT=<Trap OID> <$1>...<$n> are the trap variables. The "Search Text" field can be used for plain pattern matches on concatenated TrapOID and variables. The "Match Variables" field can be used to construct text from variables and define match conditions. Hint: Use a "stop condition" for non matching traps (e.g. different OID) as first condition. This stops further processing of the incoming trap if the trap doesn't match this condition. In this case the NEGATION flag has to be set to TRUE and Condition Type to STOP.
Indication Policy for SNMP getAn indication policy with trigger is used for fetching strings with SNMP get. Indication policy for Logfile monitorThe Logfile Monitor has flexible possibilities to specify the name of the monitored log file. It supports file masks for finding rotating log files. For setting up an Indication Policy for logfile monitoring (Monitor Type=Logfile Monitor) you have to consider the following points: Set the "Monitor Type" in the "Nagin Trigger/LogFile Monitor details" section to "Logfile Monitor". Interval: The interval specifies how often logfile is checked. Logfile Path: The logfile path contains the path of the monitored file or it can contain a mask for the filename. The latest file matching the mask will be monitored. e.g. /var/webapps/app1/error_*.log Split Records: Split Records allows multi-line processing, because many of the log files contain multi-line entries. It is necessary to have here a Java Pattern that is matching the start of the message. Usually it can be a fixed prefix containing the date, severity, log level, etc. If a logfile has no multi-line entries a simple ".*" (match all) pattern can be used. General Pattern: A Java Pattern as a pre-process filter. This filter allows to reduce the number of messages that must be processed by an Agent. Pattern ".*" matches all lines - that means all entries will be processed. FROM_START: Indicates that the logfile has to be monitored from the begin on every scheduled interval FROM_LAST: The logfile will be scanned from the last processed point. Executable Call: Allows you to specify a trigger that needs to be executed before parsing the logfile. This can be used together with FROM_START parameter to process logfiles re-generated by trigger on every polling interval. This parameter is optional. The following optional parameters are coming with every indication: The example shows an indication policy for a simple logfile with single-line entries.
Indication Policy for Multipath Logfile MonitorsThe Multipath Logfile Monitors are extensions of the Logfile Monitors. The main difference is that the file/path mask is extended to support not only file masks but also path masks. It monitors log file contents for entries of interest. It allows flexible configuration of file rotation policy, specifications of the logfile format and supports pre-processing filter.
The monitor can be configured to monitor a single particular file or a list of logfiles of similar format, or even load a batch list of files to process, provided by an external command.
For setting up an Indication Policy for multipath logfile monitoring (Monitor Type=(MP) Logfile Monitor) you have to consider the following points:
Set the "Monitor Type" in the "Nagin Trigger/LogFile Monitor details" section to "(MP) Logfile Monitor". Logfile Path: The logfile path contains the path of the monitored file.
The path mask syntax is specialized for finding rotating log files. It supports file and path masks and consists of the following rules: • '*' (star) symbol matches any char sequence within path element name. Among all matching files, the file with latest modification time should be taken. This is useful to monitor rotating logfiles, so if logging has switched to another file, the monitor will also pick the newest file (after finishing the previous one). • Several '*' (star) symbols in different path elements (i.e. on different file tree levels) still comprise the same single group for selecting the newest file. • '**' (double star) symbol matches any char sequence within path element name. All matching files should be taken, regardless of modification time. • The path element consisting of exactly double star (like '/**/') specifies recursive scan and matches arbitrary path depth, including zero. • double star overrides single star in the same path element, that is all matching files will be taken. • path starting from wildcard is considered relative to current dir, unless followed by colon on MS Windows. This is reserved as a special notation for selecting all disk drives on MS Windows: *: (is the same as **:). • All slashes and backslashes are treated as file (path element) separators, interim double slashes are reduced to single slash. On MS Windows, network paths starting with double (back-)slash are also recognized. • Several independent patterns can be specified, separated by the ‘|’ (pipe) symbol. Please see the above section "Logfile Monitors" for an explanation of all other parameters. The following optional parameters are coming with every indication: Examples: 1) We have the following directory Structure: /web/logs/error1.log /web/logs/error2.log /web/logs/error3.log /web/logs/error4.log Path/File Mask: /web/logs/error*.log Results: Assuming that the most recent file is "/web/logs/error4.log" this file will be monitored. Explanation: picks a newest (most lately modified) file whose name starts with ‘error’ and ends with ‘.log’ in the directory /web/logs. This is a typical configuration to monitor a rotated log file, e.g. Apache’s logs. 2) We have the following directory Structure: /app/services/errors.log /app/services/warnings.log /app/services/information.log /app/services/debug.log /app/services/exportedfile.txt Path/File Mask: /app/services/**.log Results: /app/services/errors.log /app/services/warnings.log /app/services/information.log /app/services/debug.log Explanation: The Path/File mask selects all files with extension .log in directory /app/services. Unlike the previous example, this pattern assumes no log rotation, and simply selects a bunch of existing files for batch processing. 3) We have the following directory Structure: /var/log/apache/instance1/access_log1 /var/log/apache/instance1/access_log2 /var/log/apache/instance1/access_log3 /var/log/apache/instance1/access_log4 /var/log/apache/instance2/access_log1 /var/log/apache/instance2/access_log2 /var/log/apache/instance2/access_log3 /var/log/apache/instance2/access_log4 /var/log/apache/instance3/access_log1 /var/log/apache/instance3/access_log2 /var/log/apache/instance3/access_log3 /var/log/apache/instance3/access_log4 Path/File Mask: /var/log/apache/instance**/access_log* Results: Assuming that the last logfile of every directory is the newest one the following files would be selected: /var/log/apache/instance1/access_log4 /var/log/apache/instance2/access_log4 /var/log/apache/instance3/access_log4 Explanation: The Path/File mask separates every directory in a virtual group, so 3 groups will be created: Group1: /var/log/apache/instance1/access_log1 /var/log/apache/instance1/access_log2 /var/log/apache/instance1/access_log3 /var/log/apache/instance1/access_log4 Group2: /var/log/apache/instance2/access_log1 /var/log/apache/instance2/access_log2 /var/log/apache/instance2/access_log3 /var/log/apache/instance2/access_log4 Group3: /var/log/apache/instance3/access_log1 /var/log/apache/instance3/access_log2 /var/log/apache/instance3/access_log3 /var/log/apache/instance3/access_log4 Now from every group the most recent file will be selected leaving us with the files specified in "results". So the mask /var/log/apache/instance**/access_log* in our directory structure would be the same as: /var/log/apache/instance1/access_log* /var/log/apache/instance2/access_log* /var/log/apache/instance3/access_log* But the advantage of using "**" is that it is flexible in the number of instances (directories) since they don’t have to be entered manually. 4) We have the following directory Structure: /archive/2011-09-15/outage1.log /archive/2011-09-15/outage2.log /archive/2011-09-15/outage3.log /archive/2011-09-15/error.log /archive/2011-09-16/outage1.log /archive/2011-09-16/outage2.log /archive/2011-09-16/outage3.log /archive/2011-09-16/error.log /archive/2011-09-17/outage1.log /archive/2011-09-17/outage2.log /archive/2011-09-17/outage3.log /archive/2011-09-17/error.log Path/File Mask: /archive/*/outage*.log Results: Assuming that the last logfile of every directory is the newest one the following files would be selected: /archive/2011-09-17/outage3.log Explanation: The Path/File mask selects a newest file named like outageXXX.log among all files in direct subdirectories of directory /archive. This is a more sophisticated example of log rotation policy, e.g. when logs are grouped per sub-directories by date: /archive/ Policy specific logfilesThe policy specific logfile shows information about incoming indications and results of matching/non-matching conditions. Enable/disable policy specific loggingThe Indication policy specific logging will be activated on an Agent for a specified set of policies. The server and the policies on the server are not affected by these settings. This means the policy logging is no global setting for the policies, but an agent specific setting. The logging is switched off and on via a BOOM_AGENTS Action:
SET_PLOG <ON|OFF>
<LOGCOUNT>
<LOGSIZE>
<polName1> [<polName2> ...]
LOGCOUNT: maximum number of logfiles The activation flags will be stored in the policy xml file only on the Agent side as:
<PLOG_ENABLED>true</PLOG_ENABLED>
or
<PLOG_ENABLED>false</PLOG_ENABLED>
Number of Logfiles allowed:
<PLOG_LOGCOUNT>3</PLOG_LOGCOUNT>
Size of each logfile in MB:
<PLOG_LOGSIZE>1</PLOG_LOGSIZE>
Default: 3x1MB = 3MB
Logfiles and contentThe logfiles will be written to the following output directory: <boom_agent>/plogs/Logfile names: <policyName>_<date>_<count>.log Logfile content (separated by space): <date> <result> <conditionUUID> <indi_UUID> <DETAILS> Where <result> is 3 characters code and can be one of the following: NMA - not matched with any condition MSE - matched and sent SUT - suppressed by time SUC - suppressed by count MST - matched and dropped because the condition’s type is STOP If result is NMA, the condition UUID will be "null" The Logfiles will be limited by size and count of Logfiles. Pre-ExecutionIn many cases the input parameters for the NAGIN monitors are different from system to system. It is possible to include in the parameter block following special triggers: 1. <$BOOMMON_ONINIT(<exec string>)> 2. <$BOOMMON_ONSTART(<exec string>)> The "ONINIT trigger" will be resolved during the deployment of the Policy or the restart of the Agent. The "ONSTART trigger" triggers the execution on every start of the NAGIN monitor. The result of the ONINIT and ONSTART triggers will replace the own declaration. ONINIT is supported by JavaMonitors as well, but not ONSTART! |