This is a quick tutorial on how to patch the Pagerduty plugin to be compatible with Sensu go (5.0.x).
The steps will guide you through installing the available Pagerduty plugin and applying this patch to make it compatible with Sensu Go.
For details about the requirements of Pagerduty, setting up a service and other info about the plugin, please refer to https://www.pagerduty.com/docs/guides/agent-install-guide/
The following steps were written and tested on Centos 7. However, it can be easily adapted to other OS.
Log on to your Sensu Server, and execute the following.
sh -c 'cat >/etc/yum.repos.d/pdagent.repo <<EOF [pdagent] name=PDAgent baseurl=https://packages.pagerduty.com/pdagent/rpm enabled=0 gpgcheck=1 gpgkey=https://packages.pagerduty.com/GPG-KEY-RPM-pagerduty EOF'
yum install --enablerepo=pdagent pdagent pdagent-integrations
cd /usr/share/pdagent-integrations/ git clone https://github.com/bukiadeniji/sensu-go-pagerduty-plugin-patch
NOTE: You may also visit the github page to download the patch.
cd /usr/share/pdagent-integrations/ cp sensu-go-pagerduty-plugin-patch/pd-sensu.patch bin/ cd /usr/share/pdagent-integrations/bin patch -b < pd-sensu.patch
pd-send -k <your_integration_key> -t trigger -d "Test test" -i server.test
sensuctl handler create pagerduty --type pipe --command "/usr/share/pdagent-integrations/bin/pd-sensu -k <your_integration_key>" --timeout 20