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 [[ $level == "red" ]]; then
  emoji=":rage:"
  color="danger"
  status="Critical!"
elif [[ $level == "yellow" ]]; then
  emoji=":sunny:"
  color="warning"
  status="Warning!"
elif [[ $level == "green" ]]; then
  emoji=":white_check_mark:"
  color="good"
  status="OK!"
elif [[ $level == "purple" ]]; then
  emoji=":imp:"
  color="#800080"
  status="No report!"
else
  emoji=":ghost:"
  color="#000000"
  status="No data!"
fi

payload=$(< <(cat <

1. add script alert on hobbit/xymon-alerts.cfg

vim /etc/xymon/xymon-alerts.cfg

host=*
  SCRIPT /etc/xymon/scripts/alert_to_slack.sh channel_name DURATION>10