Skip to content

Instantly share code, notes, and snippets.

@jcurreee
Created March 10, 2016 21:20
Show Gist options
  • Select an option

  • Save jcurreee/b8f4472659d7c2e402a6 to your computer and use it in GitHub Desktop.

Select an option

Save jcurreee/b8f4472659d7c2e402a6 to your computer and use it in GitHub Desktop.
Add PagerDuty Perl notification method for Check_MK
#!/bin/bash
# PagerDuty (Perl)
COMMAND="/usr/local/bin/pagerduty_nagios.pl"
if [ "$NOTIFY_WHAT" = "SERVICE" ]; then
$COMMAND enqueue -f pd_nagios_object=service -f CONTACTPAGER="$NOTIFY_PARAMETER_1" -f NOTIFICATIONTYPE="$NOTIFY_NOTIFICATIONTYPE" -f HOSTNAME="$NOTIFY_HOSTNAME" -f SERVICEDESC="$NOTIFY_SERVICEDESC" -f SERVICESTATE="$NOTIFY_SERVICESTATE"
elif [ "$NOTIFY_WHAT" = "HOST" ]; then
$COMMAND enqueue -f pd_nagios_object=host -f CONTACTPAGER="$NOTIFY_PARAMETER_1" -f NOTIFICATIONTYPE="$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