
# Azure by HTTP

## Overview

- This template is designed to monitor Microsoft Azure by HTTP.
- It works without any external scripts and uses the script item.
- Currently, the template supports the discovery of virtual machines (VMs), VM scale sets, Cosmos DB for MongoDB, storage accounts, Microsoft SQL, MySQL, and PostgreSQL servers.

## Included Monitoring Templates

- *Azure Virtual Machine by HTTP*
- *Azure VM Scale Set by HTTP*
- *Azure MySQL Flexible Server by HTTP*
- *Azure MySQL Single Server by HTTP*
- *Azure PostgreSQL Flexible Server by HTTP*
- *Azure PostgreSQL Single Server by HTTP*
- *Azure Microsoft SQL Serverless Database by HTTP*
- *Azure Microsoft SQL DTU Database by HTTP*
- *Azure Microsoft SQL Database by HTTP*
- *Azure SQL Managed Instance by HTTP*
- *Azure Cost Management by HTTP*
- *Azure Backup Jobs by HTTP*

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, and `{$AZURE.SUBSCRIPTION.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.VM.NAME.MATCHES}|
This macro is used in virtual machines discovery rule.
|`.*`|
|{$AZURE.VM.NAME.NOT.MATCHES}|
This macro is used in virtual machines discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.VM.LOCATION.MATCHES}|
This macro is used in virtual machines discovery rule.
|`.*`|
|{$AZURE.VM.LOCATION.NOT.MATCHES}|
This macro is used in virtual machines discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.SCALESET.NAME.MATCHES}|
This macro is used in virtual machine scale sets discovery rule.
|`.*`|
|{$AZURE.SCALESET.NAME.NOT.MATCHES}|
This macro is used in virtual machine scale sets discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.SCALESET.LOCATION.MATCHES}|
This macro is used in virtual machine scale sets discovery rule.
|`.*`|
|{$AZURE.SCALESET.LOCATION.NOT.MATCHES}|
This macro is used in virtual machine scale sets discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.SQL.INST.NAME.MATCHES}|
This macro is used in Azure SQL Managed Instance discovery rule.
|`.*`|
|{$AZURE.SQL.INST.NAME.NOT.MATCHES}|
This macro is used in Azure SQL Managed Instance discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.SQL.INST.LOCATION.MATCHES}|
This macro is used in Azure SQL Managed Instance discovery rule.
|`.*`|
|{$AZURE.SQL.INST.LOCATION.NOT.MATCHES}|
This macro is used in Azure SQL Managed Instance discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.VAULT.NAME.MATCHES}|
This macro is used in Azure Vault discovery rule.
|`.*`|
|{$AZURE.VAULT.NAME.NOT.MATCHES}|
This macro is used in Azure Vault discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.VAULT.LOCATION.MATCHES}|
This macro is used in Azure Vault discovery rule.
|`.*`|
|{$AZURE.VAULT.LOCATION.NOT.MATCHES}|
This macro is used in Azure Vault discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.STORAGE.ACC.NAME.MATCHES}|
This macro is used in storage accounts discovery rule.
|`.*`|
|{$AZURE.STORAGE.ACC.NAME.NOT.MATCHES}|
This macro is used in storage accounts discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.STORAGE.ACC.LOCATION.MATCHES}|
This macro is used in storage accounts discovery rule.
|`.*`|
|{$AZURE.STORAGE.ACC.LOCATION.NOT.MATCHES}|
This macro is used in storage accounts discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.STORAGE.ACC.AVAILABILITY}|
The warning threshold of the storage account availability.
|`70`|
|{$AZURE.STORAGE.ACC.BLOB.AVAILABILITY}|
The warning threshold of the storage account blob services availability.
|`70`|
|{$AZURE.STORAGE.ACC.TABLE.AVAILABILITY}|
The warning threshold of the storage account table services availability.
|`70`|
|{$AZURE.RESOURCE.GROUP.MATCHES}|
This macro is used in discovery rules.
|`.*`|
|{$AZURE.RESOURCE.GROUP.NOT.MATCHES}|
This macro is used in discovery rules.
|`CHANGE_IF_NEEDED`|
|{$AZURE.MYSQL.DB.NAME.MATCHES}|
This macro is used in MySQL servers discovery rule.
|`.*`|
|{$AZURE.MYSQL.DB.NAME.NOT.MATCHES}|
This macro is used in MySQL servers discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.MYSQL.DB.LOCATION.MATCHES}|
This macro is used in MySQL servers discovery rule.
|`.*`|
|{$AZURE.MYSQL.DB.LOCATION.NOT.MATCHES}|
This macro is used in MySQL servers discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.PGSQL.DB.NAME.MATCHES}|
This macro is used in PostgreSQL servers discovery rule.
|`.*`|
|{$AZURE.PGSQL.DB.NAME.NOT.MATCHES}|
This macro is used in PostgreSQL servers discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.PGSQL.DB.LOCATION.MATCHES}|
This macro is used in PostgreSQL servers discovery rule.
|`.*`|
|{$AZURE.PGSQL.DB.LOCATION.NOT.MATCHES}|
This macro is used in PostgreSQL servers discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.MSSQL.DB.NAME.MATCHES}|
This macro is used in Microsoft SQL databases discovery rule.
|`.*`|
|{$AZURE.MSSQL.DB.NAME.NOT.MATCHES}|
This macro is used in Microsoft SQL databases discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.MSSQL.DB.LOCATION.MATCHES}|
This macro is used in Microsoft SQL databases discovery rule.
|`.*`|
|{$AZURE.MSSQL.DB.LOCATION.NOT.MATCHES}|
This macro is used in Microsoft SQL databases discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.MSSQL.DB.SIZE.NOT.MATCHES}|
This macro is used in Microsoft SQL databases discovery rule.
|`^System$`|
|{$AZURE.COSMOS.MONGO.DB.NAME.MATCHES}|
This macro is used in Microsoft Cosmos DB account discovery rule.
|`.*`|
|{$AZURE.COSMOS.MONGO.DB.NAME.NOT.MATCHES}|
This macro is used in Microsoft Cosmos DB account discovery rule.
|`CHANGE_IF_NEEDED`|
|{$AZURE.COSMOS.MONGO.DB.LOCATION.MATCHES}|
This macro is used in Microsoft Cosmos DB account discovery rule.
|`.*`|
|{$AZURE.COSMOS.MONGO.DB.LOCATION.NOT.MATCHES}|
This macro is used in Microsoft Cosmos DB account discovery rule.
|`CHANGE_IF_NEEDED`|

### Items

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

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Get storage accounts|
The result of API requests is expressed in the JSON.
|Script|azure.get.storage.acc|
|Get storage accounts errors|
The errors from API requests.
|Dependent item|azure.get.storage.acc.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to

- 
Discard unchanged with heartbeat: `1h`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure by HTTP/azure.get.errors))>0`|Average||
|Azure: There are errors in storages requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure by HTTP/azure.get.storage.acc.errors))>0`|Average|**Depends on**:

- Azure: There are errors in requests to API
|

### LLD rule Storage accounts discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Storage accounts discovery|
The list of all storage accounts available under the subscription.
|Dependent item|azure.storage.acc.discovery
**Preprocessing**

- 
Discard unchanged with heartbeat: `6h`

|

### Item prototypes for Storage accounts discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Storage account [{#NAME}]: Get data|
The HTTP API endpoint that returns storage metrics with the name `[{#NAME}]`.
|Script|azure.get.storage.acc[{#NAME}]|
|Storage account [{#NAME}]: Used Capacity|
The amount of storage used by the storage account with the name `[{#NAME}]`, expressed in bytes.

For standard storage accounts, it's the sum of capacity used by blob, table, file, and queue.

For premium storage accounts and blob storage accounts, it is the same as BlobCapacity or FileCapacity.
|Dependent item|azure.storage.used.capacity[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.UsedCapacity.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Transactions|
The number of requests made to the storage service or a specified API operation.

This number includes successful and failed requests and also requests that produced errors.

Use `ResponseType` dimension for the number of different types of responses.
|Dependent item|azure.storage.transactions[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.Transactions.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Ingress|
The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.
|Dependent item|azure.storage.ingress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.Ingress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Egress|
The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.

As a result, this number does not reflect billable egress.
|Dependent item|azure.storage.engress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.Egress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Success Server Latency|
The average time used to process a successful request by Azure Storage.

This value does not include the network latency specified in `SuccessE2ELatency`.
|Dependent item|azure.storage.success.server.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.SuccessServerLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Success E2E Latency|
The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.

This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
|Dependent item|azure.storage.success.e2e.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.SuccessE2ELatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Availability|
The percentage of availability for the storage service or a specified API operation.

Availability is calculated by taking the `TotalBillableRequests` value and dividing it by the number of applicable requests, including those that produced unexpected errors.

All unexpected errors result in reduced availability for the storage service or the specified API operation.
|Dependent item|azure.storage.availability[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.storageAccount.Availability.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Capacity|
The amount of storage used by the blob service of the storage account with the name `[{#NAME}]`, expressed in bytes.
|Dependent item|azure.storage.blob.capacity[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.BlobCapacity.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Count|
The number of blob objects stored in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.blob.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.BlobCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Container Count|
The number of containers in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.blob.container.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.ContainerCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Index Capacity|
The amount of storage with the name `[{#NAME}]` used by the Azure Data Lake Storage Gen2 hierarchical index.
|Dependent item|azure.storage.blob.index.capacity[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.IndexCapacity.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Transactions|
The number of requests made to the storage service or a specified API operation.

This number includes successful and failed requests and also requests that produced errors.

Use `ResponseType` dimension for the number of different types of responses.
|Dependent item|azure.storage.blob.transactions[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.Transactions.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Ingress|
The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.
|Dependent item|azure.storage.blob.ingress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.Ingress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Egress|
The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.

As a result, this number does not reflect billable egress.
|Dependent item|azure.storage.blob.engress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.Egress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Success Server Latency|
The average time used to process a successful request by Azure Storage.

This value does not include the network latency specified in `SuccessE2ELatency`.
|Dependent item|azure.storage.blob.success.server.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.SuccessServerLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Success E2E Latency|
The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.

This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
|Dependent item|azure.storage.blob.success.e2e.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.SuccessE2ELatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Blob Availability|
The percentage of availability for the storage service or a specified API operation.

Availability is calculated by taking the `TotalBillableRequests` value and dividing it by the number of applicable requests, including those that produced unexpected errors.

All unexpected errors result in reduced availability for the storage service or the specified API operation.
|Dependent item|azure.storage.blob.availability[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.blobServices.Availability.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Capacity|
The amount of storage used by the table service of the storage account with the name `[{#NAME}]`, expressed in bytes.
|Dependent item|azure.storage.table.capacity[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.TableCapacity.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Count|
The number of tables in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.table.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.TableCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Entity Count|
The number of table entities in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.table.entity.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.TableEntityCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Transactions|
The number of requests made to the storage service or a specified API operation.

This number includes successful and failed requests and also requests that produced errors.

Use `ResponseType` dimension for the number of different types of responses.
|Dependent item|azure.storage.table.transactions[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.Transactions.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Ingress|
The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.
|Dependent item|azure.storage.table.ingress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.Ingress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Egress|
The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.

As a result, this number does not reflect billable egress.
|Dependent item|azure.storage.table.engress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.Egress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Success Server Latency|
The average time used to process a successful request by Azure Storage.

This value does not include the network latency specified in `SuccessE2ELatency`.
|Dependent item|azure.storage.table.success.server.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.SuccessServerLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Success E2E Latency|
The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.

This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
|Dependent item|azure.storage.table.success.e2e.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.SuccessE2ELatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Table Availability|
The percentage of availability for the storage service or a specified API operation.

Availability is calculated by taking the `TotalBillableRequests` value and dividing it by the number of applicable requests, including those that produced unexpected errors.

All unexpected errors result in reduced availability for the storage service or the specified API operation.
|Dependent item|azure.storage.table.availability[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.tableServices.Availability.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Capacity|
The amount of file storage used by the storage account with the name `[{#NAME}]`, expressed in bytes.
|Dependent item|azure.storage.file.capacity[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.FileCapacity.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Count|
The number of files in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.file.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.FileCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Share Count|
The number of file shares in the storage account.
|Dependent item|azure.storage.file.share.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.FileShareCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Share Snapshot Count|
The number of snapshots present on the share in storage account's Files Service.
|Dependent item|azure.storage.file.shares.snapshot.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.FileShareSnapshotCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Share Snapshot Size|
The amount of storage used by the snapshots in storage account's File service, in bytes.
|Dependent item|azure.storage.file.share.snapshot.size[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.FileShareSnapshotSize.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Share Capacity Quota|
The upper limit on the amount of storage that can be used by Azure Files Service, in bytes.
|Dependent item|azure.storage.file.share.capacity.quota[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.FileShareCapacityQuota.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Transactions|
The number of requests made to the storage service or a specified API operation.

This number includes successful and failed requests and also requests that produced errors.

Use `ResponseType` dimension for the number of different types of responses.
|Dependent item|azure.storage.file.transactions[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.Transactions.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Ingress|
The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.
|Dependent item|azure.storage.file.ingress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.Ingress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Egress|
The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.

As a result, this number does not reflect billable egress.
|Dependent item|azure.storage.file.engress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.Egress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Success Server Latency|
The average time used to process a successful request by Azure Storage.

This value does not include the network latency specified in `SuccessE2ELatency`.
|Dependent item|azure.storage.file.success.server.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.SuccessServerLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: File Success E2E Latency|
The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.

This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
|Dependent item|azure.storage.file.success.e2e.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.fileServices.file.SuccessE2ELatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Capacity|
The amount of queue storage used by the storage account with the name `[{#NAME}]`, expressed in bytes.
|Dependent item|azure.storage.queue.capacity[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.QueueCapacity.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Count|
The number of queues in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.queue.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.QueueCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Message Count|
The number of unexpired queue messages in the storage account with the name `[{#NAME}]`.
|Dependent item|azure.storage.queue.message.count[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.QueueMessageCount.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Transactions|
The number of requests made to the storage service or a specified API operation.

This number includes successful and failed requests and also requests that produced errors.

Use `ResponseType` dimension for the number of different types of responses.
|Dependent item|azure.storage.queue.transactions[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.Transactions.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Ingress|
The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.
|Dependent item|azure.storage.queue.ingress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.Ingress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Egress|
The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.

As a result, this number does not reflect billable egress.
|Dependent item|azure.storage.queue.engress[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.Egress.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Success Server Latency|
The average time used to process a successful request by Azure Storage.

This value does not include the network latency specified in `SuccessE2ELatency`.
|Dependent item|azure.storage.queue.success.server.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.SuccessServerLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|
|Storage account [{#NAME}]: Queue Success E2E Latency|
The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.

This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
|Dependent item|azure.storage.queue.success.e2e.latency[{#NAME}]
**Preprocessing**

- 
JSON Path: `$.queueServices.queue.SuccessE2ELatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

- 
Discard unchanged with heartbeat: `3h`

|

### Trigger prototypes for Storage accounts discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure: Storage account [{#NAME}]: Availability is low||`(min(/Azure by HTTP/azure.storage.availability[{#NAME}],#3))<{$AZURE.STORAGE.ACC.AVAILABILITY:"{#NAME}"}`|Warning||
|Azure: Storage account [{#NAME}]: Blob Availability is low||`(min(/Azure by HTTP/azure.storage.blob.availability[{#NAME}],#3))<{$AZURE.STORAGE.ACC.BLOB.AVAILABILITY:"{#NAME}"}`|Warning||
|Azure: Storage account [{#NAME}]: Table Availability is low||`(min(/Azure by HTTP/azure.storage.table.availability[{#NAME}],#3))<{$AZURE.STORAGE.ACC.TABLE.AVAILABILITY:"{#NAME}"}`|Warning||

### LLD rule Virtual machines discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Virtual machines discovery|
The list of virtual machines provided by the subscription.
|Dependent item|azure.vm.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule Virtual machine scale set discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Virtual machine scale set discovery|
The list of virtual machine scale sets provided by the subscription.
|Dependent item|azure.scaleset.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule Azure SQL managed instance discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure SQL managed instance discovery|
The list of Azure SQL managed instances provided by the subscription.
|Dependent item|azure.sql_inst.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule Azure Vault discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure Vault discovery|
The list of Azure Recovery Services and Backup vaults provided by the subscription.
|Dependent item|azure.vault.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule MySQL servers discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|MySQL servers discovery|
The list of MySQL servers provided by the subscription.
|Dependent item|azure.mysql.servers.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule PostgreSQL servers discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|PostgreSQL servers discovery|
The list of PostgreSQL servers provided by the subscription.
|Dependent item|azure.pgsql.servers.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule Microsoft SQL databases discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Microsoft SQL databases discovery|
The list of Microsoft SQL databases provided by the subscription.
|Dependent item|azure.mssql.databases.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

### LLD rule Cosmos DB account discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Cosmos DB account discovery|
The list of Cosmos databases provided by the subscription.
|Dependent item|azure.cosmos.mongo.db.discovery
**Preprocessing**

- 
JSON Path: `$.resources.value`

- 
Discard unchanged with heartbeat: `6h`

|

# Azure VM Scale Set by HTTP

## Overview

This template is designed to monitor Microsoft Azure virtual machine scale sets by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure virtual machine scale sets

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure virtual machine ID.
||
|{$AZURE.SCALESET.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.SCALESET.VM.COUNT.CRIT}|
The critical amount of virtual machines in the scale set.
|`100`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
Gathers data of the virtual machine scale set.
|Script|azure.scaleset.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.scaleset.data.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to: ``</p></li><li><p>Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.

0 - Available - no events detected that affect the health of the resource.

1 - Degraded  - your resource detected a loss in performance, although it's still available for use.

2 - Unavailable - the service detected an ongoing platform or non-platform event that affects the health of the resource.

3 - Unknown - Resource Health hasn't received information about the resource for more than 10 minutes.
|Dependent item|azure.scaleset.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of availability status.
|Dependent item|azure.scaleset.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Virtual machine count|
Current amount of virtual machines in the scale set.
|Dependent item|azure.scaleset.vm.count
**Preprocessing**

- 
JSON Path: `$.capacity`

- 
Discard unchanged with heartbeat: `1h`

|
|Available memory|
Amount of physical memory, in bytes, immediately available for allocation to a process or for system use in the virtual machine.
|Dependent item|azure.scaleset.vm.memory
**Preprocessing**

- 
JSON Path: `$.metrics.AvailableMemoryBytes.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|CPU credits consumed|
Total number of credits consumed by the virtual machine. Only available on B-series burstable VMs.
|Dependent item|azure.scaleset.cpu.credits.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.CPUCreditsConsumed.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|CPU credits remaining|
Total number of credits available to burst. Only available on B-series burstable VMs.
|Dependent item|azure.scaleset.cpu.credits.remaining
**Preprocessing**

- 
JSON Path: `$.metrics.CPUCreditsRemaining.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|CPU utilization|
The percentage of allocated compute units that are currently in use by the virtual machine(s).
|Dependent item|azure.scaleset.cpu.utilization
**Preprocessing**

- 
JSON Path: `$.metrics.PercentageCPU.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk bandwidth consumed|
Percentage of data disk bandwidth consumed per minute.
|Dependent item|azure.scaleset.data.disk.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk IOPS consumed|
Percentage of data disk I/Os consumed per minute.
|Dependent item|azure.scaleset.data.disk.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk read rate|
Bytes/sec read from a single disk during the monitoring period.
|Dependent item|azure.scaleset.data.disk.read.bps
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskReadBytessec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk IOPS read|
Read IOPS from a single disk during the monitoring period.
|Dependent item|azure.scaleset.data.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk used burst BPS credits|
Percentage of data disk burst bandwidth credits used so far.
|Dependent item|azure.scaleset.data.disk.bandwidth.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskUsedBurstBPSCreditsPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk used burst IO credits|
Percentage of data disk burst I/O credits used so far.
|Dependent item|azure.scaleset.data.disk.iops.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskUsedBurstIOCreditsPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk write rate|
Bytes/sec written to a single disk during the monitoring period.
|Dependent item|azure.scaleset.data.disk.write.bps
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskWriteBytessec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk IOPS write|
Write IOPS from a single disk during the monitoring period.
|Dependent item|azure.scaleset.data.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk queue depth|
Data disk queue depth (or queue length).
|Dependent item|azure.scaleset.data.disk.queue.depth
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskQueueDepth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk target bandwidth|
Baseline byte-per-second throughput the data disk can achieve without bursting.
|Dependent item|azure.scaleset.data.disk.bandwidth.target
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskTargetBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk target IOPS|
Baseline IOPS the data disk can achieve without bursting.
|Dependent item|azure.scaleset.data.disk.iops.target
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskTargetIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk max burst bandwidth|
Maximum byte-per-second throughput the data disk can achieve with bursting.
|Dependent item|azure.scaleset.data.disk.bandwidth.burst.max
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskMaxBurstBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk max burst IOPS|
Maximum IOPS the data disk can achieve with bursting.
|Dependent item|azure.scaleset.data.disk.iops.burst.max
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskMaxBurstIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Disk read|
Bytes read from the disk during the monitoring period.
|Dependent item|azure.scaleset.disk.read
**Preprocessing**

- 
JSON Path: `$.metrics.DiskReadBytes.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Disk IOPS read|
Disk read IOPS.
|Dependent item|azure.scaleset.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Disk write|
Bytes written to the disk during the monitoring period.
|Dependent item|azure.scaleset.disk.write
**Preprocessing**

- 
JSON Path: `$.metrics.DiskWriteBytes.total`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Disk IOPS write|
Write IOPS from a single disk during the monitoring period.
|Dependent item|azure.scaleset.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Inbound flows|
Inbound Flows are the number of current flows in the inbound direction (traffic going into the VMs).
|Dependent item|azure.scaleset.flows.inbound
**Preprocessing**

- 
JSON Path: `$.metrics.InboundFlows.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Outbound flows|
Outbound Flows are the number of current flows in the outbound direction (traffic going out of the VMs).
|Dependent item|azure.scaleset.flows.outbound
**Preprocessing**

- 
JSON Path: `$.metrics.OutboundFlows.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Network in total|
The number of bytes received on all network interfaces by the virtual machine(s) (incoming traffic).
|Dependent item|azure.scaleset.network.in.total
**Preprocessing**

- 
JSON Path: `$.metrics.NetworkInTotal.total`

⛔️Custom on fail: Discard value

|
|Network out total|
The number of bytes out on all network interfaces by the virtual machine(s) (outgoing traffic).
|Dependent item|azure.scaleset.network.out.total
**Preprocessing**

- 
JSON Path: `$.metrics.NetworkOutTotal.total`

⛔️Custom on fail: Discard value

|
|Inbound flow maximum creation rate|
The maximum creation rate of inbound flows (traffic going into the VM).
|Dependent item|azure.scaleset.flows.inbound.max
**Preprocessing**

- 
JSON Path: `$.metrics.InboundFlowsMaximumCreationRate.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Outbound flow maximum creation rate|
The maximum creation rate of outbound flows (traffic going out of the VM).
|Dependent item|azure.scaleset.flows.outbound.max
**Preprocessing**

- 
JSON Path: `$.metrics.OutboundFlowsMaximumCreationRate.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk read rate|
Bytes/sec read from a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.scaleset.os.disk.read.bps
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskReadBytessec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk write rate|
Bytes/sec written to a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.scaleset.os.disk.write.bps
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskWriteBytessec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk IOPS read|
Read IOPS from a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.scaleset.os.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk IOPS write|
Write IOPS from a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.scaleset.os.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk queue depth|
OS Disk queue depth (or queue length).
|Dependent item|azure.scaleset.os.disk.queue.depth
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskQueueDepth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk bandwidth consumed|
Percentage of operating system disk bandwidth consumed per minute.
|Dependent item|azure.scaleset.os.disk.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk IOPS consumed|
Percentage of operating system disk I/Os consumed per minute.
|Dependent item|azure.scaleset.os.disk.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk target bandwidth|
Baseline byte-per-second throughput the OS Disk can achieve without bursting.
|Dependent item|azure.scaleset.os.disk.bandwidth.target
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskTargetBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk target IOPS|
Baseline IOPS the OS disk can achieve without bursting.
|Dependent item|azure.scaleset.os.disk.iops.target
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskTargetIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk max burst bandwidth|
Maximum byte-per-second throughput the OS Disk can achieve with bursting.
|Dependent item|azure.scaleset.os.disk.bandwidth.max
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskMaxBurstBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk max burst IOPS|
Maximum IOPS the OS Disk can achieve with bursting.
|Dependent item|azure.scaleset.os.disk.iops.max
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskMaxBurstIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk used burst BPS credits|
Percentage of OS Disk burst bandwidth credits used so far.
|Dependent item|azure.scaleset.os.disk.bandwidth.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskUsedBurstBPSCreditsPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk used burst IO credits|
Percentage of OS Disk burst I/O credits used so far.
|Dependent item|azure.scaleset.os.disk.iops.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskUsedBurstIOCreditsPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Premium data disk cache read hit in %|
Percentage of premium data disk cache read hit.
|Dependent item|azure.scaleset.premium.data.disk.cache.read.hit
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumDataDiskCacheReadHit.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Premium data disk cache read miss in %|
Percentage of premium data disk cache read miss.
|Dependent item|azure.scaleset.premium.data.disk.cache.read.miss
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumDataDiskCacheReadMiss.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Premium OS disk cache read hit in %|
Percentage of premium OS disk cache read hit.
|Dependent item|azure.scaleset.premium.os.disk.cache.read.hit
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumOSDiskCacheReadHit.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Premium OS disk cache read miss in %|
Percentage of premium OS disk cache read miss.
|Dependent item|azure.scaleset.premium.os.disk.cache.read.miss
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumOSDiskCacheReadMiss.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|VM cached bandwidth consumed|
Percentage of cached disk bandwidth consumed by the VM.
|Dependent item|azure.scaleset.vm.cached.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMCachedBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|VM cached IOPS consumed|
Percentage of cached disk IOPS consumed by the VM.
|Dependent item|azure.scaleset.vm.cached.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMCachedIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|VM uncached bandwidth consumed|
Percentage of uncached disk bandwidth consumed by the VM.
|Dependent item|azure.scaleset.vm.uncached.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMUncachedBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|VM uncached IOPS consumed|
Percentage of uncached disk IOPS consumed by the VM.
|Dependent item|azure.scaleset.vm.uncached.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMUncachedIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|VM availability metric|
Measure of availability of the virtual machines over time.
|Dependent item|azure.scaleset.availability
**Preprocessing**

- 
JSON Path: `$.metrics.VmAvailabilityMetric.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure VM Scale: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure VM Scale Set by HTTP/azure.scaleset.data.errors))>0`|Average||
|Azure VM Scale: Virtual machine scale set is unavailable|
The resource state is unavailable.
|`last(/Azure VM Scale Set by HTTP/azure.scaleset.availability.state)=2`|High||
|Azure VM Scale: Virtual machine scale set is degraded|
The resource is in a degraded state.
|`last(/Azure VM Scale Set by HTTP/azure.scaleset.availability.state)=1`|Average||
|Azure VM Scale: Virtual machine scale set is in unknown state|
The resource state is unknown.
|`last(/Azure VM Scale Set by HTTP/azure.scaleset.availability.state)=3`|Warning||
|Azure VM Scale: High amount of VMs in the scale set|
High amount of VMs in the scale set.
|`min(/Azure VM Scale Set by HTTP/azure.scaleset.vm.count,5m)>{$AZURE.SCALESET.VM.COUNT.CRIT}`|High||
|Azure VM Scale: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure VM Scale Set by HTTP/azure.scaleset.cpu.utilization,5m)>{$AZURE.SCALESET.CPU.UTIL.CRIT}`|High||

# Azure Virtual Machine by HTTP

## Overview

This template is designed to monitor Microsoft Azure virtual machines (VMs) by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure virtual machines

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure virtual machine ID.
||
|{$AZURE.VM.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.vm.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.vm.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.

0 - Available - no events detected that affect the health of the resource.

1 - Degraded  - your resource detected a loss in performance, although it's still available for use.

2 - Unavailable - the service detected an ongoing platform or non-platform event that affects the health of the resource.

3 - Unknown - Resource Health hasn't received information about the resource for more than 10 minutes.
|Dependent item|azure.vm.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of availability status.
|Dependent item|azure.vm.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|CPU utilization|
Percentage of allocated compute units that are currently in use by virtual machine.
|Dependent item|azure.vm.cpu.utilization
**Preprocessing**

- 
JSON Path: `$.metrics.PercentageCPU.average`

⛔️Custom on fail: Discard value

|
|Disk read|
Bytes read from the disk during the monitoring period.
|Dependent item|azure.vm.disk.read.bytes
**Preprocessing**

- 
JSON Path: `$.metrics.DiskReadBytes.total`

⛔️Custom on fail: Discard value

|
|Disk write|
Bytes written to the disk during the monitoring period.
|Dependent item|azure.vm.disk.write.bytes
**Preprocessing**

- 
JSON Path: `$.metrics.DiskWriteBytes.total`

⛔️Custom on fail: Discard value

|
|Disk IOPS read|
The count of read operations from the disk per second.
|Dependent item|azure.vm.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

|
|Disk IOPS write|
The count of write operations to the disk per second.
|Dependent item|azure.vm.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

|
|CPU credits remaining|
Total number of credits available to burst. Available only on B-series burstable VMs.
|Dependent item|azure.vm.cpu.credits.remaining
**Preprocessing**

- 
JSON Path: `$.metrics.CPUCreditsRemaining.average`

⛔️Custom on fail: Discard value

|
|CPU credits consumed|
Total number of credits consumed by the virtual machine. Only available on B-series burstable VMs.
|Dependent item|azure.vm.cpu.credits.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.CPUCreditsConsumed.average`

⛔️Custom on fail: Discard value

|
|Data disk read rate|
Bytes per second read from a single disk during the monitoring period.
|Dependent item|azure.vm.data.disk.read.bps
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskReadBytessec.average`

⛔️Custom on fail: Discard value

|
|Data disk write rate|
Bytes per second written to a single disk during the monitoring period.
|Dependent item|azure.vm.data.disk.write.bps
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskWriteBytessec.average`

⛔️Custom on fail: Discard value

|
|Data disk IOPS read|
Read IOPS from a single disk during the monitoring period.
|Dependent item|azure.vm.data.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

|
|Data disk IOPS write|
Write IOPS from a single disk during the monitoring period.
|Dependent item|azure.vm.data.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

|
|Data disk queue depth|
The number of outstanding IO requests that are waiting to be performed on a disk.
|Dependent item|azure.vm.data.disk.queue.depth
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskQueueDepth.average`

⛔️Custom on fail: Discard value

|
|Data disk bandwidth consumed|
Percentage of the data disk bandwidth consumed per minute.
|Dependent item|azure.vm.data.disk.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|Data disk IOPS consumed|
Percentage of the data disk input/output (I/O) consumed per minute.
|Dependent item|azure.vm.data.disk.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|Data disk target bandwidth|
Baseline byte-per-second throughput that the data disk can achieve without bursting.
|Dependent item|azure.vm.data.disk.bandwidth.target
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskTargetBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk target IOPS|
Baseline IOPS that the data disk can achieve without bursting.
|Dependent item|azure.vm.data.disk.iops.target
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskTargetIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk max burst bandwidth|
Maximum byte-per-second throughput that the data disk can achieve with bursting.
|Dependent item|azure.vm.data.disk.bandwidth.max
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskMaxBurstBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk max burst IOPS|
Maximum IOPS that the data disk can achieve with bursting.
|Dependent item|azure.vm.data.disk.iops.max
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskMaxBurstIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Data disk used burst BPS credits|
Percentage of the data disk burst bandwidth credits used so far.
|Dependent item|azure.vm.data.disk.bandwidth.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskUsedBurstBPSCreditsPercentage.average`

⛔️Custom on fail: Discard value

|
|Data disk used burst IO credits|
Percentage of the data disk burst I/O credits used so far.
|Dependent item|azure.vm.data.disk.iops.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskUsedBurstIOCreditsPercentage.average`

⛔️Custom on fail: Discard value

|
|OS disk read rate|
Bytes/sec read from a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.vm.os.disk.read.bps
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskReadBytessec.average`

⛔️Custom on fail: Discard value

|
|OS disk write rate|
Bytes/sec written to a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.vm.os.disk.write.bps
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskWriteBytessec.average`

⛔️Custom on fail: Discard value

|
|OS disk IOPS read|
Read IOPS from a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.vm.os.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

|
|OS disk IOPS write|
Write IOPS from a single disk during the monitoring period - for an OS disk.
|Dependent item|azure.vm.os.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

|
|OS disk queue depth|
The OS disk queue depth (or queue length).
|Dependent item|azure.vm.os.disk.queue.depth
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskQueueDepth.average`

⛔️Custom on fail: Discard value

|
|OS disk bandwidth consumed|
Percentage of the operating system disk bandwidth consumed per minute.
|Dependent item|azure.vm.os.disk.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|OS disk IOPS consumed|
Percentage of the operating system disk I/Os consumed per minute.
|Dependent item|azure.vm.os.disk.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|OS disk target bandwidth|
Baseline byte-per-second throughput that the OS disk can achieve without bursting.
|Dependent item|azure.vm.os.disk.bandwidth.target
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskTargetBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk target IOPS|
Baseline IOPS that the OS disk can achieve without bursting.
|Dependent item|azure.vm.os.disk.iops.target
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskTargetIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk max burst bandwidth|
Maximum byte-per-second throughput that the OS disk can achieve with bursting.
|Dependent item|azure.vm.os.disk.bandwidth.max
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskMaxBurstBandwidth.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk max burst IOPS|
Maximum IOPS that the OS disk can achieve with bursting.
|Dependent item|azure.vm.os.disk.iops.max
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskMaxBurstIOPS.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|OS disk used burst BPS credits|
Percentage of the OS disk burst bandwidth credits used so far.
|Dependent item|azure.vm.os.disk.bandwidth.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskUsedBurstBPSCreditsPercentage.average`

⛔️Custom on fail: Discard value

|
|OS disk used burst IO credits|
Percentage of the OS disk burst I/O credits used so far.
|Dependent item|azure.vm.os.disk.iops.burst.used
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskUsedBurstIOCreditsPercentage.average`

⛔️Custom on fail: Discard value

|
|Inbound flows|
The number of current flows in the inbound direction (the traffic going into the VM).
|Dependent item|azure.vm.flows.inbound
**Preprocessing**

- 
JSON Path: `$.metrics.InboundFlows.average`

⛔️Custom on fail: Discard value

|
|Outbound flows|
The number of current flows in the outbound direction (the traffic going out of the VM).
|Dependent item|azure.vm.flows.outbound
**Preprocessing**

- 
JSON Path: `$.metrics.OutboundFlows.average`

⛔️Custom on fail: Discard value

|
|Inbound flows max creation rate|
Maximum creation rate of the inbound flows (the traffic going into the VM).
|Dependent item|azure.vm.flows.inbound.max
**Preprocessing**

- 
JSON Path: `$.metrics.InboundFlowsMaximumCreationRate.average`

⛔️Custom on fail: Discard value

|
|Outbound flows max creation rate|
Maximum creation rate of the outbound flows (the traffic going out of the VM).
|Dependent item|azure.vm.flows.outbound.max
**Preprocessing**

- 
JSON Path: `$.metrics.OutboundFlowsMaximumCreationRate.average`

⛔️Custom on fail: Discard value

|
|Premium data disk cache read hit in %|
Percentage of premium data disk cache read hit.
|Dependent item|azure.vm.premium.data.disk.cache.read.hit
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumDataDiskCacheReadHit.average`

⛔️Custom on fail: Discard value

|
|Premium data disk cache read miss in %|
Percentage of premium data disk cache read miss.
|Dependent item|azure.vm.premium.data.disk.cache.read.miss
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumDataDiskCacheReadMiss.average`

⛔️Custom on fail: Discard value

|
|Premium OS disk cache read hit in %|
Percentage of premium OS disk cache read hit.
|Dependent item|azure.vm.premium.os.disk.cache.read.hit
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumOSDiskCacheReadHit.average`

⛔️Custom on fail: Discard value

|
|Premium OS disk cache read miss in %|
Percentage of premium OS disk cache read miss.
|Dependent item|azure.vm.premium.os.disk.cache.read.miss
**Preprocessing**

- 
JSON Path: `$.metrics.PremiumOSDiskCacheReadMiss.average`

⛔️Custom on fail: Discard value

|
|VM cached bandwidth consumed|
Percentage of the cached disk bandwidth consumed by the VM.
|Dependent item|azure.vm.cached.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMCachedBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|VM cached IOPS consumed|
Percentage of the cached disk IOPS consumed by the VM.
|Dependent item|azure.vm.cached.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMCachedIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|VM uncached bandwidth consumed|
Percentage of the uncached disk bandwidth consumed by the VM.
|Dependent item|azure.vm.uncached.bandwidth.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMUncachedBandwidthConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|VM uncached IOPS consumed|
Percentage of the uncached disk IOPS consumed by the VM.
|Dependent item|azure.vm.uncached.iops.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.VMUncachedIOPSConsumedPercentage.average`

⛔️Custom on fail: Discard value

|
|Network in total|
The number of bytes received by the VM via all network interfaces (incoming traffic).
|Dependent item|azure.vm.network.in.total
**Preprocessing**

- 
JSON Path: `$.metrics.NetworkInTotal.total`

⛔️Custom on fail: Discard value

|
|Network out total|
The number of bytes sent by the VM via all network interfaces (outgoing traffic).
|Dependent item|azure.vm.network.out.total
**Preprocessing**

- 
JSON Path: `$.metrics.NetworkOutTotal.total`

⛔️Custom on fail: Discard value

|
|Available memory|
Amount of physical memory, in bytes, immediately available for the allocation to a process or for a system use in the virtual machine.
|Dependent item|azure.vm.memory.available
**Preprocessing**

- 
JSON Path: `$.metrics.AvailableMemoryBytes.average`

⛔️Custom on fail: Discard value

|
|Data disk latency|
Average time to complete each IO during the monitoring period for Data Disk.
|Dependent item|azure.vm.disk.latency
**Preprocessing**

- 
JSON Path: `$.metrics.DataDiskLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|OS disk latency|
Average time to complete each IO during the monitoring period for OS Disk.
|Dependent item|azure.vm.os.disk.latency
**Preprocessing**

- 
JSON Path: `$.metrics.OSDiskLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Temp disk latency|
Average time to complete each IO during the monitoring period for temp disk.
|Dependent item|azure.vm.temp.disk.latency
**Preprocessing**

- 
JSON Path: `$.metrics.TempDiskLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Temp disk read rate|
Bytes/Sec read from a single disk during the monitoring period for temp disk.
|Dependent item|azure.vm.temp.disk.read.bps
**Preprocessing**

- 
JSON Path: `$.metrics.TempDiskReadBytessec.average`

⛔️Custom on fail: Discard value

|
|Temp disk write rate|
Bytes/Sec written to a single disk during the monitoring period for temp disk.
|Dependent item|azure.vm.temp.disk.write.bps
**Preprocessing**

- 
JSON Path: `$.metrics.TempDiskWriteBytessec.average`

⛔️Custom on fail: Discard value

|
|Temp disk IOPS read|
Read IOPS from a single disk during the monitoring period for temp disk.
|Dependent item|azure.vm.temp.disk.read.ops
**Preprocessing**

- 
JSON Path: `$.metrics.TempDiskReadOperationsSec.average`

⛔️Custom on fail: Discard value

|
|Temp disk IOPS write|
Bytes/Sec written to a single disk during the monitoring period for temp disk.
|Dependent item|azure.vm.temp.disk.write.ops
**Preprocessing**

- 
JSON Path: `$.metrics.TempDiskWriteOperationsSec.average`

⛔️Custom on fail: Discard value

|
|Temp disk queue depth|
Temp Disk queue depth (or queue length).
|Dependent item|azure.vm.temp.disk.queue.depth
**Preprocessing**

- 
JSON Path: `$.metrics.TempDiskQueueDepth.average`

⛔️Custom on fail: Discard value

|
|VM availability metric|
Measure of availability of virtual machine over time.
|Dependent item|azure.vm.availability
**Preprocessing**

- 
JSON Path: `$.metrics.VmAvailabilityMetric.average`

⛔️Custom on fail: Discard value

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure VM: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Virtual Machine by HTTP/azure.vm.data.errors))>0`|Average||
|Azure VM: Virtual machine is unavailable|
The resource state is unavailable.
|`last(/Azure Virtual Machine by HTTP/azure.vm.availability.state)=2`|High||
|Azure VM: Virtual machine is degraded|
The resource is in a degraded state.
|`last(/Azure Virtual Machine by HTTP/azure.vm.availability.state)=1`|Average||
|Azure VM: Virtual machine is in unknown state|
The resource state is unknown.
|`last(/Azure Virtual Machine by HTTP/azure.vm.availability.state)=3`|Warning||
|Azure VM: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure Virtual Machine by HTTP/azure.vm.cpu.utilization,5m)>{$AZURE.VM.CPU.UTIL.CRIT}`|High||

# Azure MySQL Flexible Server by HTTP

## Overview

This template is designed to monitor Microsoft Azure MySQL flexible servers by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure MySQL flexible servers

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure MySQL server ID.
||
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of the storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of the storage utilization, expressed in %.
|`90`|
|{$AZURE.DB.ABORTED.CONN.MAX.WARN}|
The number of failed attempts to connect to the MySQL server for a trigger expression.
|`25`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.db.mysql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.mysql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.mysql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.db.mysql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|Percentage CPU|
The CPU percent of a host.
|Dependent item|azure.db.mysql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.maximum`

|
|Memory utilization|
The memory percent of a host.
|Dependent item|azure.db.mysql.memory.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.memory_percent.maximum`

|
|Network out|
Network egress of a host, expressed in bytes.
|Dependent item|azure.db.mysql.network.egress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_egress.total`

- 
Custom multiplier: `0.0088`

|
|Network in|
Network ingress of a host, expressed in bytes.
|Dependent item|azure.db.mysql.network.ingress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_ingress.total`

- 
Custom multiplier: `0.0088`

|
|Connections active|
The count of active connections.
|Dependent item|azure.db.mysql.connections.active
**Preprocessing**

- 
JSON Path: `$.metrics.active_connections.maximum`

|
|Connections total|
The count of total connections.
|Dependent item|azure.db.mysql.connections.total
**Preprocessing**

- 
JSON Path: `$.metrics.total_connections.total`

|
|Connections aborted|
The count of aborted connections.
|Dependent item|azure.db.mysql.connections.aborted
**Preprocessing**

- 
JSON Path: `$.metrics.aborted_connections.total`

|
|Queries|
The count of queries.
|Dependent item|azure.db.mysql.queries
**Preprocessing**

- 
JSON Path: `$.metrics.Queries.total`

|
|IO consumption percent|
The consumption percent of I/O.
|Dependent item|azure.db.mysql.io.consumption.percent
**Preprocessing**

- 
JSON Path: `$.metrics.io_consumption_percent.maximum`

|
|Storage percent|
The storage utilization, expressed in %.
|Dependent item|azure.db.mysql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.maximum`

|
|Storage used|
Used storage space, expressed in bytes.
|Dependent item|azure.db.mysql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage_used.maximum`

|
|Storage limit|
The storage limit, expressed in bytes.
|Dependent item|azure.db.mysql.storage.limit
**Preprocessing**

- 
JSON Path: `$.metrics.storage_limit.maximum`

|
|Backup storage used|
Used backup storage, expressed in bytes.
|Dependent item|azure.db.mysql.storage.backup.used
**Preprocessing**

- 
JSON Path: `$.metrics.backup_storage_used.maximum`

|
|Replication lag|
The replication lag, expressed in seconds.
|Dependent item|azure.db.mysql.replication.lag
**Preprocessing**

- 
JSON Path: `$.metrics.replication_lag.maximum`

⛔️Custom on fail: Discard value

|
|CPU credits remaining|
The remaining CPU credits.
|Dependent item|azure.db.mysql.cpu.credits.remaining
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_credits_remaining.maximum`

⛔️Custom on fail: Discard value

|
|CPU credits consumed|
The consumed CPU credits.
|Dependent item|azure.db.mysql.cpu.credits.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_credits_consumed.maximum`

⛔️Custom on fail: Discard value

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure MySQL Flexible: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.data.errors))>0`|Average||
|Azure MySQL Flexible: MySQL server is unavailable|
The resource state is unavailable.
|`last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.availability.state)=2`|High||
|Azure MySQL Flexible: MySQL server is degraded|
The resource is in a degraded state.
|`last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.availability.state)=1`|Average||
|Azure MySQL Flexible: MySQL server is in unknown state|
The resource state is unknown.
|`last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.availability.state)=3`|Warning||
|Azure MySQL Flexible: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure MySQL Flexible: Server has aborted connections|
The number of failed attempts to connect to the MySQL server is more than `{$AZURE.DB.ABORTED.CONN.MAX.WARN}`.
|`min(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.connections.aborted,5m)>{$AZURE.DB.ABORTED.CONN.MAX.WARN}`|Average||
|Azure MySQL Flexible: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure MySQL Flexible: Storage space is low|
High utilization of the storage space.
|`last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning||

# Azure MySQL Single Server by HTTP

## Overview

This template is designed to monitor Microsoft Azure MySQL single servers by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure MySQL single servers

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure MySQL server ID.
||
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.MEMORY.UTIL.CRIT}|
The critical threshold of memory utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of storage utilization, expressed in %.
|`90`|
|{$AZURE.DB.FAILED.CONN.MAX.WARN}|
The number of failed attempts to connect to the MySQL server for trigger expression.
|`25`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.db.mysql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.mysql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.mysql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.db.mysql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|Percentage CPU|
The CPU percent of a host.
|Dependent item|azure.db.mysql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.average`

|
|Memory utilization|
The memory percent of a host.
|Dependent item|azure.db.mysql.memory.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.memory_percent.average`

|
|Network out|
The network outbound traffic across the active connections.
|Dependent item|azure.db.mysql.network.egress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_egress.total`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.0088`

|
|Network in|
The network inbound traffic across the active connections.
|Dependent item|azure.db.mysql.network.ingress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_ingress.total`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.0088`

|
|Connections active|
The count of active connections.
|Dependent item|azure.db.mysql.connections.active
**Preprocessing**

- 
JSON Path: `$.metrics.active_connections.average`

|
|Connections failed|
The count of failed connections.
|Dependent item|azure.db.mysql.connections.failed
**Preprocessing**

- 
JSON Path: `$.metrics.connections_failed.total`

⛔️Custom on fail: Discard value

|
|IO consumption percent|
The consumption percent of I/O.
|Dependent item|azure.db.mysql.io.consumption.percent
**Preprocessing**

- 
JSON Path: `$.metrics.io_consumption_percent.average`

|
|Storage percent|
The storage utilization, expressed in %.
|Dependent item|azure.db.mysql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.average`

|
|Storage used|
Used storage space, expressed in bytes.
|Dependent item|azure.db.mysql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage_used.average`

|
|Storage limit|
The storage limit, expressed in bytes.
|Dependent item|azure.db.mysql.storage.limit
**Preprocessing**

- 
JSON Path: `$.metrics.storage_limit.maximum`

|
|Backup storage used|
Used backup storage, expressed in bytes.
|Dependent item|azure.db.mysql.storage.backup.used
**Preprocessing**

- 
JSON Path: `$.metrics.backup_storage_used.average`

|
|Replication lag|
The replication lag, expressed in seconds.
|Dependent item|azure.db.mysql.replication.lag
**Preprocessing**

- 
JSON Path: `$.metrics.seconds_behind_master.maximum`

⛔️Custom on fail: Discard value

|
|Server log storage percent|
The storage utilization by server log, expressed in %.
|Dependent item|azure.db.mysql.storage.server.log.percent
**Preprocessing**

- 
JSON Path: `$.metrics.serverlog_storage_percent.average`

|
|Server log storage used|
The storage space used by server log, expressed in bytes.
|Dependent item|azure.db.mysql.storage.server.log.used
**Preprocessing**

- 
JSON Path: `$.metrics.serverlog_storage_usage.average`

|
|Server log storage limit|
The storage limit of server log, expressed in bytes.
|Dependent item|azure.db.mysql.storage.server.log.limit
**Preprocessing**

- 
JSON Path: `$.metrics.serverlog_storage_limit.maximum`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure MySQL Single: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure MySQL Single Server by HTTP/azure.db.mysql.data.errors))>0`|Average||
|Azure MySQL Single: MySQL server is unavailable|
The resource state is unavailable.
|`last(/Azure MySQL Single Server by HTTP/azure.db.mysql.availability.state)=2`|High||
|Azure MySQL Single: MySQL server is degraded|
The resource is in a degraded state.
|`last(/Azure MySQL Single Server by HTTP/azure.db.mysql.availability.state)=1`|Average||
|Azure MySQL Single: MySQL server is in unknown state|
The resource state is unknown.
|`last(/Azure MySQL Single Server by HTTP/azure.db.mysql.availability.state)=3`|Warning||
|Azure MySQL Single: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure MySQL Single Server by HTTP/azure.db.mysql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure MySQL Single: High memory utilization|
The system is running out of free memory.
|`min(/Azure MySQL Single Server by HTTP/azure.db.mysql.memory.percentage,5m)>{$AZURE.DB.MEMORY.UTIL.CRIT}`|Average||
|Azure MySQL Single: Server has failed connections|
The number of failed attempts to connect to the MySQL server is more than `{$AZURE.DB.FAILED.CONN.MAX.WARN}`.
|`min(/Azure MySQL Single Server by HTTP/azure.db.mysql.connections.failed,5m)>{$AZURE.DB.FAILED.CONN.MAX.WARN}`|Average||
|Azure MySQL Single: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure MySQL Single Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure MySQL Single: Storage space is low|
High utilization of the storage space.
|`last(/Azure MySQL Single Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning||

# Azure PostgreSQL Flexible Server by HTTP

## Overview

This template is designed to monitor Microsoft Azure PostgreSQL flexible servers by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure PostgreSQL flexible servers

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure PostgreSQL server ID.
||
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.MEMORY.UTIL.CRIT}|
The critical threshold of memory utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of storage utilization, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.db.pgsql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.pgsql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.pgsql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.db.pgsql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|Percentage CPU|
The CPU percent of a host.
|Dependent item|azure.db.pgsql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.average`

|
|Memory utilization|
The memory percent of a host.
|Dependent item|azure.db.pgsql.memory.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.memory_percent.average`

|
|Network out|
The network outbound traffic across the active connections.
|Dependent item|azure.db.pgsql.network.egress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_egress.total`

- 
Custom multiplier: `0.1333`

|
|Network in|
The network inbound traffic across the active connections.
|Dependent item|azure.db.pgsql.network.ingress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_ingress.total`

- 
Custom multiplier: `0.1333`

|
|Connections active|
The count of active connections.
|Dependent item|azure.db.pgsql.connections.active
**Preprocessing**

- 
JSON Path: `$.metrics.active_connections.average`

|
|Connections succeeded|
The count of succeeded connections.
|Dependent item|azure.db.pgsql.connections.succeeded
**Preprocessing**

- 
JSON Path: `$.metrics.connections_succeeded.total`

|
|Connections failed|
The count of failed connections.
|Dependent item|azure.db.pgsql.connections.failed
**Preprocessing**

- 
JSON Path: `$.metrics.connections_failed.total`

⛔️Custom on fail: Discard value

|
|Storage percent|
The storage utilization, expressed in %.
|Dependent item|azure.db.pgsql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.average`

|
|Storage used|
Used storage space, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage_used.average`

|
|Storage free|
Free storage space, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.free
**Preprocessing**

- 
JSON Path: `$.metrics.storage_free.average`

|
|Backup storage used|
Used backup storage, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.backup.used
**Preprocessing**

- 
JSON Path: `$.metrics.backup_storage_used.average`

⛔️Custom on fail: Discard value

|
|CPU credits remaining|
The total number of credits available to burst.
|Dependent item|azure.db.pgsql.cpu.credits.remaining
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_credits_remaining.average`

⛔️Custom on fail: Discard value

|
|CPU credits consumed|
The total number of credits consumed by the database server.
|Dependent item|azure.db.pgsql.cpu.credits.consumed
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_credits_consumed.average`

⛔️Custom on fail: Discard value

|
|Data disk queue depth|
The number of outstanding I/O operations to the data disk.
|Dependent item|azure.db.pgsql.disk.queue.depth
**Preprocessing**

- 
JSON Path: `$.metrics.disk_queue_depth.average`

⛔️Custom on fail: Discard value

|
|Data disk IOPS|
I/O operations per second.
|Dependent item|azure.db.pgsql.iops
**Preprocessing**

- 
JSON Path: `$.metrics.iops.average`

|
|Data disk read IOPS|
The number of the data disk I/O read operations per second.
|Dependent item|azure.db.pgsql.iops.read
**Preprocessing**

- 
JSON Path: `$.metrics.read_iops.average`

⛔️Custom on fail: Discard value

|
|Data disk write IOPS|
The number of the data disk I/O write operations per second.
|Dependent item|azure.db.pgsql.iops.write
**Preprocessing**

- 
JSON Path: `$.metrics.write_iops.average`

⛔️Custom on fail: Discard value

|
|Data disk read Bps|
Bytes read per second from the data disk during the monitoring period.
|Dependent item|azure.db.pgsql.disk.bps.read
**Preprocessing**

- 
JSON Path: `$.metrics.read_throughput.average`

⛔️Custom on fail: Discard value

|
|Data disk write Bps|
Bytes written per second to the data disk during the monitoring period.
|Dependent item|azure.db.pgsql.disk.bps.write
**Preprocessing**

- 
JSON Path: `$.metrics.write_throughput.average`

⛔️Custom on fail: Discard value

|
|Transaction log storage used|
The storage space used by transaction log, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.txlogs.used
**Preprocessing**

- 
JSON Path: `$.metrics.txlogs_storage_used.average`

|
|Maximum used transaction IDs|
The maximum number of used transaction IDs.
|Dependent item|azure.db.pgsql.txid.used.max
**Preprocessing**

- 
JSON Path: `$.metrics.maximum_used_transactionIDs.average`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure PostgreSQL Flexible: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.data.errors))>0`|Average||
|Azure PostgreSQL Flexible: PostgreSQL server is unavailable|
The resource state is unavailable.
|`last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.availability.state)=2`|High||
|Azure PostgreSQL Flexible: PostgreSQL server is degraded|
The resource is in a degraded state.
|`last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.availability.state)=1`|Average||
|Azure PostgreSQL Flexible: PostgreSQL server is in unknown state|
The resource state is unknown.
|`last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.availability.state)=3`|Warning||
|Azure PostgreSQL Flexible: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure PostgreSQL Flexible: High memory utilization|
The system is running out of free memory.
|`min(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.memory.percentage,5m)>{$AZURE.DB.MEMORY.UTIL.CRIT}`|Average||
|Azure PostgreSQL Flexible: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure PostgreSQL Flexible: Storage space is low|
High utilization of the storage space.
|`last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning||

# Azure PostgreSQL Single Server by HTTP

## Overview

This template is designed to monitor Microsoft Azure PostgreSQL servers by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure PostgreSQL servers

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure PostgreSQL server ID.
||
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.MEMORY.UTIL.CRIT}|
The critical threshold of memory utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of storage utilization, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.db.pgsql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.pgsql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.pgsql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.db.pgsql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|Percentage CPU|
The CPU percent of a host.
|Dependent item|azure.db.pgsql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.average`

|
|Memory utilization|
The memory percent of a host.
|Dependent item|azure.db.pgsql.memory.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.memory_percent.average`

|
|Network out|
The network outbound traffic across the active connections.
|Dependent item|azure.db.pgsql.network.egress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_egress.total`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.1333`

|
|Network in|
The network inbound traffic across the active connections.
|Dependent item|azure.db.pgsql.network.ingress
**Preprocessing**

- 
JSON Path: `$.metrics.network_bytes_ingress.total`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.1333`

|
|Connections active|
The count of active connections.
|Dependent item|azure.db.pgsql.connections.active
**Preprocessing**

- 
JSON Path: `$.metrics.active_connections.average`

|
|Connections failed|
The count of failed connections.
|Dependent item|azure.db.pgsql.connections.failed
**Preprocessing**

- 
JSON Path: `$.metrics.connections_failed.total`

⛔️Custom on fail: Discard value

|
|IO consumption percent|
The consumption percent of I/O.
|Dependent item|azure.db.pgsql.io.consumption.percent
**Preprocessing**

- 
JSON Path: `$.metrics.io_consumption_percent.average`

|
|Storage percent|
The storage utilization, expressed in %.
|Dependent item|azure.db.pgsql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.average`

|
|Storage used|
Used storage space, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage_used.average`

|
|Storage limit|
The storage limit, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.limit
**Preprocessing**

- 
JSON Path: `$.metrics.storage_limit.maximum`

|
|Backup storage used|
Used backup storage, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.backup.used
**Preprocessing**

- 
JSON Path: `$.metrics.backup_storage_used.average`

|
|Replication lag|
The replication lag, expressed in seconds.
|Dependent item|azure.db.pgsql.replica.log.delay
**Preprocessing**

- 
JSON Path: `$.metrics.pg_replica_log_delay_in_seconds.maximum`

⛔️Custom on fail: Discard value

|
|Max lag across replicas in bytes|
Lag for the most lagging replica, expressed in bytes.
|Dependent item|azure.db.pgsql.replica.log.delay.bytes
**Preprocessing**

- 
JSON Path: `$.metrics.pg_replica_log_delay_in_bytes.maximum`

⛔️Custom on fail: Discard value

|
|Server log storage percent|
The storage utilization by server log, expressed in %.
|Dependent item|azure.db.pgsql.storage.server.log.percent
**Preprocessing**

- 
JSON Path: `$.metrics.serverlog_storage_percent.average`

|
|Server log storage used|
The storage space used by server log, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.server.log.used
**Preprocessing**

- 
JSON Path: `$.metrics.serverlog_storage_usage.average`

|
|Server log storage limit|
The storage limit of server log, expressed in bytes.
|Dependent item|azure.db.pgsql.storage.server.log.limit
**Preprocessing**

- 
JSON Path: `$.metrics.serverlog_storage_limit.maximum`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure PostgreSQL Single: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.data.errors))>0`|Average||
|Azure PostgreSQL Single: PostgreSQL server is unavailable|
The resource state is unavailable.
|`last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.availability.state)=2`|High||
|Azure PostgreSQL Single: PostgreSQL server is degraded|
The resource is in a degraded state.
|`last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.availability.state)=1`|Average||
|Azure PostgreSQL Single: PostgreSQL server is in unknown state|
The resource state is unknown.
|`last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.availability.state)=3`|Warning||
|Azure PostgreSQL Single: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure PostgreSQL Single: High memory utilization|
The system is running out of free memory.
|`min(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.memory.percentage,5m)>{$AZURE.DB.MEMORY.UTIL.CRIT}`|Average||
|Azure PostgreSQL Single: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure PostgreSQL Single: Storage space is low|
High utilization of the storage space.
|`last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning||

# Azure Microsoft SQL Serverless Database by HTTP

## Overview

This template is designed to monitor Microsoft SQL serverless databases by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure SQL serverless databases

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure Microsoft SQL database ID.
||
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.MEMORY.UTIL.CRIT}|
The critical threshold of memory utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of storage utilization, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.db.mssql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.mssql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.mssql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.db.mssql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|Percentage CPU|
The CPU percent of a host.
|Dependent item|azure.db.mssql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.average`

|
|Data IO percentage|
The physical data read percentage.
|Dependent item|azure.db.mssql.data.read.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.physical_data_read_percent.average`

|
|Log IO percentage|
The percentage of I/O log. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.log.write.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.log_write_percent.average`

|
|Data space used|
Data space used. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage.maximum`

⛔️Custom on fail: Discard value

|
|Connections successful|
The count of successful connections.
|Dependent item|azure.db.mssql.connections.successful
**Preprocessing**

- 
JSON Path: `$.metrics.connection_successful.total`

|
|Connections failed: System errors|
The count of failed connections with system errors.
|Dependent item|azure.db.mssql.connections.failed.system
**Preprocessing**

- 
JSON Path: `$.metrics.connection_failed.total`

|
|Connections blocked by firewall|
The count of connections blocked by firewall.
|Dependent item|azure.db.mssql.firewall.blocked
**Preprocessing**

- 
JSON Path: `$.metrics.blocked_by_firewall.total`

|
|Deadlocks|
The count of deadlocks. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.deadlocks
**Preprocessing**

- 
JSON Path: `$.metrics.deadlock.total`

|
|Data space used percent|
The percentage of used data space. Not applicable to the data warehouses or Hyperscale databases.
|Dependent item|azure.db.mssql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.maximum`

⛔️Custom on fail: Discard value

|
|In-Memory OLTP storage percent|
In-Memory OLTP storage percent. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.storage.xtp.percent
**Preprocessing**

- 
JSON Path: `$.metrics.xtp_storage_percent.average`

|
|Workers percentage|
The percentage of workers. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.workers.percent
**Preprocessing**

- 
JSON Path: `$.metrics.workers_percent.average`

|
|Sessions percentage|
The percentage of sessions. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.sessions.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sessions_percent.average`

|
|CPU limit|
The CPU limit. Applies to the vCore-based databases.
|Dependent item|azure.db.mssql.cpu.limit
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_limit.average`

⛔️Custom on fail: Discard value

|
|CPU used|
The CPU used. Applies to the vCore-based databases.
|Dependent item|azure.db.mssql.cpu.used
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_used.average`

⛔️Custom on fail: Discard value

|
|SQL Server process core percent|
The CPU usage as a percentage of the SQL DB process. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.server.cpu.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sqlserver_process_core_percent.maximum`

⛔️Custom on fail: Discard value

|
|SQL Server process memory percent|
Memory usage as a percentage of the SQL DB process. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.server.memory.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sqlserver_process_memory_percent.maximum`

⛔️Custom on fail: Discard value

|
|Tempdb data file size|
Space used in `tempdb` data files, expressed in bytes. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.tempdb.data.size
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_data_size.maximum`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1024`

|
|Tempdb log file size|
Space used in `tempdb` transaction log files, expressed in bytes. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.tempdb.log.size
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_log_size.maximum`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1024`

|
|Tempdb log used percent|
The percentage of space used in `tempdb` transaction log files. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.tempdb.log.percent
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_log_used_percent.maximum`

⛔️Custom on fail: Discard value

|
|App CPU billed|
App CPU billed. Applies to serverless databases.
|Dependent item|azure.db.mssql.app.cpu.billed
**Preprocessing**

- 
JSON Path: `$.metrics.app_cpu_billed.total`

⛔️Custom on fail: Discard value

|
|App CPU percentage|
App CPU percentage. Applies to serverless databases.
|Dependent item|azure.db.mssql.app.cpu.percent
**Preprocessing**

- 
JSON Path: `$.metrics.app_cpu_percent.average`

⛔️Custom on fail: Discard value

|
|App memory percentage|
App memory percentage. Applies to serverless databases.
|Dependent item|azure.db.mssql.app.memory.percent
**Preprocessing**

- 
JSON Path: `$.metrics.app_memory_percent.average`

⛔️Custom on fail: Discard value

|
|Data space allocated|
The allocated data storage. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.storage.allocated
**Preprocessing**

- 
JSON Path: `$.metrics.allocated_data_storage.average`

⛔️Custom on fail: Discard value

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure MSSQL Serverless: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.data.errors))>0`|Average||
|Azure MSSQL Serverless: Microsoft SQL database is unavailable|
The resource state is unavailable.
|`last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.availability.state)=2`|High||
|Azure MSSQL Serverless: Microsoft SQL database is degraded|
The resource is in a degraded state.
|`last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.availability.state)=1`|Average||
|Azure MSSQL Serverless: Microsoft SQL database is in unknown state|
The resource state is unknown.
|`last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.availability.state)=3`|Warning||
|Azure MSSQL Serverless: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure MSSQL Serverless: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure MSSQL Serverless: Storage space is low|
High utilization of the storage space.
|`last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning||

# Azure Microsoft SQL DTU Database by HTTP

## Overview

This template is designed to monitor Microsoft SQL DTU-based databases via HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure SQL DTU-based databases

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure SQL DTU-based database ID.
||
|{$AZURE.DB.DTU.UTIL.CRIT}|
The critical threshold of DTU utilization, expressed in %.
|`90`|
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.MEMORY.UTIL.CRIT}|
The critical threshold of memory utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of storage utilization, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in JSON format.
|Script|azure.db.mssql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.mssql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.mssql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
A detailed summary of the availability status.
|Dependent item|azure.db.mssql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|CPU percentage|
The average percentage of CPU usage on a host.
|Dependent item|azure.db.mssql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.average`

⛔️Custom on fail: Discard value

|
|DTU percentage|
The average percentage of DTU consumption for a DTU-based database.
|Dependent item|azure.db.mssql.dtu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.dtu_consumption_percent.average`

⛔️Custom on fail: Discard value

|
|Data IO percentage|
The average percentage of physical data read.
|Dependent item|azure.db.mssql.data.read.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.physical_data_read_percent.average`

⛔️Custom on fail: Discard value

|
|Log IO percentage|
The percentage of I/O used for log writes. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.log.write.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.log_write_percent.average`

⛔️Custom on fail: Discard value

|
|Data space used|
Data space used. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage.maximum`

⛔️Custom on fail: Discard value

|
|Connections successful|
The number of successful connections.
|Dependent item|azure.db.mssql.connections.successful
**Preprocessing**

- 
JSON Path: `$.metrics.connection_successful.total`

⛔️Custom on fail: Discard value

|
|Connections failed: System errors|
The number of failed connections with system errors.
|Dependent item|azure.db.mssql.connections.failed.system
**Preprocessing**

- 
JSON Path: `$.metrics.connection_failed.total`

⛔️Custom on fail: Discard value

|
|Connections blocked by firewall|
The number of connections blocked by the firewall.
|Dependent item|azure.db.mssql.firewall.blocked
**Preprocessing**

- 
JSON Path: `$.metrics.blocked_by_firewall.total`

⛔️Custom on fail: Discard value

|
|Deadlocks|
The number of deadlocks. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.deadlocks
**Preprocessing**

- 
JSON Path: `$.metrics.deadlock.total`

⛔️Custom on fail: Discard value

|
|Data space used percent|
Data space used in percent. Not applicable to data warehouses or Hyperscale databases.
|Dependent item|azure.db.mssql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.maximum`

⛔️Custom on fail: Discard value

|
|In-Memory OLTP storage percent|
In-Memory OLTP storage percent. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.storage.xtp.percent
**Preprocessing**

- 
JSON Path: `$.metrics.xtp_storage_percent.average`

⛔️Custom on fail: Discard value

|
|Workers percentage|
The percentage of workers. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.workers.percent
**Preprocessing**

- 
JSON Path: `$.metrics.workers_percent.average`

⛔️Custom on fail: Discard value

|
|Sessions percentage|
The percentage of sessions. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.sessions.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sessions_percent.average`

⛔️Custom on fail: Discard value

|
|Sessions count|
The number of active sessions. Not applicable to Synapse DW Analytics.
|Dependent item|azure.db.mssql.sessions.count
**Preprocessing**

- 
JSON Path: `$.metrics.sessions_count.average`

⛔️Custom on fail: Discard value

|
|DTU limit|
The DTU limit. Applicable to DTU-based databases.
|Dependent item|azure.db.mssql.dtu.limit
**Preprocessing**

- 
JSON Path: `$.metrics.dtu_limit.average`

⛔️Custom on fail: Discard value

|
|DTU used|
The DTU used. Applicable to DTU-based databases.
|Dependent item|azure.db.mssql.dtu.used
**Preprocessing**

- 
JSON Path: `$.metrics.dtu_used.average`

⛔️Custom on fail: Discard value

|
|SQL instance CPU percent|
CPU usage from all user and system workloads. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.server.cpu.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sql_instance_cpu_percent.maximum`

⛔️Custom on fail: Discard value

|
|SQL instance memory percent|
The percentage of memory used by the database engine instance. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.server.memory.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sql_instance_cpu_percent.maximum`

⛔️Custom on fail: Discard value

|
|Tempdb data file size|
The space used in `tempdb` data files, expressed in bytes. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.tempdb.data.size
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_data_size.maximum`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1024`

|
|Tempdb log file size|
The space used in the `tempdb` transaction log file, expressed in bytes. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.tempdb.log.size
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_log_size.maximum`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1024`

|
|Tempdb log used percent|
The percentage of space used in the `tempdb` transaction log file. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.tempdb.log.percent
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_log_used_percent.maximum`

⛔️Custom on fail: Discard value

|
|Data space allocated|
The allocated data storage. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.storage.allocated
**Preprocessing**

- 
JSON Path: `$.metrics.allocated_data_storage.average`

⛔️Custom on fail: Discard value

|
|Log backup storage size|
The cumulative log backup storage size. Applies to vCore-based and Hyperscale databases.
|Dependent item|azure.db.mssql.storage.backup.log.size
**Preprocessing**

- 
JSON Path: `$.metrics.log_backup_size_bytes.maximum`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1d`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure MSSQL DTU: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.data.errors))>0`|Average||
|Azure MSSQL DTU: Microsoft SQL database is unavailable|
The resource state is unavailable.
|`last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.availability.state)=2`|High||
|Azure MSSQL DTU: Microsoft SQL database is degraded|
The resource is in a degraded state.
|`last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.availability.state)=1`|Average||
|Azure MSSQL DTU: Microsoft SQL database is in unknown state|
The resource state is unknown.
|`last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.availability.state)=3`|Warning||
|Azure MSSQL DTU: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure MSSQL DTU: High DTU utilization|
The DTU utilization is too high. The system might be slow to respond.
|`min(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.dtu.percentage,5m)>{$AZURE.DB.DTU.UTIL.CRIT}`|High||
|Azure MSSQL DTU: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure MSSQL DTU: Storage space is low|
High utilization of the storage space.
|`last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning|**Depends on**:

- Azure MSSQL DTU: Storage space is critically low
|

# Azure Microsoft SQL Database by HTTP

## Overview

This template is designed to monitor Microsoft SQL databases by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure SQL databases

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure Microsoft SQL database ID.
||
|{$AZURE.DB.CPU.UTIL.CRIT}|
The critical threshold of CPU utilization, expressed in %.
|`90`|
|{$AZURE.DB.MEMORY.UTIL.CRIT}|
The critical threshold of memory utilization, expressed in %.
|`90`|
|{$AZURE.DB.STORAGE.PUSED.WARN}|
The warning threshold of storage utilization, expressed in %.
|`80`|
|{$AZURE.DB.STORAGE.PUSED.CRIT}|
The critical threshold of storage utilization, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.db.mssql.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.db.mssql.data.errors
**Preprocessing**

- 
JSON Path: `$.errors`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.
|Dependent item|azure.db.mssql.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.db.mssql.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

- 
Discard unchanged with heartbeat: `1h`

|
|Percentage CPU|
The CPU percent of a host.
|Dependent item|azure.db.mssql.cpu.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_percent.average`

|
|Data IO percentage|
The percentage of physical data read.
|Dependent item|azure.db.mssql.data.read.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.physical_data_read_percent.average`

|
|Log IO percentage|
The percentage of I/O log. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.log.write.percentage
**Preprocessing**

- 
JSON Path: `$.metrics.log_write_percent.average`

|
|Data space used|
Data space used. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage.maximum`

⛔️Custom on fail: Discard value

|
|Connections successful|
The count of successful connections.
|Dependent item|azure.db.mssql.connections.successful
**Preprocessing**

- 
JSON Path: `$.metrics.connection_successful.total`

|
|Connections failed: System errors|
The count of failed connections with system errors.
|Dependent item|azure.db.mssql.connections.failed.system
**Preprocessing**

- 
JSON Path: `$.metrics.connection_failed.total`

|
|Connections blocked by firewall|
The count of connections blocked by firewall.
|Dependent item|azure.db.mssql.firewall.blocked
**Preprocessing**

- 
JSON Path: `$.metrics.blocked_by_firewall.total`

|
|Deadlocks|
The count of deadlocks. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.deadlocks
**Preprocessing**

- 
JSON Path: `$.metrics.deadlock.total`

|
|Data space used percent|
Data space used percent. Not applicable to the data warehouses or Hyperscale databases.
|Dependent item|azure.db.mssql.storage.percent
**Preprocessing**

- 
JSON Path: `$.metrics.storage_percent.maximum`

⛔️Custom on fail: Discard value

|
|In-Memory OLTP storage percent|
In-Memory OLTP storage percent. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.storage.xtp.percent
**Preprocessing**

- 
JSON Path: `$.metrics.xtp_storage_percent.average`

|
|Workers percentage|
The percentage of workers. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.workers.percent
**Preprocessing**

- 
JSON Path: `$.metrics.workers_percent.average`

|
|Sessions percentage|
The percentage of sessions. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.sessions.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sessions_percent.average`

|
|Sessions count|
The number of active sessions. Not applicable to Synapse DW Analytics.
|Dependent item|azure.db.mssql.sessions.count
**Preprocessing**

- 
JSON Path: `$.metrics.sessions_count.average`

|
|CPU limit|
The CPU limit. Applies to the vCore-based databases.
|Dependent item|azure.db.mssql.cpu.limit
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_limit.average`

⛔️Custom on fail: Discard value

|
|CPU used|
The CPU used. Applies to the vCore-based databases.
|Dependent item|azure.db.mssql.cpu.used
**Preprocessing**

- 
JSON Path: `$.metrics.cpu_used.average`

⛔️Custom on fail: Discard value

|
|SQL Server process core percent|
The CPU usage as a percentage of the SQL DB process. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.server.cpu.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sqlserver_process_core_percent.maximum`

⛔️Custom on fail: Discard value

|
|SQL Server process memory percent|
Memory usage as a percentage of the SQL DB process. Not applicable to data warehouses.
|Dependent item|azure.db.mssql.server.memory.percent
**Preprocessing**

- 
JSON Path: `$.metrics.sqlserver_process_memory_percent.maximum`

⛔️Custom on fail: Discard value

|
|Tempdb data file size|
The space used in `tempdb` data files, expressed in bytes. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.tempdb.data.size
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_data_size.maximum`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1024`

|
|Tempdb log file size|
The space used in `tempdb` transaction log file, expressed in bytes. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.tempdb.log.size
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_log_size.maximum`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1024`

|
|Tempdb log used percent|
The percentage of space used in `tempdb` transaction log file. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.tempdb.log.percent
**Preprocessing**

- 
JSON Path: `$.metrics.tempdb_log_used_percent.maximum`

⛔️Custom on fail: Discard value

|
|Data space allocated|
The allocated data storage. Not applicable to the data warehouses.
|Dependent item|azure.db.mssql.storage.allocated
**Preprocessing**

- 
JSON Path: `$.metrics.allocated_data_storage.average`

⛔️Custom on fail: Discard value

|
|Full backup storage size|
Cumulative full backup storage size. Applies to the vCore-based databases. Not applicable to the Hyperscale databases.
|Dependent item|azure.db.mssql.storage.backup.size
**Preprocessing**

- 
JSON Path: `$.metrics.full_backup_size_bytes.maximum`

- 
Discard unchanged with heartbeat: `1d`

|
|Differential backup storage size|
Cumulative differential backup storage size. Applies to the vCore-based databases. Not applicable to the Hyperscale databases.
|Dependent item|azure.db.mssql.storage.backup.diff.size
**Preprocessing**

- 
JSON Path: `$.metrics.diff_backup_size_bytes.maximum`

- 
Discard unchanged with heartbeat: `1d`

|
|Log backup storage size|
Cumulative log backup storage size. Applies to the vCore-based and Hyperscale databases.
|Dependent item|azure.db.mssql.storage.backup.log.size
**Preprocessing**

- 
JSON Path: `$.metrics.log_backup_size_bytes.maximum`

- 
Discard unchanged with heartbeat: `1d`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure MSSQL: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.data.errors))>0`|Average||
|Azure MSSQL: Microsoft SQL database is unavailable|
The resource state is unavailable.
|`last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.availability.state)=2`|High||
|Azure MSSQL: Microsoft SQL database is degraded|
The resource is in a degraded state.
|`last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.availability.state)=1`|Average||
|Azure MSSQL: Microsoft SQL database is in unknown state|
The resource state is unknown.
|`last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.availability.state)=3`|Warning||
|Azure MSSQL: High CPU utilization|
The CPU utilization is too high. The system might be slow to respond.
|`min(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}`|High||
|Azure MSSQL: Storage space is critically low|
Critical utilization of the storage space.
|`last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}`|Average||
|Azure MSSQL: Storage space is low|
High utilization of the storage space.
|`last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}`|Warning||

# Azure Cosmos DB for MongoDB by HTTP

## Overview

This template is designed for the effortless deployment of Azure Cosmos DB for MongoDB monitoring by Zabbix via HTTP and doesn't require any external scripts.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure Cosmos DB

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure Cosmos DB ID.
||
|{$AZURE.DB.COSMOS.MONGO.AVAILABILITY}|
The warning threshold of the Cosmos DB for MongoDB service availability.
|`70`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
The result of API requests is expressed in the JSON.
|Script|azure.cosmosdb.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.cosmosdb.data.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to

- 
Discard unchanged with heartbeat: `1h`

|
|Total requests|
Number of requests per minute.
|Dependent item|azure.cosmosdb.total.requests
**Preprocessing**

- 
JSON Path: `$.requests.TotalRequests.count`

⛔️Custom on fail: Discard value

|
|Total request units|
The request units consumed per minute.
|Dependent item|azure.cosmosdb.total.request.units
**Preprocessing**

- 
JSON Path: `$.requests.TotalRequestUnits.total`

⛔️Custom on fail: Discard value

|
|Metadata requests|
The count of metadata requests.

Cosmos DB maintains system metadata collection for each account, which allows you to enumerate collections, databases, etc., and their configurations, free of charge.
|Dependent item|azure.cosmosdb.metadata.requests
**Preprocessing**

- 
JSON Path: `$.requests.MetadataRequests.count`

⛔️Custom on fail: Discard value

|
|Mongo requests|
The number of Mongo requests made.
|Dependent item|azure.cosmosdb.mongo.requests
**Preprocessing**

- 
JSON Path: `$.requests.MongoRequests.count`

⛔️Custom on fail: Discard value

|
|Mongo request charge|
The Mongo request units consumed.
|Dependent item|azure.cosmosdb.mongo.requests.charge
**Preprocessing**

- 
JSON Path: `$.requests.MongoRequestCharge.total`

⛔️Custom on fail: Discard value

|
|Server side latency|
The server side latency.
|Dependent item|azure.cosmosdb.server.side.latency
**Preprocessing**

- 
JSON Path: `$.requests.ServerSideLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Server side latency, gateway|
The server side latency in gateway connection mode.
|Dependent item|azure.cosmosdb.server.side.latency.gateway
**Preprocessing**

- 
JSON Path: `$.requests.ServerSideLatencyGateway.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Server side latency, direct|
The server side latency in direct connection mode.
|Dependent item|azure.cosmosdb.server.side.latency.direct
**Preprocessing**

- 
JSON Path: `$.requests.ServerSideLatencyDirect.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Replication latency, P99|
The P99 replication latency across source and target regions for geo-enabled account.
|Dependent item|azure.cosmosdb.replication.latency
**Preprocessing**

- 
JSON Path: `$.requests.ReplicationLatency.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `0.001`

|
|Service availability|
The account requests availability at one hour granularity.
|Dependent item|azure.cosmosdb.service.availability
**Preprocessing**

- 
JSON Path: `$.availability.ServiceAvailability.average`

⛔️Custom on fail: Discard value

|
|Data usage|
The total data usage.
|Dependent item|azure.cosmosdb.data.usage
**Preprocessing**

- 
JSON Path: `$.requests.DataUsage.total`

⛔️Custom on fail: Discard value

|
|Index usage|
The total index usage.
|Dependent item|azure.cosmosdb.index.usage
**Preprocessing**

- 
JSON Path: `$.requests.IndexUsage.total`

⛔️Custom on fail: Discard value

|
|Document quota|
The total storage quota.
|Dependent item|azure.cosmosdb.document.quota
**Preprocessing**

- 
JSON Path: `$.requests.DocumentQuota.total`

⛔️Custom on fail: Discard value

|
|Document count|
The total document count.
|Dependent item|azure.cosmosdb.document.count
**Preprocessing**

- 
JSON Path: `$.requests.DocumentCount.total`

⛔️Custom on fail: Discard value

|
|Normalized RU consumption|
The max RU consumption percentage per minute.
|Dependent item|azure.cosmosdb.normalized.ru.consumption
**Preprocessing**

- 
JSON Path: `$.requests.NormalizedRUConsumption.maximum`

⛔️Custom on fail: Discard value

|
|Physical partition throughput|
The physical partition throughput.
|Dependent item|azure.cosmosdb.physical.partition.throughput
**Preprocessing**

- 
JSON Path: `$.requests.PhysicalPartitionThroughputInfo.maximum`

⛔️Custom on fail: Discard value

|
|Autoscale max throughput|
The autoscale max throughput.
|Dependent item|azure.cosmosdb.autoscale.max.throughput
**Preprocessing**

- 
JSON Path: `$.requests.AutoscaleMaxThroughput.maximum`

⛔️Custom on fail: Discard value

|
|Provisioned throughput|
The provisioned throughput.
|Dependent item|azure.cosmosdb.provisioned.throughput
**Preprocessing**

- 
JSON Path: `$.requests.ProvisionedThroughput.maximum`

⛔️Custom on fail: Discard value

|
|Physical partition size|
The physical partition size in bytes.
|Dependent item|azure.cosmosdb.physical.partition.size
**Preprocessing**

- 
JSON Path: `$.requests.PhysicalPartitionSizeInfo.maximum`

⛔️Custom on fail: Discard value

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure Cosmos DB: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Cosmos DB for MongoDB by HTTP/azure.cosmosdb.data.errors))>0`|Average||
|Azure Cosmos DB: Cosmos DB for MongoDB account: Availability is low||`(min(/Azure Cosmos DB for MongoDB by HTTP/azure.cosmosdb.service.availability,#3))<{$AZURE.DB.COSMOS.MONGO.AVAILABILITY}`|Warning||

# Azure Cost Management by HTTP

## Overview

This template is designed to monitor Microsoft Cost Management by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Microsoft Azure

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`60s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.BILLING.MONTH}|
Months to get historical data from Azure Cost Management API, no more than 11 (plus current month). The time period for pulling the data cannot exceed 1 year.
|`11`|
|{$AZURE.LLD.FILTER.SERVICE.MATCHES}|
Filter of discoverable services by name.
|`.*`|
|{$AZURE.LLD.FILTER.SERVICE.NOT_MATCHES}|
Filter to exclude discovered services by name.
|`CHANGE_IF_NEEDED`|
|{$AZURE.LLD.FILTER.RESOURCE.LOCATION.MATCHES}|
Filter of discoverable locations by name.
|`.*`|
|{$AZURE.LLD.FILTER.RESOURCE.LOCATION.NOT_MATCHES}|
Filter to exclude discovered locations by name.
|`CHANGE_IF_NEEDED`|
|{$AZURE.LLD.FILTER.RESOURCE.GROUP.MATCHES}|
Filter of discoverable resource groups by name.
|`.*`|
|{$AZURE.LLD.FILTER.RESOURCE.GROUP.NOT_MATCHES}|
Filter to exclude discovered resource groups by name.
|`CHANGE_IF_NEEDED`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get monthly costs|
The result of API requests is expressed in the JSON.
|Script|azure.get.monthly.costs|
|Get daily costs|
The result of API requests is expressed in the JSON.
|Script|azure.get.daily.costs|
|Azure Cost: Get monthly costs errors|
A list of errors from API requests.
|Dependent item|azure.get.monthly.costs.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to

- 
Discard unchanged with heartbeat: `1h`

|
|Azure Cost: Get daily costs errors|
A list of errors from API requests.
|Dependent item|azure.get.daily.costs.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to

- 
Discard unchanged with heartbeat: `1h`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure Cost: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Cost Management by HTTP/azure.get.monthly.costs.errors))>0`|Average||
|Azure Cost: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Cost Management by HTTP/azure.get.daily.costs.errors))>0`|Average||

### LLD rule Azure daily costs by services discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure daily costs by services discovery|
Discovery of daily costs by services.
|Dependent item|azure.daily.services.costs.discovery
**Preprocessing**

- 
JSON Path: `$.data`

⛔️Custom on fail: Discard value

|

### Item prototypes for Azure daily costs by services discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Service ["{#AZURE.SERVICE.NAME}"]: Meter ["{#AZURE.BILLING.METER}"]: Subcategory ["{#AZURE.BILLING.METER.SUBCATEGORY}"] daily cost|
The daily cost by service {#AZURE.SERVICE.NAME}, meter {#AZURE.BILLING.METER}, subcategory {#AZURE.BILLING.METER.SUBCATEGORY}.
|Dependent item|azure.daily.cost["{#AZURE.SERVICE.NAME}", "{#AZURE.BILLING.METER}", "{#AZURE.BILLING.METER.SUBCATEGORY}","{#AZURE.RESOURCE.GROUP}"]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

|

### LLD rule Azure monthly costs by services discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure monthly costs by services discovery|
Discovery of monthly costs by services.
|Dependent item|azure.monthly.services.costs.discovery
**Preprocessing**

- 
JSON Path: `$.serviceCost.data`

⛔️Custom on fail: Discard value

|

### Item prototypes for Azure monthly costs by services discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Service ["{#AZURE.SERVICE.NAME}"]: Month ["{#AZURE.BILLING.MONTH}"] cost|
The monthly cost by service {#AZURE.SERVICE.NAME}.
|Dependent item|azure.monthly.service.cost["{#AZURE.SERVICE.NAME}", "{#AZURE.BILLING.MONTH}"]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

|

### LLD rule Azure monthly costs by location discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure monthly costs by location discovery|
Discovery of monthly costs by location.
|Dependent item|azure.monthly.location.costs.discovery
**Preprocessing**

- 
JSON Path: `$.resourceLocationCost.data`

⛔️Custom on fail: Discard value

|

### Item prototypes for Azure monthly costs by location discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Location: ["{#AZURE.RESOURCE.LOCATION}"]: Month ["{#AZURE.BILLING.MONTH}"] cost|
The monthly cost by location {#AZURE.RESOURCE.LOCATION}.
|Dependent item|azure.monthly.location.cost["{#AZURE.RESOURCE.LOCATION}", "{#AZURE.BILLING.MONTH}"]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

|

### LLD rule Azure monthly costs by resource group discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure monthly costs by resource group discovery|
Discovery of monthly costs by resource group.
|Dependent item|azure.monthly.resource.group.costs.discovery
**Preprocessing**

- 
JSON Path: `$.resourceGroupCost.data`

⛔️Custom on fail: Discard value

|

### Item prototypes for Azure monthly costs by resource group discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Resource group: ["{#AZURE.RESOURCE.GROUP}"]: Month ["{#AZURE.BILLING.MONTH}"] cost|
The monthly cost by resource group {#AZURE.RESOURCE.GROUP}.
|Dependent item|azure.monthly.resource.group.cost["{#AZURE.RESOURCE.GROUP}", "{#AZURE.BILLING.MONTH}"]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

|

### LLD rule Azure monthly costs discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure monthly costs discovery|
Discovery of monthly costs.
|Dependent item|azure.monthly.costs.discovery
**Preprocessing**

- 
JSON Path: `$.monthCost.data`

⛔️Custom on fail: Discard value

|

### Item prototypes for Azure monthly costs discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Month ["{#AZURE.BILLING.MONTH}"] cost|
The monthly cost.
|Dependent item|azure.monthly.cost["{#AZURE.BILLING.MONTH}"]
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

⛔️Custom on fail: Discard value

|

# Azure SQL Managed Instance by HTTP

## Overview

This template is designed to monitor Microsoft Azure SQL Managed Instance by HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Azure SQL Managed Instance

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure SQL managed instance ID.
||
|{$AZURE.SQL.INST.SPACE.CRIT}|
Storage space critical threshold, expressed in %.
|`90`|
|{$AZURE.SQL.INST.SPACE.WARN}|
Storage space warning threshold, expressed in %.
|`80`|
|{$AZURE.SQL.INST.CPU.WARN}|
CPU utilization warning threshold, expressed in %.
|`80`|
|{$AZURE.SQL.INST.CPU.CRIT}|
CPU utilization critical threshold, expressed in %.
|`90`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
Gathers data of the Azure SQL managed instance.
|Script|azure.sql_inst.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.sql_inst.data.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to: ``</p></li><li><p>Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.

0 - Available - no events detected that affect the health of the resource.

1 - Degraded  - your resource detected a loss in performance, although it's still available for use.

2 - Unavailable - the service detected an ongoing platform or non-platform event that affects the health of the resource.

3 - Unknown - Resource Health hasn't received information about the resource for more than 10 minutes.
|Dependent item|azure.sql_inst.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.sql_inst.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Average CPU utilization|
Average CPU utilization of the instance.
|Dependent item|azure.sql_inst.cpu
**Preprocessing**

- 
JSON Path: `$.metrics.avg_cpu_percent.average`

⛔️Custom on fail: Discard value

|
|IO bytes read|
Bytes read by the managed instance.
|Dependent item|azure.sql_inst.bytes.read
**Preprocessing**

- 
JSON Path: `$.metrics.io_bytes_read.average`

⛔️Custom on fail: Discard value

|
|IO bytes write|
Bytes written by the managed instance.
|Dependent item|azure.sql_inst.bytes.write
**Preprocessing**

- 
JSON Path: `$.metrics.io_bytes_written.average`

⛔️Custom on fail: Discard value

|
|IO request count|
IO request count by the managed instance.
|Dependent item|azure.sql_inst.requests
**Preprocessing**

- 
JSON Path: `$.metrics.io_requests.average`

⛔️Custom on fail: Discard value

|
|Storage space reserved|
Storage space reserved by the managed instance.
|Dependent item|azure.sql_inst.storage.reserved
**Preprocessing**

- 
JSON Path: `$.metrics.reserved_storage_mb.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1048576`

- 
Discard unchanged with heartbeat: `1h`

|
|Storage space used|
Storage space used by the managed instance.
|Dependent item|azure.sql_inst.storage.used
**Preprocessing**

- 
JSON Path: `$.metrics.storage_space_used_mb.average`

⛔️Custom on fail: Discard value

- 
Custom multiplier: `1048576`

|
|Storage space utilization|
Managed instance storage space utilization, in percent.
|Calculated|azure.sql_inst.storage.utilization|
|Virtual core count|
Virtual core count available to the managed instance.
|Dependent item|azure.sql_inst.core.count
**Preprocessing**

- 
JSON Path: `$.metrics.virtual_core_count.average`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Instance state|
State of the managed instance.
|Dependent item|azure.sql_inst.state
**Preprocessing**

- 
JSON Path: `$.instance.properties.state`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Instance collation|
Collation of the managed instance.
|Dependent item|azure.sql_inst.collation
**Preprocessing**

- 
JSON Path: `$.instance.properties.collation`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1d`

|
|Instance provisioning state|
Provisioning state of the managed instance.
|Dependent item|azure.sql_inst.provision
**Preprocessing**

- 
JSON Path: `$.instance.properties.provisioningState`

⛔️Custom on fail: Discard value

- 
JavaScript: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `1h`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure SQL instance: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.data.errors))>0`|Average||
|Azure SQL instance: Azure SQL managed instance is unavailable|
The resource state is unavailable.
|`last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.availability.state)=2`|High||
|Azure SQL instance: Azure SQL managed instance is degraded|
The resource is in a degraded state.
|`last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.availability.state)=1`|Average||
|Azure SQL instance: Azure SQL managed instance is in unknown state|
The resource state is unknown.
|`last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.availability.state)=3`|Warning||
|Azure SQL instance: Critically high CPU utilization|
CPU utilization is critically high.
|`min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.cpu, 10m)>={$AZURE.SQL.INST.CPU.CRIT}`|Average|**Depends on**:

- Azure SQL instance: High CPU utilization
|
|Azure SQL instance: High CPU utilization|
CPU utilization is too high.
|`min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.cpu, 10m)>={$AZURE.SQL.INST.CPU.WARN}`|Warning||
|Azure SQL instance: Storage free space is critically low|
The free storage space has been less than `{$AZURE.SQL.INST.SPACE.CRIT}`% for 5m.
|`min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.storage.utilization,5m)>{$AZURE.SQL.INST.SPACE.CRIT}`|Average|**Manual close**: Yes
**Depends on**:

- Azure SQL instance: Storage free space is low
|
|Azure SQL instance: Storage free space is low|
The free storage space has been less than `{$AZURE.SQL.INST.SPACE.WARN}`% for 5m.
|`min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.storage.utilization,5m)>{$AZURE.SQL.INST.SPACE.WARN}`|Warning|**Manual close**: Yes|
|Azure SQL instance: Instance state has changed|
Azure SQL managed instance state has changed.
|`change(/Azure SQL Managed Instance by HTTP/azure.sql_inst.state)=1`|Warning||
|Azure SQL instance: Instance collation has changed|
Azure SQL managed instance collation has changed.
|`change(/Azure SQL Managed Instance by HTTP/azure.sql_inst.collation)=1`|Average||
|Azure SQL instance: Instance provisioning state has changed|
Azure SQL managed instance provisioning state has changed.
|`change(/Azure SQL Managed Instance by HTTP/azure.sql_inst.provision)<>0`|Warning||

# Azure Backup Jobs by HTTP

## Overview

This template is designed to monitor Microsoft Azure Backup Jobs via HTTP.
It works without any external scripts and uses the script item.

## Requirements

Zabbix version: 7.0 and higher.

## Tested versions

This template has been tested on:
- Azure Recovery Services vaults

## 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

1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.

      `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`

> See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.

2. Link the template to a host.
3. Configure the macros: `{$AZURE.APP.ID}`, `{$AZURE.PASSWORD}`, `{$AZURE.TENANT.ID}`, `{$AZURE.SUBSCRIPTION.ID}`, and `{$AZURE.RESOURCE.ID}`.

### Macros used

|Name|Description|Default|
|----|-----------|-------|
|{$AZURE.PROXY}|
Sets the HTTP proxy value. If this macro is empty, then no proxy is used.
||
|{$AZURE.APP.ID}|
The App ID of Microsoft Azure.
||
|{$AZURE.PASSWORD}|
Microsoft Azure password.
||
|{$AZURE.DATA.TIMEOUT}|
API response timeout.
|`15s`|
|{$AZURE.TENANT.ID}|
Microsoft Azure tenant ID.
||
|{$AZURE.SUBSCRIPTION.ID}|
Microsoft Azure subscription ID.
||
|{$AZURE.RESOURCE.ID}|
Microsoft Azure vault resource ID.
||
|{$AZURE.JOBS.FRIENDLY.NAME.MATCHES}|
Set the regex string to include backup jobs based on `entityFriendlyName`.
|`.*`|
|{$AZURE.JOBS.FRIENDLY.NAME.NOT.MATCHES}|
Set the regex string to exclude backup jobs based on `entityFriendlyName`.
|`CHANGE_IF_NEEDED`|
|{$AZURE.JOBS.STATUS.MATCHES}|
Set the regex string to include backup jobs based on status.
|`.*`|
|{$AZURE.JOBS.STATUS.NOT.MATCHES}|
Set the regex string to exclude backup jobs based on status.
|`CHANGE_IF_NEEDED`|
|{$AZURE.JOBS.OPERATION.MATCHES}|
Set the regex string to include backup jobs based on operation type.
|`.*`|
|{$AZURE.JOBS.OPERATION.NOT.MATCHES}|
Set the regex string to exclude backup jobs based on operation type.
|`CHANGE_IF_NEEDED`|
|{$AZURE.VAULT.PERIOD}|
The number of days over which to retrieve backup jobs.
|`7`|

### Items

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Get data|
Gathers data of the Azure vault.
|Script|azure.vault.data.get|
|Get errors|
A list of errors from API requests.
|Dependent item|azure.vault.data.errors
**Preprocessing**

- 
JSON Path: `$.error`

⛔️Custom on fail: Set value to: ``</p></li><li><p>Discard unchanged with heartbeat: `1h`

|
|Availability state|
The availability status of the resource.

0 - Available - no events detected that affect the health of the resource.

1 - Degraded  - your resource detected a loss in performance, although it's still available for use.

2 - Unavailable - the service detected an ongoing platform or non-platform event that affects the health of the resource.

3 - Unknown - Resource Health hasn't received information about the resource for more than 10 minutes.
|Dependent item|azure.vault.availability.state
**Preprocessing**

- 
JSON Path: `$.health.availabilityState`

⛔️Custom on fail: Set value to: `3`

- 
Replace: `Available -> 0`

- 
Replace: `Degraded -> 1`

- 
Replace: `Unavailable -> 2`

- 
Replace: `Unknown -> 3`

- 
In range: `0 -> 3`

⛔️Custom on fail: Set value to: `3`

- 
Discard unchanged with heartbeat: `1h`

|
|Availability status detailed|
The summary description of the availability status.
|Dependent item|azure.vault.availability.details
**Preprocessing**

- 
JSON Path: `$.health.summary`

⛔️Custom on fail: Discard value

- 
Discard unchanged with heartbeat: `1h`

|
|Jobs: Total|
The number of jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.total
**Preprocessing**

- 
JSON Path: `$.jobs.length()`

|
|Jobs: Completed|
The number of completed jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.completed
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.properties.status == "Completed")].length()`

|
|Jobs: In progress|
The number of jobs in progress over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.in_progress
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.properties.status == "InProgress")].length()`

|
|Jobs: Failed|
The number of failed jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.failed
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.properties.status == "Failed")].length()`

|
|Jobs: Completed with warnings|
The number of jobs completed with warnings over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.with_warning
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

|
|Jobs: Cancelled|
The number of cancelled jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.cancelled
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.properties.status == "Cancelled")].length()`

|
|Jobs: Backup|
The number of backup jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.backup
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.properties.operation == "Backup")].length()`

|
|Jobs: Restore|
The number of restore jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.restore
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.properties.operation == "Restore")].length()`

|
|Jobs: Deleting backup data|
The number of backup data deletion jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.backup.delete
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

|
|Jobs: Configuring backup|
The number of backup configuration jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).
|Dependent item|azure.vault.jobs.backup.config
**Preprocessing**

- 
JSON Path: `The text is too long. Please see the template.`

|

### Triggers

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure backup jobs: There are errors in requests to API|
Zabbix has received errors in response to API requests.
|`length(last(/Azure Backup Jobs by HTTP/azure.vault.data.errors))>0`|Average||
|Azure backup jobs: Azure vault is unavailable|
The resource state is unavailable.
|`last(/Azure Backup Jobs by HTTP/azure.vault.availability.state)=2`|High||
|Azure backup jobs: Azure vault is degraded|
The resource is in a degraded state.
|`last(/Azure Backup Jobs by HTTP/azure.vault.availability.state)=1`|Average||
|Azure backup jobs: Azure vault is in unknown state|
The resource state is unknown.
|`last(/Azure Backup Jobs by HTTP/azure.vault.availability.state)=3`|Warning||
|Azure backup jobs: Restore job has appeared|
New restore job has appeared.
|`change(/Azure Backup Jobs by HTTP/azure.vault.jobs.restore)>0`|Average|**Manual close**: Yes|
|Azure backup jobs: Backup data deletion job has appeared|
New backup data deletion job has appeared.
|`change(/Azure Backup Jobs by HTTP/azure.vault.jobs.backup.delete)>0`|Warning|**Manual close**: Yes|
|Azure backup jobs: Backup configuration job has appeared|
New backup configuration job has appeared.
|`change(/Azure Backup Jobs by HTTP/azure.vault.jobs.backup.config)>0`|Info|**Manual close**: Yes|

### LLD rule Azure backup job discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Azure backup job discovery|
List of backup jobs in the vault.
|Dependent item|azure.vault.job.discovery
**Preprocessing**

- 
JavaScript: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `1h`

|

### Item prototypes for Azure backup job discovery

|Name|Description|Type|Key and additional info|
|----|-----------|----|-----------------------|
|Job status [{#JOB.FRIENDLY.NAME}, {#JOB.NAME}]|
Job status.

Possible values:

0 - Unknown

1 - In progress

2 - Queued

3 - Completed

4 - Completed with warnings

5 - Failed

6 - Cancelled

7 - Expired
|Dependent item|azure.vault.job.status[{#JOB.NAME}]
**Preprocessing**

- 
JSON Path: `$.jobs[?(@.name == '{#JOB.NAME}')].properties.status.first()`

- 
JavaScript: `The text is too long. Please see the template.`

- 
Discard unchanged with heartbeat: `1h`

|

### Trigger prototypes for Azure backup job discovery

|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----------|--------|--------------------------------|
|Azure backup jobs: Job failed [{#JOB.NAME}]|
Job has received "Failed" status.
|`last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=5`|High|**Manual close**: Yes|
|Azure backup jobs: Job cancelled [{#JOB.NAME}]|
Job has received "Cancelled" status.
|`last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=6`|Average|**Manual close**: Yes|
|Azure backup jobs: Job completed with warnings [{#JOB.NAME}]|
Job has received "Completed with warnings" status.
|`last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=4`|Warning|**Manual close**: Yes|
|Azure backup jobs: Job expired [{#JOB.NAME}]|
Job has received "Expired" status.
|`last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=7`|Average|**Manual close**: Yes|
|Azure backup jobs: Job status unknown [{#JOB.NAME}]|
Job has received "Unknown" status.
|`last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=0`|Average|**Manual close**: Yes|

## 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)

