gotify notification

tessus

Member
Oct 5, 2020
37
4
13
Toronto, Canada
It seems that Proxmox is sending all gotify notifications with priority 0.

Is there any chance that you do not hardcode the priority as 0, but don't specify it all? In that case the default priority set for that app (and token) on the server is used.
Only the test notification should be sent with priority 0.

If you point me to the repo and file, I can make the necessary changes and send a PR.
 
I didn't know either, yet have an indication:

Code:
root@proxmox-beta ~ > grep -ri gotify /usr/share/perl5 | cut -d: -f1 | sort -u
/usr/share/perl5/PVE/API2/Cluster/Notifications.pm

root@proxmox-beta ~ > dpkg -S /usr/share/perl5/PVE/API2/Cluster/Notifications.pm
pve-manager: /usr/share/perl5/PVE/API2/Cluster/Notifications.pm
 
https://git.proxmox.com/?p=proxmox....d5dfd3e499897551942dc9636071dc682;hb=HEAD#l16

We map our internal severity levels to gotify priorities (should never be 0 though).

Seems like support for per-app default priority levels was added relatively recently, didn't know that that was a thing.

Is there any chance that you do not hardcode the priority as 0, but don't specify it all? In that case the default priority set for that app (and token) on the server is used.
I dont' really want to change the default behavior, but maybe we could add another configuration setting 'don't map priority' - would that help?
 
We map our internal severity levels to gotify priorities (should never be 0 though).

Interesting. Thanks for the link to the code. Looking at it, the mapping makes sense. Let me try to explain, why I was so puzzled and maybe you have an idea how to solve it. Your suggestion to add another config setting makes sense, but let's go back to that a bit later.

I've set up a gotify notification target and a matcher (let's call it system-mail) for the field type system-mail. I am also using apticron, because Proxmox didn't tell me, whether there were any updates available or not, unless I checked manually. Maybe this is now possible with the new notification system, I don't know. I havent looked into that yet.
Then there was an update available and I got a notification via gotify. However, there was no sound in the web UI of gotify, nor in the Android app.

When looking at priorities and how they are mapped on Android (and the web UI), it explains the situation:

NotificationGotify Priority
-0
Icon in notification bar1 - 3
Icon in notification bar + Sound4 - 7
Icon in notification bar + Sound + Vibration8 - 10

I expected to hear a ping, when getting the notification that there were updates available. But it also makes sense that this type of system message is an info or notice, and not a warning or error. Although I suspect that all emails sent to root are using a static severity.

I dont' really want to change the default behavior, but maybe we could add another configuration setting 'don't map priority' - would that help?

I understand and changing the default behavior wouldn't do any of us any good. Your design is well thought-out. An option would certainly help. Was your idea to add it to the target or the matcher? The matcher would make more sense, but might need more coding.
On the other hand, it seems to me that this would maybe only help my specific use-case and I think there might be more important things to tackle.
Thanks anyway for your reply and willingness to add another option.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!