webhooks configuration

surya kamisetti

New Member
Nov 25, 2024
7
1
3
Hi Team,

I have configured the webhook for my endpoint (mattermost), we are receiving the alerts as per the JSON code, but the values are missing in the out put.

Below is my code for backup fail event.

~~~bash
{
"text": "Proxmox Backup Job Notification",
"attachments": [
{
"title": "Backup Job Failed",
"text": "Backup job for VM/CT '{{resource_name}} (ID: {{Job_ID}})' failed.",
"fields": [
{
"title": "Job Name",
"value": "{{Job_ID}}",
"short": true
},
{
"title": "Start Time",
"value": "{{start_time}}",
"short": true
},
{
"title": "Error Details",
"value": "{{error_message}}",
"short": false
}
],
"color": "#FF0000"
}
]
}

~~~

OutPut:

1732618448836.png

Can anyone help me how the values will be taken by proxmox VE.
 
Last edited:
Yes, the JSON code was generated by LLM.

is it possible for you to provide a example JSON code to my endpoint mattermost?
 
Thank you for your suggestions. We have tried all possible methods as per the Mattermost documentation.

We are able to receive the notifications, but the issue is that the required values, such as job status, node name, job ID, error details, etc., are not being included in the notifications we are receiving.

Is there any way to fetch these values, similar to how they are included in email notifications?
suggest me that what are the required matching values.
 
Is there any way to fetch these values, similar to how they are included in email notifications?
Not at the moment, no. As mentioned above, see the webhook target information to see which fields can be accessed:
https://pve.proxmox.com/pve-docs/pve-admin-guide.html#notification_targets_webhook

We are able to receive the notifications, but the issue is that the required values, such as job status, node name, job ID, error details, etc., are not being included in the notifications we are receiving.
Well, you should see this information if you use the message parameter, but simply not formatted as nicely as in the LLM-generated example you provided.

Hope this helps.
 
Thanks for the help, now we are receiving the notifications as expected.

Below is the JSON code:


{
"text": "```\nField | Value\n-----------|----------------\nTitle | {{ title }}\nMessage | {{ message }}\nLogs | {{ logs }}\nSeverity | {{ severity }}\nTimestamp | {{ timestamp }}\n```",
"color": "#FF0000"
}


As per the mattermost documentation we have written the JSON code.
 
  • Like
Reactions: Lukas Wagner
for people using pushover, i've got it to work this way :
1732879277485.png
( putting user & token in the secrects section did not work)
 
Last edited:
( putting user & token in the secrects section did not work)

What did you try that did not work?

Haven't tried pushover myself, but creating two secrets "token" and "user" and then setting

Code:
{
    "token": "{{ secrets.token }}",
    "user": "{{ secrets.user }}",
    ...
}

should work.

Also, you likely want a "{{ escape message }}" instead of "{{ message }}", as explained in another message.
 
What did you try that did not work?

Haven't tried pushover myself, but creating two secrets "token" and "user" and then setting

Code:
{
    "token": "{{ secrets.token }}",
    "user": "{{ secrets.user }}",
    ...
}

should work.

Also, you likely want a "{{ escape message }}" instead of "{{ message }}", as explained in another message.
thanks for the clarification : indeed, it works as you described it