Jaime Gago Condensing Information Systems From the Vapor Of Data

13Jan/140

Integrating PagerDuty with Sensu

sensu_logo

I'm currently implementing a monitoring pipeline based on Sensu for the monitoring data routing and Graphite for the actual storage and calculations, it wouldn't be complete without a notification systems to it so I thought I would document using PagerDuty at the end of the pipe.

There isn't much to it but the information is spread and not always straight forward (at least it wasn't to me) so hopefully this help other adepts of monitoring love!

Get your PagerDuty Service key

Just make sure you get the service API key not a generic API key (I wasted several hours troubleshooting my config because I was using the wrong key, sometimes I feel like I've been frozen in time while delivering pizzas...)

Get the PagerDuty handler script from the sensu plugins community repo

As you will or have already read, these scripts are meant to be cherry picked so go for it!

If for some reason, like me you need to get the scripts into an OS native package (e.g. RPM) I highly recommend you to checkout FPM.

In any case for the sake of the example here is one -manual- way to get the pager duty handler script

$>cd /etc/sensu/handlers
$>wget https://raw2.github.com/sensu/sensu-community-plugins/master/handlers/notification/pagerduty.rb

Create the PagerDuty handler configuration (json)

The only tricky part here is where you put the PagerDuty service API key, I like my stuff contained so my example will be everything in one file, just be aware that you can separate the the api_key settings into a dedicated file

$>cat /etc/sensu/conf.d/handlers/pagerduty.json

{
  "pagerduty": {
    "api_key": "the_service_api_key_you_got_earlier"
  },
  "handlers": {
  "pagerduty": {
  "command": "/etc/sensu/plugins/pagerduty.rb",
  "type": "pipe"
    }
  }
}

That's it for integrating Sensu with Pagerduty

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.