---
title: "How to use a path variable to snooze/unsnooze a managed entity via rules"
description: "Using a path variable in Geneos rules allows snoozing or unsnoozing managed entities. This involves referencing snooze status in a toolkit dataview and triggering actions based on that status."
url: "https://docs.itrsgroup.com/docs/faq/geneos/115004030209-geneos-how-to-use-a-path-variable-to-snooze-unsnooze-a-managed-entity-via-rules/index.html"
---
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

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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-managed-entity-dataview.png)

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

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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snooze-data-item.png)

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

![Geneos unsnooze internal command](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-unsnooze-data-item.png)

## 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, 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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snoozing_unsnoozing_ME.png)

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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snoozing_unsnoozing_ME-value.png)

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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snoozing-xpath.png)

5. Hover over the Row element and click **EDIT**.
6. In the **Element Properties** window, set the name to `$rowName`.
7. Click the **OK** button in the Edit Path window.

![Geneos row path in element properties](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snoozing-edit-rowpath.png)


**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

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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snoozing-rule-code-block.png)

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](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-snooze-result.png)

For more information about constructing and configuring paths, see [Path editor](https://docs.itrsgroup.com/docs/geneos/current/visualization/active-console/tools/path-editor/) and [Geneos XPaths](https://docs.itrsgroup.com/docs/geneos/current/processing/gateway-administration/geneos_xpath_ug/).


