Alert Actions Example

Home  Previous  Next

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, the name of the log file, the content of the line that triggered the alert and the name of the technology.

Before setting the alert action, you will first have to make sure that the thresholds for the MatchingLineCount Parameter is set to. To do so:

1.Right-click the String Search icon and select Thresholds...
EX_AlertAction_SetThresholds1
2.Select the MatchingLineCount parameter and click Next.

EX_AlertAction_SetThresholds2

3.Verify that an alarm is triggered if the value is greater than 1 and execute the Alert Actions "every time a matching line is found".
4.Click Set thresholds.

To Set the Alert Action

1.Right-click the String Search icon and select the Alert Actions… command from the menu to run the Alert Actions wizard:

EX_AlertAction_1Welcome

Selecting the MatchingLineCount Parameter

3.Select the MatchingLineCount parameter and click Next.
4.Select the type of action to be executed when the MatchingLineCount parameter goes into alert state:
Check the Trigger an event box and click Next.
Enter the message of the event: Name of the Group ; 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 event:

%{SEN_GROUP_LABEL}: error found in %{SEN_PARENT_LABEL}.%{SEN_NEWLINE}Error message: %{SEN_LASTMATCHINGLINE}%{SEN_GROUP_LABEL} contains the Group display name in the PATROL Console.
%{SEN_PARENT_LABEL} contains the log file display name (it is the parent of the String search in the PATROL Console).
%{SEN_NEWLINE} will create a new line in the message.
%{SEN_LASTMATCHINGLINE} contains the entire line in the log file that triggered the alert.

EX_AlertAction_3Param

Setting the Alert Parameters

The text sent with the event will look like this:

Group: Lync: error found in Log File: C:\Program Files\Lync\Lync_Error.log
Error message: server connection error - main server is down.

5.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.

In this example you just set one Alert Action, Trigger an event, but it would have been possible to set several Alert Actions, such as a command line 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.