Skip to content

Instantly share code, notes, and snippets.

@jcurreee
Created March 10, 2016 18:14
Show Gist options
  • Save jcurreee/b21938f316f92dd3fadf to your computer and use it in GitHub Desktop.
Save jcurreee/b21938f316f92dd3fadf to your computer and use it in GitHub Desktop.
Add PagerDuty Agent notification method for Check_MK
#!/bin/bash
# PagerDuty Agent
COMMAND="/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