Discord and PVE
Previously I was using NTFY for receiving notifications from my host, in addition to emails. This worked good, but I figured I could do something else, and decided to explore Discord. I set up a Discord server to do some other things, reference other projects, but given the power of Discord, I opted to combine some things, and here is what I ended up with. For notifications from PM itself, this is fairly straight forward.
Discord
- In your server, create a new channel you can use to post messages from your PM server
- Edit it's settings, and create a webhook integration (give it a name and cool icon)
- Copy the webhook URL and save the integration
Proxmox
- From the Datacenter level, navigate to the Notifications area
- Under Notification Targets, add a new webhook
- Give it a name (I simply used Discord)
- Set the Method/URL to the webhook URL you copied from above
- Add a header:
- Key =
Content-Type
- Value =
application/json
- Key =
- For the body, implement some valid json to show what you want. I used the following:
{
"username": "Proxmox",
"embeds": [
{
"title": "🚨 {{ severity }} — {{ fields.type }} on {{ fields.hostname }}",
"description": "{{ escape message }}"
}
]
}
That's it, make sure you check the enable box, then save it, test it, and you should see a test notification in your Discord channel.