PagerDuty Webhooks to an Internal Incident Router Using Skooh
Route PagerDuty incidents to internal systems and use replay to test incident playbooks.
Use Case
When PagerDuty fires, you want to:
- Create tickets in internal systems
- Trigger automated remediation
- Post to internal Slack
- Update status pages
Skooh forwards PagerDuty webhooks to your internal incident router.
Setup
1. Create Skooh Endpoint
Create "PagerDuty Incidents" in Skooh.
2. Run the Skooh Proxy
Using the Desktop App:
- Download the Skooh Desktop App
- Enter your API key and hook token
- Set forwarding URL (e.g., `http://localhost:3000/incidents\`)
- Click Connect
Using Docker:
docker run -d \\
--name skooh-pagerduty \\
-e SKOOH_TOKEN=pagerduty-incidents \\
-e SKOOH_API_KEY=your_api_key \\
-e FORWARD_URL=http://incident-router:3000/incidents \\
--restart unless-stopped \\
skooh/proxy
3. Configure PagerDuty
Note: See PagerDuty's Webhooks documentation for current setup instructions.
In PagerDuty:
- Go to Integrations → Generic Webhooks (v3)
- Create a new webhook
- Enter your Skooh URL
- Select events to subscribe to
Handling PagerDuty Events
app.post('/incidents', express.json(), async (req, res) => {
const { event, incident } = req.body.message;
switch (event) {
case 'incident.triggered':
await handleIncidentTriggered(incident);
break;
case 'incident.acknowledged':
await handleIncidentAcknowledged(incident);
break;
case 'incident.resolved':
await handleIncidentResolved(incident);
break;
case 'incident.escalated':
await handleIncidentEscalated(incident);
break;
}
res.status(202).send('Accepted');
});
Incident Routing Logic
async function handleIncidentTriggered(incident) {
const {
id,
title,
urgency,
service,
escalation_policy,
created_at
} = incident;
// 1. Create internal ticket
const ticket = await ticketService.create({
title: \`[PD-\${id}] \${title}\
Written by Skooh Team