CFEngine Integration Guide

CFEngine is an IT infrastructure automation and Continuous Operations framework that helps engineers, system administrators, and other stakeholders in an IT organization manage IT infrastructure while ensuring service levels and compliance.

You can use an email-based integration to receive alerts from CFEngine in PagerDuty.

In PagerDuty

  1. From the Services menu, select Service Directory.
  2. On your Services page:
    1. If you are creating a new service for your integration, click +New Service.
    2. If you are adding your integration to an existing service, click the Name of the service you want to add the integration to. Then click the Integrations tab and click Add a new integration.
  3. Select the integration from the Integration Type menu and enter an Integration Name. If you are creating a new service for your integration, in General Settings, enter a Name for your new service. Then, in Incident Settings, specify the Escalation Policy, Notification Urgency, and Incident Behavior for your new service.
  4. Click the Add Service or Add Integration button to save your new integration. You will be redirected to the Integrations page for your service. Find the integration you created and click its Name.
  5. Copy the Integration Email for your new integration and keep it in a safe place for later use.

In CFEngine:

  1. You will need to create a policy to detect any change in a specific file. Copy your bundle agent for use in a later step. The first section of your policy should be set to deal with the promise type called ‘files’, and the ‘any’ section indicates that this will apply to all CFEngine managed nodes. Make changes to define the file in question and where it is stored, as well how CFEngine should handle detected changes. In this example, our policy will update every time a change is detected, including differences between versions of the file.
    CF1 create teh policy
  2. Next, you will need to create an alert in CFEngine. Visit your Dashboard and click Add, then set the name and severity, and set the condition type to policy.
    CF3 name, severity
    CF4 create policy type
  3. Copy the bundle agent name from your policy for use as the identifier, then set the promise status to repaired, so that when there is a change in the file, an alert will be triggered. Check the the box next to Set email notifications for this alert, and paste your PagerDuty service’s integration email address in the Email to field. Finally, select how often you would like to be reminded.
    CF5 copy bundle name, promise, int email
  4. Save and name your widget (named “PagerDuty” in this example).
    CF6 save and name widget

To Test

To test that your integration is set up correctly, you will need to make a random change to the file being monitored to provoke an alert.

  1. In CFEngine, select a server and copy the IP address.
    CF7 copy ip
  2. Log in to the node, open the test file, and make a change.
    CF8 copy IP, open file, make a change
  3. The change will soon be picked up by CFEngine, and then forwarded to your PagerDuty integration email address.  When you visit your PagerDuty service, look for a new alert, and click on ‘details’ to see the full details, as well as links you can click on to be taken back to CFEngine to dig into the details or make changes.
    CF9 PD with details


If you are having trouble completing the installation, please contact our Support team.

Start Using PagerDuty Today

Try PagerDuty free for 14 days — no credit card required.