Zabbix template/plugin to monitor various backup activities on Proxmox

greavette

Active Member
Apr 13, 2012
157
9
43
Hello Forum,

Currently there doesn't appear to be an update that would solve my problem of mail FROM for notification messages is root@host.domain.com.

I would like then to add to my Zabbix Monitoring Server templates and/or plugins to help me determine the following:
  1. status of backups (success or fail)
  2. status of proxmox backup server jobs such as prune, verify or sync
  3. provide the size of my PBS datastore used.

Is anyone aware of a template or plugin that can assist me with the above monitoring in Zabbix?

Thank you.
 
Last edited:

greavette

Active Member
Apr 13, 2012
157
9
43
If no template exists, is there any documentation I can be pointed to on if I was to use a script or bash how can I extract from my PVE host and my PBS servers the status of these tasks I want to monitor in Zabbix:


  1. status of backups (success or fail)
  2. status of proxmox backup server jobs such as prune, verify or sync
  3. provide the size of my PBS datastore used.
Thank you.
 

UdoB

Renowned Member
Nov 1, 2016
457
132
68
Germany
Hi, while I am a zabbix user and interested in a template like you are, I am just not capable to write my own auto-discovery template.

So I can just add some pointers/details - probably you know this already...:

There is a frontend simulator for the API at https://pve.proxmox.com/pve-docs/api-viewer/index.html#/cluster/backup

Playing around gives me some successful examples:

Code:
root@pved:~#    pvesh get /cluster/backup --noborder=1
id
57dddbaaab8240ff862c3392688c47828d61746e:1
57dddbaaab8240ff862c3392688c47828d61746e:10
...


Code:
root@pved:~#    pvesh get /cluster/backup/57dddbaaab8240ff862c3392688c47828d61746e:1  --noborder=1
key              value
compress         zstd
...
pool             linux-base
quiet            1
storage          dsa

On the server side there is https://pbs.proxmox.com/docs/backup-client.html


Code:
BACKUP pbsb:~# 0  export PBS_REPOSITORY=<server>:<store>

BACKUP pbsb:~# 0  proxmox-backup-client list   | head
┌──────────┬───────────────────────────────┬──────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ group    │ last snapshot                 │ backup-count │ files                                                                                                  │
╞══════════╪═══════════════════════════════╪══════════════╪════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│ ct/100   │ ct/100/2021-08-31T03:15:02Z   │           19 │ catalog.pcat1 client.log index.json pct.conf root.pxar                                                 │
├──────────┼───────────────────────────────┼──────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ vm/1101  │ vm/1101/2021-08-30T20:04:02Z  │           24 │ client.log drive-scsi0.img drive-scsi1.img drive-scsi2.img drive-scsi3.img index.json qemu-server.conf │

So there seems to be some commands supplying the required information...


Best regards
 

greavette

Active Member
Apr 13, 2012
157
9
43
Wow @UdoB , thanks very much for this reply! Sadly I'm not a developer so I'm not sure how I can use this to achieve what I need. But this information does seem very helpful!

This got me looking for a similar API viewer for PBS. I'm not seeing one available from modifying the link you've provided.

@tom or @dcsapak would you be able to confirm or point me to where I can find an API viewer for PBS whereby we can learn the commands we can use to view the status of tasks or jobs that run on our PBS server for monitoring?

Thank you.
 
Last edited:

greavette

Active Member
Apr 13, 2012
157
9
43
Hmmm, I should have looked more carefully! :)

I found this page for the PBS API Veiwer: https://pbs.proxmox.com/docs/api-viewer/index.html#/

What I notice is that PBS does not have something similar to pvesh like in PVE. So instead I just see HTTP commands to use. But how do I issue those HTTP commands on my PBS server? When I put in the following command nothing is returned:

GET /api2/json//admin/sync

I'm hoping to find the PBS commands to put into a script so that Zabbix can know when a sync or verify task in PBS fails.

Thank you.
 

mgiammarco

Active Member
Feb 18, 2010
156
7
43
Hello,
I have almost the same problem:
- monitoring backups in pve;
- monitoring backups made with pbs;
- monitoring pbs;

I have tried several solutions (started with pve metric server) but the only pratical way is to build a custom script and to add it to zabbix.
The problem is that I must be an expert of pve api, pbs api, bash and zabbix, and I am not.
So if someone could give me an hint on which is the best/fastest/most pratical way to:
- query pve for a list of backups with problems
- query pbs for a list of tasks with errors
- tell me if there is an alternative to bash

I will thank him.

Thanks,
Mario
 

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 your own in 60 seconds.

Buy now!