Connecting Centreon and PagerDuty: Configuration Tips

  • 5 November 2021
  • 0 replies
  • 155 views

Userlevel 6
Badge +19

A while back, we discussed the benefits of connecting PagerDuty and Centreon. Many of you wanted to learn more on this configuration, to get optimal results. So here they are, our best tips for you to happily connect PagerDuty with your favorite monitoring solution.
 

Before we dive in, two important things to remember


1. What is PagerDuty?

PagerDuty  is an incident management software. It is shipped with basic features such as acknowledging and closing alerts.

The SaaS platform lets you compile alerts from many different systems thanks to over 375 connectors which integrate with your other services and tools, including Centreon. The PagerDuty platform is AI-enabled for greater automation and predictability. 


2. What is a Stream Connector

A Stream Connector sends monitoring data to any external tool that can receive data. As each tool serves its own purpose, data needs to come in a dedicated format. This is the function of a Stream Connector, formatting and transmitting data, including metrics and events.


What’s the point of connecting Centreon to PagerDuty?

Centreon provides a dedicated Stream Connector that sends alerts to PagerDuty. Monitoring alerts become incidents in PagerDuty.

Now that we’ve refreshed you on the basics, we can move on to the central question: Why would you want to connect Centreon to PagerDuty? (Aside from bragging rights, that is.)

Connecting those tools brings three distinct advantages. 

  1. Enrich alerts with reliable and exhaustive data
    Because Centreon enables holistic visibility over the IT estate, you can integrate reliable and exhaustive data.
  2. Frictionless integration
    Our stream connector makes implementation a breeze so there’s no wasted time in exchanging data.
  3. Agility and scalability
    Integrating Centreon with PagerDuty promotes the agility and scalability of your IT monitoring system and helps bridge IT and business visibility needs.

The Stream Connector is a central element to issue monitoring events. Monitoring alerts then become incidents within PagerDuty.
 

Configuring PagerDuty: Configure a service for incidents

1. Go to the Services > Service directory menu.

2. Add a new service (or use an existing one): 

3. Follow the Name, Assign and Alert Grouping steps and configure them according to your needs.

4. During the  integration step, select the Centreon integration.

5. When done, do not forget to retrieve your integration key. It will be used by the stream connector to communicate with PagerDuty.


Configure Centreon
 

Stream connector installation

1. Connect to your Centreon central server through SSH with a root user.

2. Install the needed dependencies:

yum install -y lua-curl epel-release make gcc

3. Install the lua packet manager called luarocks:

yum install luarocks

4. Install the needed lua modules:

luarocks install centreon-stream-connectors-lib
luarocks install luatz

5. Download the Stream Connector:

wget -O /usr/share/centreon-broker/lua/pagerduty-events-apiv2.lua https://raw.githubusercontent.com/centreon/centreon-stream-connector-scripts/master/centreon-certified/pagerduty/pagerduty-events-apiv2.lua

6. Configure the right permissions

chmod 644 /usr/share/centreon-broker/lua/pagerduty-events-apiv2.lua


Stream connector configuration

1. Connect to the web interface with an admin account.

2. Go to Configuration > Pollers and select Broker Configuration.

3. Click on the central-broker-master broker configuration.

4. Go to the Output tab.

5. Add a new Generic- Stream connector output.

6. Give it a name.

7. Set up the stream connector path /usr/share/centreon-broker/lua/pagerduty-events-apiv2.lua.

8. Add a new string parameter called pdy_routing_key with the integration key as a value.

9. Add a new string parameter called pdy_centreon_url with the address of your Centreon central server as a value:

10. Save your configuration.

11. Go to the Configuration > Pollers menu and select Pollers.

12. Select the Central poller.

13. Click the Export configuration button.

14. Tick the 4 first checkboxes.

15. Click the Export button.

Your Centreon is now ready to send alerts to PagerDuty.

 

Alerts journey from Centreon to PagerDuty


The beginning: Centreon

Now that everything is set up, let’s get a closer look at an alert journey. Below, our host Blog-server is monitored by Centreon. An alert is up on the Info service.


Transmission : the Stream Connector

By increasing the logging verbosity level of the Stream Connector logs, we get the following information:

INFO: [EventQueue:send_data]: Going to send the following json {"dedup_key":"20_H","payload":{"component":"Blog-server","group":"technical-content","summary":"Blog-server: CRITICAL: Cooling fluid leak detected","class":"service","severity":"High","timestamp":"2021-10-07T12:36:23.000","custom_details":{"Hostgroups":"technical-content"},"source":"Blog-server"},"event_action":"trigger","client":"Centreon Stream Connector","routing_key":"XXXXXXXXXXXXXXX","links":[{"href":"http://10.25.11.14/centreon/main.php?p=20202&o=hd&host_name=Blog-server","text":"Link to Centreon host summary"}]}

In its standard working level, we notice that the Stream Connector creates a dedicated JSON for PagerDuty. Then the JSON file is sent to PagerDuty.


The end: PagerDuty

On the PagerDuty side, we can observe our alerts.

More details are available when clicking on the incident, such as the incident timeline as seen by PagerDuty.

An incident will be automatically resolved in PagerDuty when the corresponding service will turn into an OK state in Centreon, thanks to the Stream Connector.

Here is the timeline as seen by Centreon.


Learn more

The Stream Connector offers numerous options to customize which alerts to send to PagerDuty and how this will get done. You will find every possible information in the dedicated documentation.

 

 

Centreon Support does not actively maintain knowledge articles. If you have questions or require assistance with an article, please create a case or post a comment below.


0 replies

Be the first to reply!

Reply