Help with webhook notifications

SimHat

New Member
Aug 5, 2023
8
2
3
I've had email notifications working for a long time with my backups, but I'm trying to transition to webhook notifications. I have my webhook set up and when I hit test, it is working and I get the "test notification".

The notification target is enabled. When my backups run I'm not getting any notification. I feel like this should be working, but I must be missing something simple.

1732984242186.png
1732984304421.png
1732984341031.png
 
Hey!

Same problem here with slack. The test notification works fine, but i didn't got any notification after the backups.
 
Have the same issue with backup notifications to Discord.

The test comes through OK, yet when a backup job runs.. nothing. To confirm, on the backup job:

1733062408342.png

On Notification matcher, currently 'All':

1733062502750.png
 
I set up my Proxmox Backup server notifications the same way, and they do work, so either I don't really understand how the matcher rules work or something isn't working correctly with PVE notifications.
 
Anything in the backup job task logs? If the HTTP call is rejected you should see it there, right at the end of the log output.

With Discord there seems to be the problem that they have a limit on the amount of text that you can send at once via a webhook. So this can be the reason why a 'Test target' works, while a backup job which backs up a couple of VMs does not.
Maybe Slack imposes similar limits.

A solution on the side of Proxmox VE could be to provide a way to switch to 'more compact' notification templates (e.g. skipping logs for backup jobs), but I haven't really looked into this yet.
The templates that are used to render the notification text are stored in /usr/share/pve-manager/templates/default - if it is indeed a problem with too much text, you could try editing the template (note that your changes might be overwritten by future package updates)
 
Anything in the backup job task logs? If the HTTP call is rejected you should see it there, right at the end of the log output.

With Discord there seems to be the problem that they have a limit on the amount of text that you can send at once via a webhook. So this can be the reason why a 'Test target' works, while a backup job which backs up a couple of VMs does not.
Maybe Slack imposes similar limits.

A solution on the side of Proxmox VE could be to provide a way to switch to 'more compact' notification templates (e.g. skipping logs for backup jobs), but I haven't really looked into this yet.
The templates that are used to render the notification text are stored in /usr/share/pve-manager/templates/default - if it is indeed a problem with too much text, you could try editing the template (note that your changes might be overwritten by future package updates)
Nothing in the logs

Code:
INFO: Duration: 31.78s   
INFO: End Time: Wed Dec  4 02:09:06 2024   
INFO: adding notes to backup
INFO: prune older backups with retention: keep-last=5
INFO: running 'proxmox-backup-client prune' for 'ct/110'
INFO: pruned 1 backup(s) not covered by keep-retention policy
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-110-disk-0_vzdump" successfully removed.
INFO: Finished Backup of VM 110 (00:00:33)
INFO: Backup finished at 2024-12-04 02:09:07
INFO: Backup job finished successfully
TASK OK
 
Nothing in the logs

Code:
INFO: Duration: 31.78s  
INFO: End Time: Wed Dec  4 02:09:06 2024  
INFO: adding notes to backup
INFO: prune older backups with retention: keep-last=5
INFO: running 'proxmox-backup-client prune' for 'ct/110'
INFO: pruned 1 backup(s) not covered by keep-retention policy
INFO: cleanup temporary 'vzdump' snapshot
  Logical volume "snap_vm-110-disk-0_vzdump" successfully removed.
INFO: Finished Backup of VM 110 (00:00:33)
INFO: Backup finished at 2024-12-04 02:09:07
INFO: Backup job finished successfully
TASK OK

Oh, there seems to be an issue at the moment where messages logged by the notification system do not show up in the task logs. At the moment you only see them in the system logs. You should see messages like "notified via target ...." or "could not notify via target ... ".
 
Thanks Lukas. To confirm, the test with this config comes through OK (and works from PBS [e.g. garbage collection], same as @SimHat )
 

Attachments

  • webhook_config.png
    webhook_config.png
    33.4 KB · Views: 76
  • task_log.txt
    task_log.txt
    3.8 KB · Views: 25
According to the discord documentation, the maximum number of characters is 2000.
 

Attachments

  • discord_dev_doc.png
    discord_dev_doc.png
    17.2 KB · Views: 19
There should be an option to send line by line -- wouldn't help so much going to things like Slack, but I'm attempting to use it to send to Graylog.