
# Veeam Backup Enterprise Manager by HTTP

## Overview

It works without any external scripts and uses the script item. 

***NOTE:*** Veeam Backup Enterprise Manager REST API may not be available for some editions, the template will only work with the following editions of Veeam Backup and Replication:

1. Veeam Universal License (VUL) editions:
* Foundation
* Advanced
* Premium

2. Veeam Socket License editions:
* Enterprise Socket
* Enterprise Plus Socket 

> See [Veeam Data Platform Feature Comparison](https://www.veeam.com/licensing-pricing.html) for more details.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Veeam Backup and Replication, version 11.0

## Configuration

> Zabbix should be configured according to the instructions in the [Templates out of the box](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box) section.

## Setup

> See [Zabbix template operation](https://www.zabbix.com/documentation/7.0/manual/config/templates_out_of_the_box/http) for basic instructions.

1. Create a user to monitor the service, or use an existing read-only account.
  Similarly to the user authentication in the Veeam Backup Enterprise Manager Web UI, 
  the client authentication in the REST API dictates which operations a client is allowed to perform when working with the REST API.
  That is, if the client is authenticated using an account that does not have enough permissions to perform some actions, it will not be able to execute them.
  You can also obtain the collected jobs if you are logged in under an account having only `Portal Administrator` role.
> See [Veeam Help Center](https://helpcenter.veeam.com/docs/backup/em_rest/http_authentication.html?ver=110) for more details.
2. Link the template to a host.
3. Configure the following macros: `{$VEEAM.MANAGER.API.URL}`, `{$VEEAM.MANAGER.USER}`, `{$VEEAM.MANAGER.PASSWORD}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$VEEAM.MANAGER.API.URL}|
Veeam Backup Enterprise Manager API endpoint is a URL in the format: `<scheme>://<host>:<port>`.
|`https://localhost:9398`|
|{$VEEAM.MANAGER.HTTP.PROXY}|
Sets the HTTP proxy to `http_proxy` value. If this parameter is empty, then no proxy is used.
||
|{$VEEAM.MANAGER.PASSWORD}|
The `password` of the Veeam Backup Enterprise Manager account.
||
|{$VEEAM.MANAGER.USER}|
The `user name` of the Veeam Backup Enterprise Manager account .
||
|{$VEEAM.MANAGER.DATA.TIMEOUT}|
A response timeout for API.
|`10`|
|{$BACKUP.TYPE.MATCHES}|
This macro is used in backup discovery rule.
|`.*`|
|{$BACKUP.TYPE.NOT_MATCHES}|
This macro is used in backup discovery rule.
|`CHANGE_IF_NEEDED`|
|{$BACKUP.NAME.MATCHES}|
This macro is used in backup discovery rule.
|`.*`|
|{$BACKUP.NAME.NOT_MATCHES}|
This macro is used in backup discovery rule.
|`CHANGE_IF_NEEDED`|
|{$VEEAM.MANAGER.JOB.MAX.WARN}|
The maximum score of warning jobs (for a trigger expression).
|`10`|
|{$VEEAM.MANAGER.JOB.MAX.FAIL}|
The maximum score of failed jobs (for a trigger expression).
|`5`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get metrics|
The result of API requests is expressed in the JSON.
|Script|veeam.manager.get.metrics|
|Get errors|
The errors from API requests.
|Dependent item|veeam.manager.get.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to

- 
Discard unchanged with heartbeat: `1h`

|
|Running Jobs|
Informs about the running jobs.
|Dependent item|veeam.manager.running.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.RunningJobs`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Scheduled Jobs|
Informs about the scheduled jobs.
|Dependent item|veeam.manager.scheduled.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.ScheduledJobs`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Scheduled Backup Jobs|
Informs about the scheduled backup jobs.
|Dependent item|veeam.manager.scheduled.backup.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.ScheduledBackupJobs`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Scheduled Replica Jobs|
Informs about the scheduled replica jobs.
|Dependent item|veeam.manager.scheduled.replica.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.ScheduledReplicaJobs`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Total Job Runs|
Informs about the total job runs.
|Dependent item|veeam.manager.scheduled.total.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.TotalJobRuns`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Warnings Job Runs|
Informs about the warning job runs.
|Dependent item|veeam.manager.warning.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.WarningsJobRuns`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Failed Job Runs|
Informs about the failed job runs.
|Dependent item|veeam.manager.failed.jobs
**Preprocessing**

- 
JSON Path: `$.JobStatistics.FailedJobRuns`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Veeam Backup: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Veeam Backup Enterprise Manager by HTTP/veeam.manager.get.errors))>0`|Average||
|Veeam Backup: Warning job runs is too high||`last(/Veeam Backup Enterprise Manager by HTTP/veeam.manager.warning.jobs)>{$VEEAM.MANAGER.JOB.MAX.WARN}`|Warning|**Manual close**: Yes|
|Veeam Backup: Failed job runs is too high||`last(/Veeam Backup Enterprise Manager by HTTP/veeam.manager.failed.jobs)>{$VEEAM.MANAGER.JOB.MAX.FAIL}`|Average|**Manual close**: Yes|

### LLD rule Backup Files discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Backup Files discovery|
Discovery of all backup files created on, or imported to the backup servers that are connected to Veeam Backup Enterprise Manager.
|Dependent item|veeam.backup.files.discovery
**Preprocessing**

- 
JSON Path: `$.backupFiles.Refs`

- 
Discard unchanged with heartbeat: `6h`

|

### Item prototypes for Backup Files discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Backup Size [{#NAME}]|
Gets the backup size with the name `[{#NAME}]`.
|Dependent item|veeam.backup.file.size[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.['{#NAME}'].BackupFile.BackupSize`

⛔️Custom on fail: Discard value

|
|Data Size [{#NAME}]|
Gets the data size with the name `[{#NAME}]`.
|Dependent item|veeam.backup.data.size[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.['{#NAME}'].BackupFile.DataSize`

⛔️Custom on fail: Discard value

|
|Compression ratio [{#NAME}]|
Gets the data compression ratio with the name `[{#NAME}]`.
|Dependent item|veeam.backup.compress.ratio[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.['{#NAME}'].BackupFile.CompressRatio`

⛔️Custom on fail: Discard value

|
|Deduplication Ratio [{#NAME}]|
Gets the data deduplication ratio with the name `[{#NAME}]`.
|Dependent item|veeam.backup.deduplication.ratio[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.['{#NAME}'].BackupFile.DeduplicationRatio`

⛔️Custom on fail: Discard value

|

## Feedback

Please report any issues with the template at [`https://support.zabbix.com`](https://support.zabbix.com)

You can also provide feedback, discuss the template, or ask for help at [`ZABBIX forums`](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback)

