Skip to content

Instantly share code, notes, and snippets.

@eurica
Created June 17, 2016 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eurica/8e382bf83fd240695da39c83085a3afa to your computer and use it in GitHub Desktop.
Save eurica/8e382bf83fd240695da39c83085a3afa to your computer and use it in GitHub Desktop.
var webhook = PD.inputRequest;
var event_type = PD.Trigger;
if(webhook.body.check_result == "OK") {event_type = PD.Resolve;}
var normalized_event = {
event_type: event_type,
incident_key: webhook.body.server_name,
description: webhook.body.check_output,
details: webhook.body
};
PD.emitGenericEvents([normalized_event]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment