- Description
- Features
- Requirements
- Setup
- Configuration File
- Zabbix Configuration
- Items
- Discovery
- Triggers
This template uses SQL queries to retrieve Veeam Backup & Replication job and repository data and sends it to Zabbix using a PowerShell script.
The script supports both:
- Microsoft SQL Server (native .NET provider)
- PostgreSQL (via ODBC)
The script outputs JSON for discovery and dependent items.
- Supports Veeam Backup & Replication v11 → v13
- Supports Zabbix 7.x
- Multi-database support:
- SQL Server (integrated or SQL authentication)
- PostgreSQL (ODBC driver required)
- Automatic Low-Level Discovery (LLD):
- Jobs
- Repositories
- Secure credential handling via external config file
- No hardcoded credentials in script
- Zabbix Agent or Zabbix Agent 2
- PowerShell 5.1+
- Network access to Veeam database
- TCP/IP enabled
- SQL authentication (optional)
- PostgreSQL ODBC driver: https://www.postgresql.org/ftp/odbc/versions/msi/
USE [VeeamBackup]
CREATE LOGIN [zabbixveeam] WITH PASSWORD = N'CHANGEME', CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF;
CREATE USER [zabbixveeam] FOR LOGIN [zabbixveeam];
EXEC sp_addrolemember 'db_datareader', 'zabbixveeam';
GOCREATE USER zabbixveeam WITH PASSWORD 'CHANGEME';
GRANT CONNECT ON DATABASE "VeeamBackup" TO zabbixveeam;
GRANT USAGE ON SCHEMA public TO zabbixveeam;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO zabbixveeam;Copy script:
zabbix_vbr_jobs.ps1
to:
C:\Program Files\Zabbix Agent\scripts\
Create file:
zabbix_vbr.conf
Place it in the same directory as the script.
SQLServer=SQLSERVER\INSTANCE
SQLDatabase=VeeamBackup
SQLIntegratedSecurity=false
SQLUsername=zabbixveeam
SQLPassword=CHANGEME
VeeamServer=VEEAM01
DBProvider=SqlServerSQLServer=localhost
SQLPort=5432
SQLDatabase=VeeamBackup
SQLIntegratedSecurity=false
SQLUsername=postgres
SQLPassword=CHANGEME
VeeamServer=VEEAM01
DBProvider=Postgres$path = "zabbix_vbr.conf"
$acl = Get-Acl $path
$acl.SetAccessRuleProtection($true,$false)
$acl.SetAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("NT SERVICE\ZabbixAgent","Read","Allow")))
$acl.SetAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("SYSTEM","FullControl","Allow")))
$acl.SetAccessRule((New-Object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Administrators","FullControl","Allow")))
Set-Acl $path $aclAdd to agent config:
UserParameter=veeam.info[*],powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Zabbix Agent\scripts\zabbix_vbr_jobs.ps1" -Config "C:\Program Files\Zabbix Agent\scripts\zabbix_vbr.conf" -Operation "$1"
- veeam.info[RepoInfo]
- veeam.info[JobsInfo]
- veeam.info[TotalJob]
- Import Template_Veeam_Backup_And_Replication.yaml
- Link template to host
(Measure-Command { & "C:\Program Files\Zabbix Agent\scripts\zabbix_vbr_jobs.ps1" -Operation "JobsInfo" }).TotalSeconds- Veeam Job Info (JSON)
- Veeam Repository Info (JSON)
- Total number of jobs
Automatically discovers:
- Backup jobs
- Replication jobs
- Tape jobs
- Backup Copy jobs
- Backup Sync jobs
- Agent jobs
- RMAN jobs
- Result
- Progress
- Start / End time
- Duration
- Retry status
- Failure reason
- Size metrics
- Speed
- Total space
- Free space
- Used space
- Percent free
- Out-of-date status
- No data in RepoInfo
- No data in JobsInfo
- Job failed
- Job failed (with retry)
- Job warning
- Job warning (with retry)
- Job running too long
- Low free space (default < 20%)
- Repository out-of-date
- PostgreSQL support is implemented but not fully tested due to lack of a Veeam environment using PostgreSQL. Feedback and validation are welcome.
- Script supports both SQL Server and PostgreSQL transparently
- PostgreSQL requires ODBC driver
- Config file is mandatory (no inline credentials)
- JSON output is consumed by dependent items
-
Original author: romainsi
-
Contributors:
-
Acknowledgements:
- PostgreSQL support was added by adapting the existing SQL Server logic and using community PostgreSQL-related scripts from aaeMotoko and smolkik-code as reference material. Final implementation (ODBC) was AI-assisted.
3.2