Skip to content

Instantly share code, notes, and snippets.

@gkspranger
Last active March 29, 2017 20:27
Show Gist options
  • Save gkspranger/137acaff3f77cb6060b782767ac2c431 to your computer and use it in GitHub Desktop.
Save gkspranger/137acaff3f77cb6060b782767ac2c431 to your computer and use it in GitHub Desktop.
# status link = <a href=\"https://{{ inventory_hostname }}/nagios/cgi-bin/extinfo.cgi?type=2&host=$HOSTNAME$&service=$$(echo $SERVICEDESC$ | sed -e 's/ /%20/g')\">Status Link</a>
# ack link = <a href=\"https://{{ inventory_hostname }}/nagios/cgi-bin/cmd.cgi?cmd_typ=34&host=$HOSTNAME$&service=$$(echo $SERVICEDESC$ | sed -e 's/ /%20/g')\">Acknowledgement Link</a>
# appended to the "$SERVICEOUTPUT$"
# see below
define command {
command_name notify-service-by-hipchat
command_line hipsaint --token={{ hipchat_token }} --room={{ hipchat_redrum_id }} --type=service --inputs="$SERVICEDESC$|$HOSTALIAS$|$LONGDATETIME$|$NOTIFICATIONTYPE$|$HOSTADDRESS$|$SERVICESTATE$|$SERVICEOUTPUT$<br><br><a href=\"https://{{ inventory_hostname }}/nagios/cgi-bin/extinfo.cgi?type=2&host=$HOSTNAME$&service=$$(echo $SERVICEDESC$ | sed -e 's/ /%20/g')\">Status Link</a><br><a href=\"https://{{ inventory_hostname }}/nagios/cgi-bin/cmd.cgi?cmd_typ=34&host=$HOSTNAME$&service=$$(echo $SERVICEDESC$ | sed -e 's/ /%20/g')\">Acknowledgement Link</a>" -n
}
define contact {
use generic-contact
contact_name hipchat_redrum
contactgroups hipchat_redrum
service_notification_commands notify-service-by-hipchat
email /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment