Original Script by Zabbix - Maxim Chudinov
Modified by Gozzim
For Zabbix version: 6.0 and higher
The template to monitor Cloudflare to watch your web traffic and DNS metrics.
It works without any external scripts and uses the Script item.
See Zabbix template operation for basic instructions.
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.
No specific Zabbix configuration is required.
Name | Description | Default |
---|---|---|
{$CLOUDFLARE.API.TOKEN} | Your Cloudflare API Token. |
<change> |
{$CLOUDFLARE.API.URL} | The URL of Cloudflare API endpoint. |
https://api.cloudflare.com/client/v4 |
{$CLOUDFLARE.CACHED_BANDWIDTH.MIN.WARN} | Minimum of cached bandwidth in %. |
50 |
{$CLOUDFLARE.ERRORS.MAX.WARN} | Maximum responses with errors in %. |
30 |
{$CLOUDFLARE.GET_DATA.TIMEOUT} | Response timeout for Cloudflare API. |
3s |
{$CLOUDFLARE.ZONE_ID} | Your Cloudflare Site Zone ID. |
<change> |
There are no template links in this template.
Group | Name | Description | Type | Key and additional info |
---|---|---|---|---|
General | Cloudflare: Total bandwidth | The volume of all data. |
DEPENDENT | cloudflare.bandwidth.all Preprocessing: - JSONPATH: |
General | Cloudflare: Cached bandwidth | The volume of cached data. |
DEPENDENT | cloudflare.bandwidth.cached Preprocessing: - JSONPATH: |
General | Cloudflare: Uncached bandwidth | The volume of uncached data. |
DEPENDENT | cloudflare.bandwidth.uncached Preprocessing: - JSONPATH: |
General | Cloudflare: Cache hit ratio of bandwidth | The ratio of the amount cached bandwidth to the bandwidth in percentage. |
DEPENDENT | cloudflare.bandwidth.cache_hit_ratio Preprocessing: - JSONPATH: |
General | Cloudflare: SSL encrypted bandwidth | The volume of encrypted data. |
DEPENDENT | cloudflare.bandwidth.ssl.encrypted Preprocessing: - JSONPATH: |
General | Cloudflare: Unencrypted bandwidth | The volume of unencrypted data. |
DEPENDENT | cloudflare.bandwidth.ssl.unencrypted Preprocessing: - JSONPATH: |
General | Cloudflare: DNS queries | The amount of all DNS queries. |
DEPENDENT | cloudflare.dns.query.all Preprocessing: - JSONPATH: |
General | Cloudflare: Stale DNS queries | The number of stale DNS queries. |
DEPENDENT | cloudflare.dns.query.stale Preprocessing: - JSONPATH: |
General | Cloudflare: Uncached DNS queries | The number of uncached DNS queries. |
DEPENDENT | cloudflare.dns.query.uncached Preprocessing: - JSONPATH: |
General | Cloudflare: Total page views | The amount of all pageviews. |
DEPENDENT | cloudflare.pageviews.all Preprocessing: - JSONPATH: |
General | Cloudflare: Total requests | The amount of all requests. |
DEPENDENT | cloudflare.requests.all Preprocessing: - JSONPATH: |
General | Cloudflare: Cached requests | - |
DEPENDENT | cloudflare.requests.cached Preprocessing: - JSONPATH: |
General | Cloudflare: Uncached requests | The number of uncached requests. |
DEPENDENT | cloudflare.requests.uncached Preprocessing: - JSONPATH: |
General | Cloudflare: Cache hit ratio % over time | The ratio of the amount cached requests to all requests in percentage. |
DEPENDENT | cloudflare.requests.cache_hit_ratio Preprocessing: - JSONPATH: |
General | Cloudflare: Response codes 1xx | The number requests with 1xx response codes. |
DEPENDENT | cloudflare.requests.response_100 Preprocessing: - JSONPATH: |
General | Cloudflare: Response codes 2xx | The number requests with 2xx response codes. |
DEPENDENT | cloudflare.requests.response_200 Preprocessing: - JSONPATH: |
General | Cloudflare: Response codes 3xx | The number requests with 3xx response codes. |
DEPENDENT | cloudflare.requests.response_300 Preprocessing: - JSONPATH: |
General | Cloudflare: Response codes 4xx | The number requests with 4xx response codes. |
DEPENDENT | cloudflare.requests.response_400 Preprocessing: - JSONPATH: |
General | Cloudflare: Response codes 5xx | The number requests with 5xx response codes. |
DEPENDENT | cloudflare.requests.response_500 Preprocessing: - JSONPATH: |
General | Cloudflare: Non-2xx responses ratio | The ratio of the amount requests with non-2xx response codes to all requests in percentage. |
DEPENDENT | cloudflare.requests.others_ratio Preprocessing: - JSONPATH: |
General | Cloudflare: 2xx responses ratio | The ratio of the amount requests with 2xx response codes to all requests in percentage. |
DEPENDENT | cloudflare.requests.success_ratio Preprocessing: - JSONPATH: |
General | Cloudflare: SSL encrypted requests | The number of encrypted requests. |
DEPENDENT | cloudflare.requests.ssl.encrypted Preprocessing: - JSONPATH: |
General | Cloudflare: Unencrypted requests | The number of unencrypted requests. |
DEPENDENT | cloudflare.requests.ssl.unencrypted Preprocessing: - JSONPATH: |
General | Cloudflare: Total threats | The number of all threats. |
DEPENDENT | cloudflare.threats.all Preprocessing: - JSONPATH: |
General | Cloudflare: Unique visitors | The number of all visitors IPs. |
DEPENDENT | cloudflare.uniques.all Preprocessing: - JSONPATH: |
Zabbix_raw_items | Cloudflare: Get data | The JSON with result of Cloudflare API request. |
SCRIPT | cloudflare.get Expression: The text is too long. Please see the template. |
Name | Description | Type | Items | Key and additional info |
---|---|---|---|---|
Cloudflare: Browser Requests | Discovered Browser Requests. |
DEPENDENT | Page views | cloudflare.browsers Preprocessing: - JSONPATH: |
Cloudflare: Client HTTP Version | Discovered Http Protocol Versions Used. |
DEPENDENT | Requests | cloudflare.httpversion Preprocessing: - JSONPATH: |
Cloudflare: Content Type | Discovered Content Type Delivered. |
DEPENDENT | Requests, Bytes | cloudflare.content Preprocessing: - JSONPATH: |
Cloudflare: Countries | Discovered Country Requests. |
DEPENDENT | Requests, Bytes, Threats | cloudflare.countries Preprocessing: - JSONPATH: |
Cloudflare: Ip Class Map | Discovered Ip Classes. |
DEPENDENT | Requests | cloudflare.ipclass Preprocessing: - JSONPATH: |
Cloudflare: SSL Type Requests | Discovered SSL Version Requests. |
DEPENDENT | Requests | cloudflare.ssl.type Preprocessing: - JSONPATH: |
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
Cloudflare: Cached bandwidth is too low (less than {$CLOUDFLARE.CACHED_BANDWIDTH.MIN.WARN}% for 3 last measurements) | max(/Cloudflare by HTTP/cloudflare.bandwidth.cache_hit_ratio,#3) < {$CLOUDFLARE.CACHED_BANDWIDTH.MIN.WARN} |
WARNING | ||
Cloudflare: Ratio of non-2xx responses is too high (more than {$CLOUDFLARE.ERRORS.MAX.WARN}% for 3 last measurements) | 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 |
Please report any issues with the template at https://support.zabbix.com