Skip to content

Instantly share code, notes, and snippets.

@Deconstrained
Forked from jcurreee/pagerduty-agent
Last active November 1, 2018 15:38
Show Gist options
  • Save Deconstrained/466645559c28240472f44864658ee48f to your computer and use it in GitHub Desktop.
Save Deconstrained/466645559c28240472f44864658ee48f to your computer and use it in GitHub Desktop.
Add PagerDuty Agent notification method for Check_MK
#!/bin/bash
# PagerDuty Agent
COMMAND="/usr/bin/env - /usr/share/pdagent-integrations/bin/pd-nagios"
if [ "$NOTIFY_WHAT" = "SERVICE" ]; then
$COMMAND -n service -k $NOTIFY_PARAMETER_1 -t $NOTIFY_NOTIFICATIONTYPE -f SERVICEDESC="$NOTIFY_SERVICEDESC" -f SERVICESTATE="$NOTIFY_SERVICESTATE" -f HOSTNAME="$NOTIFY_HOSTNAME"
elif [ "$NOTIFY_WHAT" = "HOST" ]; then
$COMMAND -n host -k $NOTIFY_PARAMETER_1 -t $NOTIFY_NOTIFICATIONTYPE -f HOSTNAME="$NOTIFY_HOSTNAME" -f HOSTSTATE="$NOTIFY_HOSTSTATE"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment