Try It Yourself: Escalate Alerts
This lab is one of a series of Workflow Engine Labs. In this lab, you will:
-
Use the Workflow Engine to increase the severity of specific alerts, edit their descriptions, and route them to a custom Cookbook.
-
Configure a Cookbook and Cookbook Recipe to process the critical alerts from your alert workflow, and add the Cookbook to a merge group.
-
Use the beta Visualize feature to discover which Cookbook created a Situation.
Examine the Data
Load data into your lab instance and decide how you want to process it.
-
Clean up the data from the previous lab by closing any open alerts and all but one Situation. If there is no open Situation, generate one manually. (See the Mini Lab for instructions on how to do this.)
-
Go to the Collaborate tab of your Situation’s Situation Room. Type
@moog get_lab_events C_Drive
into the comment box to bring in the data for this lab. -
Go to Workbench>Open Alerts. Scroll through the alerts and look at their descriptions and severities. You can see that there are a small number of alerts which are classified as 'Major': a fan failure and some hard drives nearing capacity. There aren’t any alerts listed as 'Critical'.
You are concerned about the alerts which involve C: drives being nearly full, because you want operators to take action quickly when operating system drives might be compromised. You decide to increase the severity of the C: drive nearly full alerts to critical and add the text "CRITICAL" to the alert descriptions. You can use the Workflow Engine to accomplish these tasks.
You decide that you want critical alerts to generate individual Situations right away. You can also use the Workflow Engine to route critical alerts to a custom Cookbook.
Examine the Cookbook Settings
Verify your alert clustering settings and decide how you want to design a Cookbook for critical alerts.
-
In your current configuration, Moogsoft AIOps uses a Cookbook to cluster alerts from the same source. It generates a Situation when there are at least two related alerts. Go to Settings>Algorithms>Cookbooks and select 'Source Cookbook'. You will see that your Cookbook is using a Cookbook Recipe called 'Source'.
-
Go to Settings>Algorithms>Cookbook Recipes and examine the settings for the 'Source' recipe. Verify that the current alert threshold is set to 2. After reviewing the Cookbook and Recipe settings, you decide that you want another Cookbook and Recipe that will process only critical alerts and generate Situations using an alert threshold of 1. This way your critical C Drive alerts will generate Situations immediately.
-
Go to Settings>Algorithms>Merge Groups. Merge groups are a feature of Moogsoft AIOps that control how Situations are managed after they are created. When you have multiple active Cookbooks or Cookbook recipes, alerts can be clustered into multiple situations using different algorithmic rules. By default, Moogsoft AIOps will combine, or merge, Situations that share all or most of their alerts, but you can control this behavior using merge groups.
-
Click on the 'Default Cookbook' merge group. You can see that the Source Cookbook is included in the 'Default Cookbook' merge group. When you build a new Cookbook, you should add it to an existing merge group or create a new merge group. You will make these changes later in the lab.
Define an Alert Workflow
Use the Workflow Engine to define an alert workflow to escalate the C: Drive nearing capacity alerts.
-
Go to Settings>Automation>Workflow Engine>Alert Workflows, and click on 'Add Workflow' in the upper right.
-
At the top right, you can see a slider to make a workflow active or inactive. Leave it set to 'Active'.
-
On the left is a column which you will populate with a series of actions. The first action, 'Delay', is already populated. Leave it set to 0 seconds.
-
Look at the pane on the right. Start building your workflow by giving it a name, 'Escalate C: Drive Alerts.'
-
Describe your workflow so that other users (and you in the future) understand what it does. Fill in the description field with 'Increase severity of C: drive nearly full alerts to critical, edit description, and route to Critical Cookbook.'
-
Use an entry filter to identify only the alerts you want to act on. If you leave the entry filter blank, the Workflow Engine will process every alert. Click on 'Entry Filter, then 'Edit' and 'Add Clause'.
-
Select the 'description' field in the drop-down box, and select the operator 'matches' for a partial or full text string match.
-
You can use regular expression syntax in the next text box to match a variety of text strings. In this case, though, you have decided you only want to escalate the most severe C: drive alerts, so simply enter the full description for those alerts. Type in 'C: Drive Nearing Capacity'.
-
Click 'Apply' and then 'Done'.
Increase Severity to Critical
Add a workflow action to increase alert severity to critical.
-
Click on 'Add Action' at the top of the left column. The right pane will change to show the action definition screen.
-
Enter 'Increase Severity to Critical' in the name text box.
-
The Function section is a drop-down list of functions you can apply to incoming events. You can review how the functions work in the Moogsoft documentation. Choose the 'setSeverity' function.
-
The Arguments section changes depending on the function you choose. For the 'setSeverity' function, you only need to enter the desired severity value, which is 5 for critical. Enter it in the text box.
-
Leaving the forwarding behavior set to 'Always Forward', click 'Save' in the upper right.
-
At this point, you may want to check your work by closing the open Situations and alerts, re-sending the data, and inspecting the severity for the 'C: Drive Nearing Capacity' alerts. Alternatively, you can proceed directly to designing an action to edit the alert descriptions.
Edit the Alert Description
Add a workflow action to prefix alert descriptions with the word 'CRITICAL'.
-
On the Workflow Engine Alert Workflows tab, click on your workflow and then click 'Edit'.
-
Click on 'Add Action' and enter 'Update Description' in the Action Name text box.
-
Choose the 'prependString' function in the dropdown box.
-
Enter 'CRITICAL' in the string text box in the Arguments section.
-
Enter 'description' in the destination text box.
-
Leave the forwarding behavior set to 'Always Forward'.
-
Click 'Save'.
-
Test your results by closing the open alerts and Situations and resending the data using the
@moog get_lab_events C_Drive
ChatOps command.
Route Critical C: Drive Alerts
Add a workflow action to send alerts directly to a custom Cookbook.
-
Add an action named 'Send to Critical Cookbook'.
-
Choose 'forward' as the function and enter 'Critical Cookbook' in the Moolet text box.
-
Leave the forwarding behavior set to 'Always Forward'.
-
Save the workflow.
Set Up a Critical Alerts Cookbook Recipe
Define a Cookbook Recipe to use in a Cookbook which will process the output of your C: Drive alert workflow.
-
Go to Settings>Algorithms>Cookbook Recipes.
-
Click on the plus sign in the lower left corner to add a new recipe.
-
Name it 'Critical Alerts'.
-
In the description text box, enter 'Critical issue affecting $UNIQ(source)'. This Situation Manager Labeler macro will dynamically insert the hostname into the Situation description.
-
Click on the edit pencil next to the Trigger Filter text box, and then click on 'Add Clause'.
-
Choose 'severity' from the first dropdown box, and choose '=' as the operator in the second dropdown box.
-
In the third dropdown box, choose 'Critical' and then click 'Apply' and then 'Done'.
-
Set the Alert Threshold to '1' so that Situations are generated immediately when a critical alert arrives.
-
Go to the Clustering tab, and click on 'Add Field.'
-
Click on the default first field, 'agent'. In the dropdown box that appears on the right, select 'source' to replace it.
-
Make the similarity threshold 100% by moving the slider all the way to the right. This ensures that alerts from different computers will be clustered into different Situations.
-
Click 'Save Changes'.
Set Up the Critical Cookbook
Add the Critical Alerts Cookbook Recipe to a Critical Cookbook that will accept only the output from your C: Drive alert workflow.
-
Go to Setting>Algorithms>Cookbooks and create a new Cookbook.
-
Name it 'Critical Cookbook' and enter 'Process any C: Drive Nearing Capacity alerts' in the description text box.
-
By default, Process Output Of is set to 'AlertBuilder'. If you leave this setting as is and also route alerts to this Cookbook from your C: Drive workflow, it will process each of those alerts twice. Change the setting to 'Other Moolets' and enter 'None' in the Moolet Name text box.
-
Set the entropy threshold to 0 to avoid filtering out any alerts.
-
Set the Cook For time to 30 minutes so that new critical alerts will keep being added to Situations for half an hour.
-
In the Selected Recipes section, move the Critical Alerts recipe into the Selected column, and then save changes.
-
Go to Settings>Algorithms>Cookbook Selection.
-
Make the Critical Cookbook active by clicking on it, clicking on the right arrow, and then clicking on 'Save Changes.'
-
Go to Settings>Algorithms>Merge Groups. Click on 'Default Cookbook'.
-
Click on 'Edit' in the upper right, and then click on 'Add Sigaliser.'
-
Choose 'Critical Cookbook' from the dropdown menu and click on 'Save' to add your Cookbook to the default merge group.
Review Your Results
Verify that all of your changes are working together as you expect.
-
Close any open alerts and all but one Situation. Generate a Situation manually if one does not exist.
-
Resend the data into Moogsoft AIOps using the
@moog get_lab_events C_Drive
ChatOps command. -
Go to the Open Alerts view and examine the alert list.
-
Are the 'C Drive Nearing Capacity Alerts' listed as critical?
-
Do their descriptions include the word 'CRITICAL'?
-
-
Go to the Open Situations view.
-
Examine each critical Situation by clicking on the Situation in the Situation list and then clicking on the Alerts tab. You should see that two of the three critical Alerts have formed their own Situations. The third one has two other alerts affecting the same host. You are curious about how this Situation was generated. Did it pass through the Critical Cookbook?
-
Go to Settings>System Preferences>Labs.
-
Click the checkbox for 'Visualize' under Beta Features.
-
Go back to Workbench>Open Situations and click on the list to open the Situation Room for the critical Situation which has multiple alerts.
-
Refresh your browser window, and you should see a Visualize tab appear in the Situation Room.
-
Click on the Visualize tab and examine the information. You can see that the Critical Alerts Recipe and the Critical Cookbook generated the Situation from your critical alert. Later an automatic "superseding merge" combined it with another Situation.
If you wanted to, you could set up a new merge group to keep Situations from your Critical Cookbook from merging with other Situations. You decide, however, that you like this clustering behavior. Your operators will see a critical C: Drive Situation immediately. As other potentially relevant Situations involving the same host occur, the Situations will merge.
Last updated 2019-10-08 13:45:59 -0400