Send Xymon/Hobbit Alerts to Slack Channel
Posted by blackonsole on October 8th, 2016 01:00 PM | No Comment
How to sent xymon/hobbit alerts to slack channel
0. create bash script to push xymon/hobbit alerts to slack
vim /etc/xymon/scripts/alert_to_slack.sh
#!/bin/bash
hostname=$BBHOSTNAME
level=$BBCOLORLEVEL
msg=$BBALPHAMSG
title="$BBHOSTSVC $level"
url="https://hooks.slack.com/services/XXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXX"
channel="#${RCPT}"
assigned="@channel"
if ]; then
emoji=":rage:"
color="danger"
status="Critical!"
elif ]; then
emoji=":sunny:"
color="warning"
status="Warning!"
elif ]; then
emoji=":white_check_mark:"
...