# Cloudflare by HTTP ## Overview This template is designed for the effortless deployment of Cloudflare 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: - Cloudflare ## 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 a host, for example mywebsite.com, for a site in your Cloudflare account. 2\. Link the template to the host. 3\. Customize the values of {$CLOUDFLARE.API.TOKEN}, {$CLOUDFLARE.ZONE_ID} macros. Cloudflare API Tokens are available in your Cloudflare account under My Profile > API Tokens. Zone ID is available in your Cloudflare account under Account Home > Site. ### Macros used |Name|Description|Default| |----|-----------|-------| |{$CLOUDFLARE.API.URL}|
The URL of Cloudflare API endpoint.
|`https://api.cloudflare.com/client/v4`| |{$CLOUDFLARE.API.TOKEN}|Your Cloudflare API Token.
|`Your Cloudflare Site Zone ID.
|`Response timeout for Cloudflare API.
|`3s`| |{$CLOUDFLARE.ERRORS.MAX.WARN}|Maximum responses with errors in %.
|`30`| |{$CLOUDFLARE.CACHED_BANDWIDTH.MIN.WARN}|Minimum of cached bandwidth in %.
|`50`| ### Items |Name|Description|Type|Key and additional info| |----|-----------|----|-----------------------| |Cloudflare: Total bandwidth|The volume of all data.
|Dependent item|cloudflare.bandwidth.all**Preprocessing**
JSON Path: `$.bandwidth.all`
The volume of cached data.
|Dependent item|cloudflare.bandwidth.cached**Preprocessing**
JSON Path: `$.bandwidth.cached`
The volume of uncached data.
|Dependent item|cloudflare.bandwidth.uncached**Preprocessing**
JSON Path: `$.bandwidth.uncached`
The ratio of the amount cached bandwidth to the bandwidth in percentage.
|Dependent item|cloudflare.bandwidth.cache_hit_ratio**Preprocessing**
JSON Path: `$.bandwidth.cache_hit_ratio`
The volume of encrypted data.
|Dependent item|cloudflare.bandwidth.ssl.encrypted**Preprocessing**
JSON Path: `$.bandwidth.encrypted`
The volume of unencrypted data.
|Dependent item|cloudflare.bandwidth.ssl.unencrypted**Preprocessing**
JSON Path: `$.bandwidth.unencrypted`
The amount of all DNS queries.
|Dependent item|cloudflare.dns.query.all**Preprocessing**
JSON Path: `$.dns.query.all`
The number of stale DNS queries.
|Dependent item|cloudflare.dns.query.stale**Preprocessing**
JSON Path: `$.dns.query.stale`
The number of uncached DNS queries.
|Dependent item|cloudflare.dns.query.uncached**Preprocessing**
JSON Path: `$.dns.query.uncached`
The JSON with result of Cloudflare API request.
|Script|cloudflare.get| |Cloudflare: Total page views|The amount of all pageviews.
|Dependent item|cloudflare.pageviews.all**Preprocessing**
JSON Path: `$.pageviews.all`
The amount of all requests.
|Dependent item|cloudflare.requests.all**Preprocessing**
JSON Path: `$.requests.all`
**Preprocessing**
JSON Path: `$.requests.cached`
The number of uncached requests.
|Dependent item|cloudflare.requests.uncached**Preprocessing**
JSON Path: `$.requests.uncached`
The ratio of the amount cached requests to all requests in percentage.
|Dependent item|cloudflare.requests.cache_hit_ratio**Preprocessing**
JSON Path: `$.requests.cache_hit_ratio`
The number requests with 1xx response codes.
|Dependent item|cloudflare.requests.response_100**Preprocessing**
JSON Path: `$.requests.response_100`
The number requests with 2xx response codes.
|Dependent item|cloudflare.requests.response_200**Preprocessing**
JSON Path: `$.requests.response_200`
The number requests with 3xx response codes.
|Dependent item|cloudflare.requests.response_300**Preprocessing**
JSON Path: `$.requests.response_300`
The number requests with 4xx response codes.
|Dependent item|cloudflare.requests.response_400**Preprocessing**
JSON Path: `$.requests.response_400`
The number requests with 5xx response codes.
|Dependent item|cloudflare.requests.response_500**Preprocessing**
JSON Path: `$.requests.response_500`
The ratio of the amount requests with non-2xx response codes to all requests in percentage.
|Dependent item|cloudflare.requests.others_ratio**Preprocessing**
JSON Path: `$.requests.others_ratio`
The ratio of the amount requests with 2xx response codes to all requests in percentage.
|Dependent item|cloudflare.requests.success_ratio**Preprocessing**
JSON Path: `$.requests.success_ratio`
The number of encrypted requests.
|Dependent item|cloudflare.requests.ssl.encrypted**Preprocessing**
JSON Path: `$.requests.encrypted`
The number of unencrypted requests.
|Dependent item|cloudflare.requests.ssl.unencrypted**Preprocessing**
JSON Path: `$.requests.unencrypted`
The number of all threats.
|Dependent item|cloudflare.threats.all**Preprocessing**
JSON Path: `$.threats.all`
The number of all visitors IPs.
|Dependent item|cloudflare.uniques.all**Preprocessing**
JSON Path: `$.uniques.all`
A large number of errors can indicate a malfunction of the site.
|`min(/Cloudflare by HTTP/cloudflare.requests.others_ratio,#3) > {$CLOUDFLARE.ERRORS.MAX.WARN}`|Average|| ## 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)