Solution
Create a custom toolkit dataview listing the managed entity name and snooze status. Next, set up an action for the /SNOOZE:manual and /SNOOZE:unsnooze internal commands. Then, create a rule that uses a path variable in the path alias to reference the snooze status listed in the toolkit dataview. Set up the rule block to trigger the snooze action based the referenced path alias value. Below are the steps to set this up.
Create a custom toolkit dataview listing the managed entity name and snooze status:
Below is an example toolkit dataview called "Managed Entity Status" that lists the managed entity name and snooze status. Notice the state tree shows the managed entities by the same name. Currently the "DashboardTraining_ME" managed entity is snoozed while the "localhost" and "My Geneos Application" managed entities are in critical state.
Set up an action for the /SNOOZE:manual and /SNOOZE:unsnooze internal commands:
In order for the rule to snooze and unsnooze based on the snooze status listed in the "Managed Entity Status" dataview, an action needs to be set up to call these snooze commands.
Below is a screenshot of an action called "to snooze ME" that uses the /SNOOZE:manual internal command to do a manual snooze. Notice this internal command has target argument 1 set with a static value that says "Snoozing via rule." This argument is used to set a comment when snoozing the data item.
Below is a screenshot of an action called "to unsnooze ME" and this uses the /SNOOZE:unsnooze internal command to unsnooze a data item.
Create a rule that uses a path variable in the path alias to reference the snooze status listed in the toolkit dataview:
In this example we have a rule called "snoozing_unsnoozing_ME" with the target xpath set to /geneos/gateway/directory/probe/managedEntity
so it targets every managed entity in the gateway.
Below are the steps to create a path variable that will grab the rule target's managed entity name:
- Go to the Rule's Advanced tab and click "Add new" in the Path variables section
- We will call this path variable "rowName"
- Under the Value section, remove the value "true" and right click on the white space of the Value section and select "Target names" -> "managedEntityName"
Below are the steps to add the above path variable to the path alias for the "Snooze Status" column in the "Managed Entity Status" dataview:
Note this is how we match our rule target's managed entity name with the corresponding "Managed Entity" row to grab its "Snooze Status" value.
- Go to the Rule's Advanced tab and click "Add new" in the Path alias section
- Name the path alias "snoozed_ME"
- Drag and drop the "Snooze Status" cell from any row in the "Managed Entity Status" dataview to the xpath field.
- Click the "EDIT..." button next to the Xpath
- Hover over the Row element and click "EDIT"
- In the Element Properties window, set the name to "$rowName"
- Close the Element Properties window
- Click the "OK" button in the Edit Path window
Set up the rule block to trigger the snooze action based on the referenced path alias value:
The below rule will run the "to snooze ME" action if the path alias value referencing the Snooze Status column of the managed entity has a value like "Snooze." The elseif statement runs the "to unsnooze ME" action if the path alias referencing the Snooze Status column of the managed entity has a value like "Unsnooze."
Result:
Notice the "DashboardTraining_ME" managed entity has been unsnoozed while the "localhost" and "My Geneos Application" managed entities are now in a snoozed state.
Attached is the XML for the rule and actions used in this example.
Related Articles
If you have follow up questions about this FAQ:
- Please contact with our Client Services team via the chat service box available in any of our websites or via email to support@itrsgroup.com
- Make sure you provide to us:
- SAMPLER AND RULE XML
- ANY SCREENSHOT
Comments
0 comments
Please sign in to leave a comment.