.. _c3_alerts_pagerduty_email_integration: ********************************************** Configure PagerDuty |c3-short| Alerts for |cp| ********************************************** PagerDuty opens an incident when it receives a webhook or an email to the designated PagerDuty integration address. The email notification from PagerDuty contains: - The incident numbers created in PagerDuty. - **View Incident** buttons to view an incident directly in PagerDuty. - Trigger, topic, cluster, and metric details. - Links to view alerts history in |c3-short| for certain trigger types. .. figure:: ../../images/c3-pagerduty-email-alert.png :width: 600px PagerDuty alert example email |c3-short| alerts can send email alerts to a PagerDuty account in the following ways: - Send an email notification using a PagerDuty email integration used in conjunction with |c3-short| PagerDuty webhook notifications (recommended). See :ref:`c3_alerts_pagerduty_email_plus_webhooks`. - Send an email notification from |c3-short| to a PagerDuty integration email address using SMTP. See :ref:`c3_alerts_pagerduty_smtp_email`. .. _c3_alerts_pagerduty_email_plus_webhooks: Send both PagerDuty webhook and email notifications =================================================== If you are planning on or already using PagerDuty webhook notifications, it is simple to send email notifications. Setting up an SMTP email configuration in |c3-short| properties files is not necessary in this scenario. Email notification does not need to be enabled in ``control.center.properties`` files because you are using the PagerDuty email integration in conjunction with webhook notifications. The webhook notification from |c3-short| to PagerDuty creates an incident but does not send email notification. Follow these steps to be notified through email that an alert has been triggered through the webhook notification. #. Set up PagerDuty webhook notification in an alert action and associate it with a trigger. The PagerDuty webhook activation must be active within both |c3-short| and PagerDuty. #. Set up a PagerDuty email integration following the `PagerDuty documentation `__. #. Set up a test trigger and action to quickly generate test alerts with history. See :ref:`c3_pd_email_test_tips`. Point the email action to your PagerDuty email integration address. .. _c3_alerts_pagerduty_smtp_email: Send PagerDuty email notifications through SMTP =============================================== PagerDuty opens an incident when it receives an email sent from |c3-short| to the designated PagerDuty integration address. In this scenario, you must configure your SMTP mail server and |c3-short| email settings. Follow this procedure if you do not use the |c3-short| PagerDuty webhook notification. Prerequisites ------------- #. Configure your SMTP mail server if it's not already configured. For non-production testing purposes, you can use `FakeSMTP `_. #. Enable email alerts in |C3-short|. Email alerts are not enabled by default. See :ref:`enable_disable_alerts_props`. #. Set up your SMTP email configuration in the ``control.center.properties`` files. See :ref:`config_SMTP_email`. #. Set up a PagerDuty email integration following the `PagerDuty documentation `__. To test SMTP email alerts to PagerDuty: #. Set up a test trigger and action to quickly generate test alerts with history. See :ref:`c3_pd_email_test_tips`. #. Set up an email action that points to your PagerDuty email integration address. .. _c3_pd_email_test_tips: Tips for testing PagerDuty and |c3-short| email alerts ====================================================== Depending on the trigger condition, it can take some time for a trigger event to fire. To trigger test alerts with history in |c3-short| right away: #. Set up a topic trigger on the ``pageviews`` topic created using the :ref:`Quick Start guides `. Set the **Bytes in** metric to greater than 0 (zero). #. Create a corresponding action that sends a notification at a frequency of once per minute. After you have generated and tested some alerts, you can pause, disable, edit, or delete your test triggers and actions. PagerDuty considerations: - Set up a temporary escalation policy that automatically resolves a test incident after a few minutes. Follow the `PagerDuty documentation `__ to do so. - Set up a temporary service in PagerDuty so that you are not spamming your PagerDuty account and colleagues while testing alerts. You can disable (pause) or delete your test service when you no longer need it. Follow the `PagerDuty documentation `__. - For more details about how to manually trigger test incidents within PagerDuty, see the `PagerDuty Incidents documentation `__. SMTP considerations: - Use a temporary or alternative email address to test. - Use a temporary SMTP server to test. For non-production testing purposes, you can use `FakeSMTP `_.