Skip to content

Instantly share code, notes, and snippets.

@otsuarez
otsuarez / slack.sh
Last active August 29, 2015 14:23 — forked from zdk/slack.sh
#!/bin/bash
WEBHOST_NAGIOS="<Host that nagios is runing on>"
SLACK_CHANNEL="#<Channel name>"
SLACK_BOTNAME="<Bot Name>"
WEBHOOK_URL="<Webhook URL>" #Get it from Slack Incoming WebHooks setup instruction
#Set the message icon based on Nagios service state
# supported emoji table available at http://unicodey.com/emoji-data/table.htm
if [ "$NAGIOS_SERVICESTATE" = "OK" ]