Back to Geneos FAQ

How to use a path variable to snooze/unsnooze a managed entity via rules

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 on the referenced path alias value.

Create a custom toolkit dataview listing the managed entity name and snooze status Copied

In this example, a toolkit dataview called Managed Entity Status 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.

Geneos Managed Entity critical status

Set up an action for the /SNOOZE:manual and /SNOOZE:unsnooze internal commands Copied

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.

An action called to snooze ME 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.

Geneos snooze internal command

An action called to unsnooze ME uses the /SNOOZE:unsnooze internal command to unsnooze a data item.

Geneos unsnooze internal command

Create a rule that uses a path variable in the path alias to reference the snooze status listed in the toolkit dataview Copied

In this example, a rule called snoozing\_unsnoozing\_ME with the target xpath is set to /geneos/gateway/directory/probe/managedEntity so it targets every managed entity in the Gateway.

Geneos snoozing_unsnoozing_ME rule

To create a path variable that will grab the rule target’s managed entity name, do the following steps:

  1. Go to the Advanced tab in Rules and click Add new in the Path variables section. This path variable can be called rowName.
  2. Under the Value section, remove the value true and right-click on the white space of the Value section.
  3. Select Target names > managedEntityName.

Geneos snoozing_unsnoozing_ME advanced configuration

To add the above path variable to the path alias for the “Snooze Status” column in the “Managed Entity Status” dataview, follow these steps:

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.

  1. Go to the Advanced tab in Rules and click Add new in the Path alias section.
  2. Name the path alias snoozed\_ME.
  3. Drag and drop the Snooze Status cell from any row in the Managed Entity Status dataview to the xpath field.
  4. Click the EDIT button next to the xpath.

Geneos snooze configuration in path alias

  1. Hover over the Row element and click EDIT.
  2. In the Element Properties window, set the name to $rowName.
  3. Click the OK button in the Edit Path window.

Geneos row path in element properties

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.

Set up the rule block to trigger the snooze action based on the referenced path alias value Copied

The following 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.

Geneos rule block configuration

This configuration results in the DashboardTraining\_ME managed entity becoming unsnoozed, while the localhost and My Geneos Application managed entities are in a snoozed state.

Geneos rule block configuration result

For more information about constructing and configuring paths, see Path editor and Geneos XPaths.

["Geneos"] ["Geneos > Gateway"] ["FAQ"]

Was this topic helpful?