Monitoring of Proxmox VE backup jobs:
- Reads JSON log files (e.g.,
/var/log/backups.log
) - Detects VMs via Low-Level-Discovery
- Extracts backup start/end times, size & status
- Triggers if a backup is missing or fails
- Proxmox VE generates a JSON-format backup log
- Backup log is accessible by Zabbix server or proxy
- Template is applied to the host that can read the log file
This script generates the JSON log file that the Zabbix template reads and analyzes.
Download it directly from GitHub:
curl -o /usr/local/bin/convert-log-to-json.sh https://raw.githubusercontent.com/Garfieldttt/pve-backup-zabbix/zabbix/7.0/convert-log-to-json.sh
chmod +x /usr/local/bin/convert-log-to-json.sh
Add a line to the crontab of a user with access to the backup log (e.g., root
):
crontab -e
For example, run it every 5 minutes (for testing; later consider changing to */5
):
*/5 * * * * /usr/local/bin/convert-log-to-json.sh
💡 Note: Remove old log files from
/var/log/vzdump/
for VMs/LXCs that no longer exist.
Otherwise, outdated backup entries will still be included inbackups.log
and may trigger alerts.
Macro | Default Value | Description |
---|---|---|
{$BACKUP_LOCATION} |
/var/log/backups.log |
Path to the JSON backup log |
{$BACKUP_TIME} |
48h |
Time threshold to trigger alert on missing backup |
{$TRIGGER_BACKUP_FAILED} |
1 |
Enable/Disable the 'Backup failed on(VMID: {#VMID}' trigger with macro |
{$TRIGGER_NOBACKUP} |
1 |
Enable/Disable the 'No backup in {$BACKUP_TIME} (VMID: {#VMID})' trigger with macro |
Name: BACKUP-STATUS
Value | Meaning |
---|---|
1 | OK |
0 | ERROR |
2 | RUNNING |
- raw.data.pve_backup
Key:vfs.file.contents[{$BACKUP_LOCATION}]
Type: ZABBIX_ACTIVE
Purpose: Reads the full JSON log file
backup.starttime[{#VMID}]
– Backup start timebackup.endtime[{#VMID}]
– Backup end timebackup.size[{#VMID}]
– Backup size in bytesbackup.status[{#VMID}]
– 0/1/2 as status code
All values are extracted using JSONPath and preprocessing from the master item vfs.file.contents[...]
.
-
No backup in
{$BACKUP_TIME}
(VMID: {#VMID})
Condition:nodata(/…/backup.endtime[{#VMID}],{$BACKUP_TIME})=1
→ No backup within the specified time frame -
Backup failed on (VMID: {#VMID})
Condition:last(...backup.status[{#VMID}])=0
→ Backup status indicates failure
Both triggers are set to HIGH priority.
- Adjust
{$BACKUP_LOCATION}
&{$BACKUP_TIME}
to match your setup - Ensure JSON formatting is correct
- Consider log rotation and file size (e.g., set
max_lines
) - Extend with more items/templates if needed
A compact and effective template for monitoring Proxmox VE backups.
Uses modern Zabbix features like active items, preprocessing, LLD, and dependent items – ideal for integration into your infrastructure.