====== 設定 Proxmox 系統通知至 Discord webhook ======
- 在 Discord 建立一個文字頻道 Exp. ichiayi-proxmox -> 整合 -> Webhook [複製 Webhook 網址] \\ {{:tag:螢幕擷取畫面_2025-06-25_100213.png?600|}}
- 將複製的 Webhook 網址進行拆解 Exp. https://discord.com/api/webhooks/1387212345678901200/Ram12345vmkOpxxxxxxxxxxxxxxxxxxxxXT-Vxxxxxxxxxx_GDxxxxxxxxxxxxxxxx6D
- URL - https://discord.com/api/webhooks/
- token - 1387212345678901200/Ram12345vmkOpxxxxxxxxxxxxxxxxxxxxXT-Vxxxxxxxxxx_GDxxxxxxxxxxxxxxxx6D
- Datacenter -> Notifications -> Notification Targets -> [Add] -> Webhook \\ {{:tag:螢幕擷取畫面_2025-06-25_095851.png?600|}}
- Webhook \\ {{:tag:螢幕擷取畫面_2025-06-25_102136.png?600|}}
- Endpoint Name : Discord
- Method/URL : POST / https://discord.com/api/webhooks/{{ secrets.token }}
- Headers : [Add Header]
- Key : Content-Type
- Value : application/json
- Body :
{
"content": "**Proxmox 通知**\n```{{ escape message }}```"
}
- Secrets : [Add Secret]
- Key : token
- Value : 1387212345678901200/Ram12345vmkOpxxxxxxxxxxxxxxxxxxxxXT-Vxxxxxxxxxx_GDxxxxxxxxxxxxxxxx6D
- 進行測試 \\ {{:tag:螢幕擷取畫面_2025-06-25_103032.png?600|}}
- 如果成功就會在 Discord 出現訊息 \\ {{:tag:螢幕擷取畫面_2025-06-25_103313.png?600|}}
- 如果出現 Error 500 就需要檢查 Body 的內容變數是否有設定錯誤
- 調整 Notification Matchers(通知規則)
- 可以直接修改default-matcher(預設規則)加入通知 Discord \\ {{:tag:螢幕擷取畫面_2025-06-25_103644.png?600|}}
- 在 Targets to notify 勾選 Discord \\ {{:tag:螢幕擷取畫面_2025-06-25_103842.png?600|}}
- 之後如果有訊息通知 Exp. Backup 結果通知 就會在 Discord 出現訊息 Exp. \\ {{:tag:螢幕擷取畫面_2025-06-25_104039.png?600|}}
===== 參考網址 =====
* https://pve.proxmox.com/pve-docs/chapter-notifications.html#notification_targets_webhook
{{tag>pve discord}}