Skip to content

Instantly share code, notes, and snippets.

@eurica

eurica/ServerGuard24.js Secret

Created Jun 17, 2016
Embed
What would you like to do?
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
You can’t perform that action at this time.