|
In this example, we monitor a LOG file and look for the string "error" in the lines. Every time an "error" is found, we want to trigger a standard PATROL event containing the name of the parameter, that of the LOG file and the name of the application that triggered the alert.
| 1. | Select the Set Alert Actions… command from the menu to run the Alert Actions wizard as shown below. |

Setting an Alert Action on a String Search Object
| 2. | This launches the wizard to set specific Alert Actions, as shown in the screenshot below. |

Selecting the MatchingLineCount Parameter
| 3. | At this step, you want to run an Alert Action every time the matching line is found: |
| ▪ | Select the MatchingLineCount parameter from the list of parameters related to the String search |
| ▪ | Ensure that the thresholds for this parameter are set to ‘1’ so that an alert is triggered every time a line containing the word "error" is found. |
Click Next to carry on with the Alert Actions wizard.

Selecting an Alert
| 4. | Select the type of action to be executed when the MatchingLineCount parameter goes into alert state: |
| ▪ | Check the Trigger a PATROL event box and click Next. |
| ▪ | Enter the message of the PATROL event: Name of the application ; Name of the log file ; The error message (i.e. the line in the LOG file that triggered the alert) |
| ▪ | Enter the text below in the box called Enter the text to be sent with the PATROL Event: |
Application %{APPLICATION_LABEL}: error found in %{PARENT_LABEL}.%{NEWLINE}Error message: %{MORE_INFORMATION}
%{APPLICATION_LABEL} contains the application display name in the PATROL Console.
%{PARENT_LABEL} contains the LOG file display name (it is the parent of the String search in the PATROL Console).
%{NEWLINE} will create a new line in the message.
%{MORE_INFORMATION} contains the entire line in the LOG file that triggered the alert.
|

Setting the Alert Parameters
| 5. | The text sent with the PATROL event will look like this: |
Application myApplication: error found in LOG File: /opt/myApplication/log/myApp*.log.
Error message: [line content]
|
| 6. | click the Next button to get to the final panel of the Alert Actions wizard that summarizes the Alert Actions set for the MatchingLineCount parameter. |

Confirming an Alert Action
In this example you set just one Alert Action, Trigger a PATROL Event, but it would have been possible to set several Alert Actions, such as an OS command that runs a recovery action for the monitored application or writes an annotation to the graph built by the MatchingLineCount parameter with the content of the matching line.
|