
SynologyのNASからDiscordにWebhookで通知を送る方法
最近SynologyのDS220jを導入しました。意外に多機能で感心しつつ、試行錯誤しながら活用しております。NASとしては有名メーカーだと思っていましたが、各種設定について意外に日本語情報が少なく困っております。
そんな中、DiscordにWebhookで通知を送るのが少し大変だったので、記事にしました。
自分も詳しいわけではないので指摘事項やアドバイスあればコメントいただけると嬉しいです。
Discordの設定
普通にサーバーを立ててWebhookを作成します。
こちら↓の「のい太ろぐ」さんのサイトがとても分かりやすかったのでご参考にしながら「ウェブフックURLをコピー」の作業まで進めます。
一応Internet ArchiveのURLも乗っけておきます。
https://web.archive.org/web/20230102142921/https://noitalog.tokyo/python-discord-notification-bot/
NASの設定
NASにアクセスします

「コントロールパネル」「通知」「プッシュサービス」のページから「Webhookの管理」をクリックします。

「カスタマイズ」を選択し次へ

プロバイダー名は任意に設定し、Discordの設定でコピーした、Webhook URLをペーストします。HTTP方式はPOSTです。

以下のように「Content-Type」は「application/json」、「User-Agent」は「DiscordBot」と入力

「content」は空のまま

Contentにメッセージコンテンツを設定

以下の画面から「テストメッセージ送信」を押して、テストメッセージが受信できれば完了です。


参考
いいなと思ったら応援しよう!
