Zabbix alert script for Slack
- Python 2
- Set up a new incoming webhook for your Slack team
- Set token in slack.cfg (the part in the URL after https://hooks.slack.com/services/)
- Review other configuration options in slack.cfg. Check out subject matching regular expressions for status color support in Slack messages. To match for trigger severity, make sure this info is included in the subject, default configuration matches following subject:
[{TRIGGER.STATUS}] ({TRIGGER.SEVERITY}): {TRIGGER.NAME}
- Create new media type in Zabbix
- Copy slack.py and slack.cfg to /usr/lib/zabbix/alertscripts
- Make slack.py executable for the user running Zabbix server
Use receiving user or channel in the Send to field when adding a new media for a user.
usage: slack.py [-h] [-v] [-c [C]] to subject message
Zabbix Slack Client
positional arguments:
to Receiving user or channel
subject Message subject
message Message body
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-c [C] The configuration file to use (default: slack.cfg)
zabbix-slack is licensed under the MIT License.