通知スクリプト
zabbix_server.conf
### Option: AlertScriptsPath # Full path to location of custom alert scripts. # Default depends on compilation options. # # Mandatory: no # Default: # AlertScriptsPath=${datadir}/zabbix/alertscripts AlertScriptsPath=/usr/lib/zabbix/alertscripts
通知スクリプトを置く
https://raw.githubusercontent.com/ericoc/zabbix-slack-alertscript/master/slack.sh
こちらのスクリプトの下記部分を環境に合わせて書き換え
# Slack incoming web-hook URL and user name url='CHANGEME' # example: https://hooks.slack.com/services/QW3R7Y/D34DC0D3/BCADFGabcDEF123
作成したwebhookのURLを入れておく
ansibleで配置するなら
- name: zabbix-slack-alertscript become: True copy: src=slack.sh dest=/usr/lib/zabbix/alertscripts/slack.sh mode=0755
みたいな
zabbixにメディアを作ってユーザーと結びつけておく
既存のメール通知アクションにSlackを追加する、または新たなアクションを作成するなどしてSlackへの通知アクションを定義
確認
便利になりました

Zabbix統合監視徹底活用 ~複雑化・大規模化するインフラの一元管理 (Software Design plus)
- 作者: TIS株式会社,池田大輔
- 出版社/メーカー: 技術評論社
- 発売日: 2014/02/07
- メディア: 大型本
- この商品を含むブログ (4件) を見る