Skip to main content

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

  1. In your server, create a new channel you can use to post messages from your PM server
  2. Edit it's settings, and create a webhook integration (give it a name and cool icon)
  3. Copy the webhook URL and save the integration

Proxmox

  1. From the Datacenter level, navigate to the Notifications area
  2. Under Notification Targets, add a new webhook
  3. Give it a name (I simply used Discord)
  4. Set the Method/URL to the webhook URL you copied from above
  5. Add a header:
    1. Key = Content-Type
    2. Value = application/json
  6. 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.