LoginSignup
0
7

More than 5 years have passed since last update.

Zabbixの通知(Media)設定(Gmail, Slack)

Posted at

環境

docker 上で構築します。
https://github.com/zabbix/zabbix-docker

  • zabbix-web-apache-mysql
  • zabbix-snmptraps
  • zabbix-server-mysql
  • mysql

メール通知

ステップ1:メールのセキュリティ設定

設定ページ:https://myaccount.google.com/u/1/lesssecureapps?pli=1&pageId=none
安全性の低いアプリをONにします

Kobito.3OKu3n.png

ステップ2:zabbixのメディア設定

Kobito.eFcuaa.png

ステップ3:ユーザのメディアにメール追加、有効

管理 > ユーザー > ユーザー選択 > メディアタブ > 追加 > 更新

ステップ4:アクション設定

新規アクション作成

  • アクション名入力
  • 実行条件選択

Kobito.M8g5dj.png

  • 実行内容で、メールで送信やユーザ、グループを選択

Kobito.G0A21d.png

→ 追加します。

完了

ここまではメール設定が完了ですが、送信エラーが発生する場合があります。もしかして、ログインエラーが発生したらメールをチェックして見てください(サーバメール)。許可させないと送信できませんです。

Kobito.HpmUlk.png

Slack通知

こちらのスクリップ使います
https://github.com/ericoc/zabbix-slack-alertscript

ほぼほぼ以上のgithubの手順でやりますが以下の問題があった場合:

slack.sh の権限

処理方:権限させる

$ chmod 777 slack.sh

curl コマンドが見つかれませんでした

処理方:curlインストール

sudo apt-get update -y
sudo apt-get install curl -y

SSLエラー

処理方:curlのkオプションを追加

# curl -m 5 --data-urlencode "${payload}" $url -A 'zabbix-slack-alertscript / https://github.com/ericoc/zabbix-slack-alertscript'

curl -k -m 5 --data-urlencode "${payload}" $url -A 'zabbix-slack-alertscript / https://github.com/ericoc/zabbix-slack-alertscript'

完了です

0
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
7