26 Aug, 2020

Notify alarms from Zabbix to Slack

#!/bin/bash
KEY=”https://hooks.slack.com/services/xxxxxxx/xxxxxxxxxx/xxxxxxxxxxxx”
TO=”$1″
SUB=”$2″
MESS=”$3″

#if [[ $SUB == ‘PROBLEM’ ]] #then
# ICON=”:scream:”
#elif [[ $SUB == ‘OK’ ]] #then
# ICON=”:ok_hand:”
#else
# ICON=”:point_up_2:”
#fi

/usr/bin/curl -X POST –data-urlencode “payload={\”channel\”: \”$TO\”, \”username\”: \”ZabbixBot\”, \”text\”: \”$ICON $SUB\n$MESS\”}” $KEY

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *