-
-
Save eurica/8e382bf83fd240695da39c83085a3afa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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