Skip to content

Garfieldttt/zabbix-urbackup-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 

Repository files navigation

Zabbix Integration: UrBackup Client Monitoring

⚠️ Note: This integration has been tested only on Debian-based operating systems (e.g., Debian, Ubuntu). Use on other distributions may require adjustments.

Template: Urbackup client backup status by zabbix agent active
Zabbix Version: 7.0+

💡 Overview

Agent-based monitoring of UrBackup client backups:

  • Reads structured JSON file (e.g., /var/log/urbackup-backups.json)
  • Uses Low-Level Discovery (LLD) to detect UrBackup clients
  • Monitors backup state, last backup time, backup size, and connectivity
  • Triggers if backups are outdated or failed

🔍 Requirements

  • JSON-formatted backup log generated by UrBackup client
  • Log file must be accessible by the Zabbix agent (active mode)
  • Template must be applied to the host where the file is available

Install dependencies:

sudo apt-get update && sudo apt-get install -y sqlite3 jq

🛠️ Installation of backup_report_json.sh

This script generates the JSON log file that the Zabbix template reads and analyzes.

🔽 Step 1: Download the script

Download it directly from GitHub:

sudo curl -o /usr/local/bin/backup_report_json.sh https://raw.githubusercontent.com/Garfieldttt/zabbix-urbackup-template/zabbix/7.0/backup_report_json.sh

🔐 Step 2: Make it executable

sudo chmod +x /usr/local/bin/backup_report_json.sh

📋 Step 3: Schedule execution (e.g., via Cron)

Add a line to the crontab of a user with access to the backup log (e.g., root):

sudo crontab -e

For example, run it every 5 minutes (for testing; later consider changing to */5):

*/5 * * * * /usr/local/bin/backup_report_json.sh

⚙️ Macros

Macro Default Value Description
{$BACKUP_TRIGGER_ENABLED_ISSUES} 1 Enables or disables the backup monitoring trigger. Set to 1 to activate the trigger, or 0 to disable it.
{$BACKUP_TRIGGER_ENABLED_NO_BACKUP} 1 Enables or disables the backup monitoring trigger. Set to 1 to activate the trigger, or 0 to disable it.

📦 Value Maps

Name: BACKUP-STATE

Value Meaning
0 No recent backup
1 Ok
2 Completed with issues
3 Failed

Name: CONNECTIVITY-STATE

Value Meaning
0 Offline
1 Online

📦 Items

Active Items

  • urbackup.raw
    Key: vfs.file.contents[/var/log/urbackup-backups.json]
    Type: ZABBIX_ACTIVE
    Purpose: Reads raw UrBackup data from local JSON log

Dependent Items (via LLD)

  • backup.connectivity[{#CLIENT}] – Online/offline state
  • backup.last.backup[{#CLIENT}] – Unix timestamp of last backup
  • backup.state[{#CLIENT}] – Backup state (OK, failed, etc.)
  • backup.total.size[{#CLIENT}] – Backup size in MB

All dependent items use JSONPath preprocessing to extract data from the raw log.


✅ Conclusion

Efficient template for monitoring UrBackup clients through local JSON log files.
Ideal for environments where direct API access is not available.
Fully supports dynamic client discovery, detailed backup insights, and trigger customization.


About

Zabbix 7.0+ Template for monitoring UrBackup clients using JSON log parsing and LLD.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages