---
title: "Action: trigger a PagerDuty service"
description: "Trigger a PagerDuty service automatically when an event happens in Guardian."
product: "Guardian"
edition: "Classic"
type: "workflow"
url: "https://docs.cloudhouse.com/guardian/classic/control/events/actions/pagerduty-service/"
---
# Action: trigger a PagerDuty service

Trigger a PagerDuty service automatically when an event happens in Guardian. For example, with a PagerDuty integration, you can automatically trigger a new PagerDuty service if a scan fails or if a node is offline. Then, the members of your team who monitor your PagerDuty instance can address the issue to remedy any issues.

Applies to: `Guardian Classic`

!!! note

    The following process assumes you have a PagerDuty integration already configured in Guardian. For more information, see [PagerDuty Integration](https://docs.cloudhouse.com/guardian/classic/control/integrations/pagerduty-integration/index.md).

![Screenshot showing the Add Action page for triggering a PagerDuty service in Guardian.](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/pagerduty-01.png)

!!! tip

    For an overview of actions in Guardian, including more options available to choose from, see [Actions](https://docs.cloudhouse.com/guardian/classic/control/events/actions/actions/index.md).

## Action Settings

When configuring a **Trigger a PagerDuty Service** action, the following settings are presented:

**Action Name** field
:   A unique name for the action. This name is how you will identify this action among all others configured in your Guardian instance, so ensure it is descriptive. For example, 'Offline Node PagerDuty Service' and not simply 'PagerDuty Service'.

**PagerDuty Service Integration** drop-down list
:   A list of all PagerDuty integrations configured in your Guardian instance.  When configuring a PagerDuty integration, you designate an endpoint URL to use when communicating with PagerDuty. From the drop-down, select the integration that represents the endpoint you want to call when this action is triggered.

**Incident Key** field (optional)
:   In PagerDuty, incident keys are unique identifiers used to designate specific kinds of issues that need to be addressed. For example, you might have an incident key dedicated to offline devices and a separate incident key dedicated to failed integrations. Enter the relevant PagerDuty incident key in this field and each service will be assigned to the appropriate category as it's triggered.

**Description** field
:   Details about the event that triggered this action. Here, you can include any information that would be helpful to those monitoring your PagerDuty issues as they arise, such as details of failed scans or nodes that are offline.  To make your descriptions dynamic, you can include variables in this field. Variables are pieces of text that Guardian will replace with relevant data. For example, you could use the variable `{{ policy }}` to indicate which specific policy triggered the action. In PagerDuty, you will see that policy in place of the variable.

**Event URL** field
:   A URL those working in PagerDuty can use as reference when resolving the issue that triggered this action.  For example, if you are triggering a PagerDuty service because of an offline node, you can include the URL to the node here. In this case, you can use the variable `{{ node_url}}` to automatically populate this field with the URL that directs to the relevant node.

These settings are configured when adding a new action, and they can also be edited at any time through the **Actions** tab (**Control** > **Events** > **Action**). To edit an action from the **Actions** tab, click the **Ellipsis** (![Ellipses](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/buttons/ellipses.png)) and select **Edit**. Once you have made your edits, click **Done** to save them.

## Add a trigger a PagerDuty service action

You can add a new **Trigger a PagerDuty Service** action from any saved view in your Guardian instance. Each saved view represents a specific event determined using a query on the **Events** page. The saved view you select during this configuration determines the corresponding event that triggers your new action. For more information, see [Saved Views](https://docs.cloudhouse.com/guardian/classic/control/events/events/index.md#saved-views).

To add a Trigger a PagerDuty Service action, complete the following process:

!!! tip

    For help completing any of the following fields, refer to their respective descriptions in the **Action Settings** table above.

1. Navigate to the **Events** tab (**Control** > **Events**).
2. Click the **Saved Views** button at the top of the page. The **Saved Views** side panel is displayed.

    ![Screenshot showing the Guardian Events page with a border around the Saved Views button.](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/add-action-01.png)

3. Select the event you want to trigger your new action. The saved view for that event is displayed.
4. Click the **Actions** tab to display all existing actions configured for this event.
5. Click the **Add Action** button. The **Add New Action** page is displayed.

    ![Screenshot showing the Guardian Events page with a border around the Actions tab and the Add Action button.](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/add-action-02.png)

6. Click **Trigger a PagerDuty Service**. The required fields are displayed.
7. Enter an **Action Name**.
8. Enter an **Incident Key**.
9. Enter a **Description**.

    !!! tip

        Once you have entered a description, you can view a preview. You can use this preview to test any variables you may have included in the description. To preview a sample description, click **Preview**.

    ![Screenshot showing the Add Action page for triggering a PagerDuty service with a border around the message Preview button.](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/control/events/pagerduty-preview.png)

10. Enter an **Event URL**.
11. Click **Done**.

Now, a confirmation dialog is displayed and you are redirected to the **Actions** tab for your selected saved view. Here, you can view your new action. To disable, edit, or test the action, click the **Ellipsis** (![Ellipses](https://docs.cloudhouse.com/guardian/classic/assets/images/guardian/buttons/ellipses.png)) and select the appropriate option.
