HTTP template operation
Steps to ensure correct operation of templates that collect metrics with HTTP agent:
1. Create a host in Zabbix and specify an IP address or DNS name of the monitoring target as the main interface. This is needed for the {HOST.CONN} macro to resolve properly in the template items.
2. Link the template to the host created in step 1 (if the template is not available in your Zabbix installation, you may need to import the template’s .xml file first - see Templates out-of-the-box section for instructions).
3. Adjust the values of mandatory macros as needed.
4. Configure the instance being monitored to allow sharing data with Zabbix - see instructions in the Additional steps/comments column.
This page contains only a minimum set of macros and setup steps that are required for proper template operation. A detailed description of a template, including the full list of macros, items and triggers, is available in the template’s Readme.md file (accessible by clicking on a template name).
Template | Mandatory macros | Additional steps/comments |
---|---|---|
Apache by HTTP | {$APACHE.STATUS.HOST} - the hostname or IP address of Apache status page (default: 127.0.0.1). {$APACHE.STATUS.PATH} - the URL path (default: server-status?auto). {$APACHE.STATUS.PORT} - the port of Apache status page (default: 80). {$APACHE.STATUS.SCHEME} - the request scheme. Supported: http (default), https. | Apache module mod_status should be set (see Apache documentation for details). To check availability, run: httpd -M 2>/dev/null | grep status_module Apache configuration example: <Location “/server-status”> SetHandler server-status Require host example.com </Location> |
Asterisk by HTTP | {$AMI.PORT} - AMI port number for checking service availability (default: 8088). {$AMI.SECRET} - the Asterisk Manager secret (default: zabbix). {$AMI.URL} - the Asterisk Manager API URL in the format <scheme>://<host>:<port>/<prefix>/rawman (default: http://asterisk:8088/asterisk/rawman). {$AMI.USERNAME} - the Asterisk Manager name. | 1. Enable the mini-HTTP Server. 2. Add the option webenabled=yes to the general section of manager.conf file.3. Create Asterisk Manager user in the Asterisk instance. |
ClickHouse by HTTP | {$CLICKHOUSE.PORT} - the port of ClickHouse HTTP endpoint (default: 8123). {$CLICKHOUSE.SCHEME} - the request scheme. Supported: http (default), https. {$CLICKHOUSE.USER}, {$CLICKHOUSE.PASSWORD} - ClickHouse login credentials (default username: zabbix, password: zabbix_pass). If you don’t need authentication, remove headers from HTTP agent type items. | Create a ClickHouse user with a ‘web’ profile and permission to view databases (see ClickHouse documentation for details). See template’s Readme.md file for a ready-to-use zabbix.xml file configuration. |
Cloudflare by HTTP | {$CLOUDFLARE.API.TOKEN} - Cloudflare API token value (default: <change> ).{$CLOUDFLARE.ZONE_ID} - Cloudflare Site Zone ID (default: <change> ). | Cloudflare API Tokens are available in the Cloudflare account under My Profile→ API Tokens. Zone ID is available in the Cloudflare account under Account Home → Site. |
DELL PowerEdge R720 by HTTP, DELL PowerEdge R740 by HTTP, DELL PowerEdge R820 by HTTP, DELL PowerEdge R840 by HTTP | {$API.URL} - Dell iDRAC Redfish API URL in the format <scheme>://<host>:<port> (default: <Put your URL here>){$API.USER}, {$API.PASSWORD} - Dell iDRAC login credentials (default: not set). | In the Dell iDRAC interface of your server: 1. Enable Redfish API . 2. Create a user for monitoring with read-only permissions. |
Elasticsearch Cluster by HTTP | {$ELASTICSEARCH.PORT} - the port of the Elasticsearch host (default: 9200). {$ELASTICSEARCH.SCHEME} - the request scheme. Supported: http (default), https. {$ELASTICSEARCH.USERNAME}, {$ELASTICSEARCH.PASSWORD} - login credentials, required only if used for Elasticsearch authentication. | |
Etcd by HTTP | {$ETCD.PORT}- the port used by Etcd API endpoint (default: 2379). {$ETCD.SCHEME} - the request scheme. Supported: http (default), https. {$ETCD.USER}, {$ETCD.PASSWORD} - login credentials, required only if used for Etcd authentication. | Metrics are collected from /metrics endpoint; to specify the endpoint’s location use —listen-metrics-urls flag (see Etcd documentation for details).To verify, whether Etcd is configured to allow metric collection, run: curl -L http://localhost:2379/metrics To check, if Etcd is accessible from Zabbix proxy or Zabbix server run: curl -L http:%%//<etcd_node_adress>:2379/metrics%% The template should be added to each node with Etcd. |
GitLab by HTTP | {$GITLAB.PORT} - the port of GitLab web endpoint (default: 80) {$GITLAB.URL} - GitLab instance URL (default: localhost) | This template works with self-hosted GitLab instances; metrics are collected from the /metrics endpoint.To access the metrics, the client IP address must be explicitly allowed (see GitLab documentation for details). Note, that certain metrics may not be available for a particular GitLab instance version and configuration. |
Hadoop by HTTP | {$HADOOP.NAMENODE.HOST} - the Hadoop NameNode host IP address or FQDN (default: NameNode). {$HADOOP.NAMENODE.PORT} - the Hadoop NameNode web-UI port (default: 9870). {$HADOOP.RESOURCEMANAGER.HOST} - the Hadoop ResourceManager host IP address or FQDN (default: ResourceManager). {$HADOOP.RESOURCEMANAGER.PORT} - the Hadoop ResourceManager web-UI port (default: 8088). | Metrics are collected by polling the Hadoop API remotely using an HTTP agent and JSONPath preprocessing. Zabbix server (or proxy) executes direct requests to ResourceManager, NodeManagers, NameNode, DataNodes APIs. |
HAProxy by HTTP | {$HAPROXY.STATS.PATH} - the path of HAProxy Stats page (default: stats). {$HAPROXY.STATS.PORT} - the port of the HAProxy Stats host or container (default: 8404). {$HAPROXY.STATS.SCHEME} - the request scheme. Supported: http (default), https. | HAProxy Stats page should be set up (see HAProxy blog post for details or template’s Readme.md for configuration example). |
HashiCorp Vault by HTTP | {$VAULT.API.PORT} - the port on which the Vault listens for API requests (default: 8200). {$VAULT.API.SCHEME} - the API request scheme. Supported: http (default), https. {$VAULT.HOST} - Vault host name (default: <PUT YOUR VAULT HOST>). {$VAULT.TOKEN} - Vault authorization token (default: <PUT YOUR AUTH TOKEN>). | 1. Configure the Vault API (see official documentation for details). 2. Create a Vault service token, then copy and paste it into {$VAULT.TOKEN} macro value in Zabbix. |
Hikvision camera by HTTP | {$HIKVISION_ISAPI_PORT} - ISAPI port on a device (default: 80). {$USER}, {$PASSWORD} - camera login credentials (default username: admin, password: 1234). | |
InfluxDB by HTTP | {$INFLUXDB.API.TOKEN} - InfluxDB API authorization token (default: ).<br><strong>{$INFLUXDB.URL}</strong> - InfluxDB instance URL in the format <code><scheme>://<host>:<port></code> (default: http://localhost:8086).</td><td>This template collects internal service metrics from the InfluxDB /metrics endpoint of self-hosted InfluxDB instances.<br><br>See InfluxDB <a href="https://docs.influxdata.com/influxdb/v2.0/security/tokens/">documentation</a> for details.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/jenkins/README.md">Jenkins by HTTP</a></td><td><strong>{$JENKINS.API.KEY}</strong> - API key to access Metrics Servlet; required for common metrics (default: ).{$JENKINS.API.TOKEN} - API token for HTTP BASIC authentication; required for monitoring computers and builds (default: ).<br><strong>{$JENKINS.URL}</strong> - Jenkins URL in the format <code><scheme>://<host>:<port></code>; required for monitoring computers and builds (default: ).{$JENKINS.USER} - username for HTTP BASIC authentication; required for monitoring computers and builds (default: zabbix). | Metrics are collected by requests to Metrics API. For common metrics: install and configure Metrics plugin parameters according to the official documentation. Issue an API key for access to the Metrics Servlet, then use it as {$JENKINS.API.KEY} macro value. For monitoring computers and builds: create an API token for the Jenkins user that will be used for monitoring, then use it as {$JENKINS.API.TOKEN} macro value. See Jenkins documentation for details. |
Kubernetes API server by HTTP | {$KUBE.API.SERVER.URL} - instance URL (default: http://localhost:8086/metrics). {$KUBE.API.TOKEN} - API authorization token (default: ).</td><td>The template requires <a href="https://git.zabbix.com/projects/ZT/repos/kubernetes-helm/browse?at=refs%2Fheads%2Frelease%2F6.0">Zabbix Helm Chart</a> to be installed in your Kubernetes cluster.<br><br>Internal metrics are collected from the /metrics endpoint.<br><br>Use bearer API token for authorization. See Kubernetes <a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/">documentation</a> for details.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/kubernetes_http/kubernetes_controller_manager_http/README.md">Kubernetes Controller manager by HTTP</a></td><td><strong>{$KUBE.CONTROLLER.SERVER.URL}</strong> - instance URL (default: http://localhost:10252/metrics).<br><strong>{$KUBE.CONTROLLER.TOKEN}</strong> - API authorization token (default: ). | The template requires Zabbix Helm Chart to be installed in your Kubernetes cluster. Internal metrics are collected from the /metrics endpoint. Use bearer API token for authorization. See Kubernetes documentation for details. |
Kubernetes kubelet by HTTP | {$KUBE.KUBELET.URL} - instance URL (default: https://localhost:10250). {$KUBE.API.TOKEN} - API authorization token (default: ).</td><td>The template requires <a href="https://git.zabbix.com/projects/ZT/repos/kubernetes-helm/browse?at=refs%2Fheads%2Frelease%2F6.0">Zabbix Helm Chart</a> to be installed in your Kubernetes cluster.<br><br>Internal metrics are collected from the /metrics endpoint.<br><br>Use bearer API token for authorization. See Kubernetes <a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/">documentation</a> for details.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/kubernetes_http/kubernetes_nodes_http/README.md">Kubernetes nodes by HTTP</a></td><td><strong>{$KUBE.API.ENDPOINT}</strong> - Kubernetes API endpoint in the format <scheme>://<host>:<port>/api (default: not set).<br><strong>{$KUBE.API.TOKEN}</strong> - API authorization token (default: ). | The template requires Zabbix Helm Chart to be installed in your Kubernetes cluster. To generate a service account token, run: kubectl get secret zabbix-service-account -n zabbix -o jsonpath={.data.token} | base64 -d See Kubernetes documentation for details. The template contains additional macros, which can be used to filter out certain metrics of discovered worker nodes. |
Kubernetes Scheduler by HTTP | {$KUBE.SCHEDULER.SERVER.URL} - instance URL (default: http://localhost:10251/metrics). {$KUBE.SCHEDULER.TOKEN} - Scheduler API authorization token (default: ).</td><td>The template requires <a href="https://git.zabbix.com/projects/ZT/repos/kubernetes-helm/browse?at=refs%2Fheads%2Frelease%2F6.0">Zabbix Helm Chart</a> to be installed in your Kubernetes cluster.<br><br>Internal metrics are collected from the /metrics endpoint.<br><br>Use bearer API token for authorization. See Kubernetes <a href="https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/">documentation</a> for details.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/kubernetes_http/kubernetes_state_http/README.md">Kubernetes cluster state by HTTP</a></td><td><strong>{$KUBE.API.HOST}</strong> - Kubernetes API host (default: not set).<br><strong>{$KUBE.API.PORT}</strong>- Kubernetes API port (default:6443).<br><strong>{$KUBE.API.TOKEN}</strong> - API authorization token (default: ). | The template requires Zabbix Helm Chart to be installed in your Kubernetes cluster. Internal service metrics are collected from the kube-state-metrics endpoint. Use bearer API token for authorization. See Kubernetes documentation for details. The template contains additional macros, which can be used to filter out certain metrics of discovered worker nodes. |
Microsoft SharePoint by HTTP | {$SHAREPOINT.URL} - portal page URL, for example http://sharepoint.companyname.local/ (default: ).<br><strong>{$SHAREPOINT.ROOT}</strong> - a root directory; only the specified directory and all its subfolders will be monitored (default: /Shared Documents)<br><strong>{$SHAREPOINT.USER}</strong>, <strong>{$SHAREPOINT.PASSWORD}</strong> - SharePoint login credentials (default: not set).</td><td>The template contains additional macros, which can be used to filter out certain dictionaries and types during LLD process (see template's <a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/sharepoint_http/README.md">Readme.md</a> for the description of available filter macros).</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/san/netapp_aff_a700_http/README.md">NetApp AFF A700 by HTTP</a></td><td><strong>{$URL}</strong> - AFF700 cluster URL address (default: ' ' )<br><strong>{$USERNAME}</strong>, <strong>{PASSWORD}</strong> - AFF700 login credentials (default: not set).</td><td>Create a host for AFF A700 with cluster management IP as the Zabbix agent interface.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_http/README.md">NGINX by HTTP</a></td><td><strong>{$NGINX.STUB_STATUS.HOST}</strong> - the hostname or IP address of NGINX stub_status host or container (default: localhost).<br><strong>{$NGINX.STUB_STATUS.PATH}</strong> - the path of NGINX stub_status page (default: basic_status).<br><strong>{$NGINX.STUB_STATUS.PORT}</strong> - the port of NGINX stub_status host or container (default: 80).<br><strong>{$NGINX.STUB_STATUS.SCHEME}</strong> - the request scheme. Supported: http (default), https.</td><td><code>'ngx_http_stub_status_module</code> should be set up (see NGINX <a href="https://nginx.org/en/docs/http/ngx_http_stub_status_module.html">documentation</a> for details or template's Readme.md for configuration example).<br>To check availability, run:<br><code>nginx -V 2>&1 \| grep -o with-http_stub_status_module</code></td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_plus_http/README.md">NGINX Plus by HTTP</a></td><td><strong>{$NGINX.API.ENDPOINT}</strong> - NGINX Plus API URL in the format <code><scheme>://<host>:<port>/<location>/</code> (default: ' ').</td><td>1. Enable NGINX Plus API (see NGINX <a href="https://www.nginx.com/products/nginx/live-activity-monitoring/">documentation</a> for details).<br>2. Set the macro {$NGINX.API.ENDPOINT}<br>3. If required, use other template macros to filter out discovery operations and discover only required zones and upstreams.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/php-fpm_agent/README.md">PHP-FPM by HTTP</a></td><td><strong>{$PHP_FPM.HOST}</strong> - a hostname or an IP of PHP-FPM status host or container (default: localhost).<br><strong>{$PHP_FPM.PING.PAGE}</strong> - PHP-FPM ping page path (default:ping).<br><strong>{$PHP_FPM.PORT}</strong> - the port of PHP-FPM status host or container (default: 80).<br><strong>{$PHP_FPM.PROCESS_NAME}</strong> - PHP-FPM process name (default: php-fpm).<br><strong>{$PHP_FPM.SCHEME}</strong> - the request scheme. Supported: http (default), https.<br><strong>{$PHP_FPM.STATUS.PAGE}</strong> - PHP-FPM status page path (default:<code>status</code>).</td><td>1. Open the php-fpm configuration file and enable the status page:<br><code>pm.status_path = /status</code><br><code>ping.path = /ping</code><br><br>2. Validate the syntax: <code>$ php-fpm7 -t</code><br><br>3. Reload the php-fpm service.<br><br>4. In the Nginx Server Block (virtual host) configuration file, add (see template's <em>Readme.md</em> for an expanded example with comments):<br><code>location ~ ^/(status\|ping)$ {</code><br><code>access_log off;</code><br><code>fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;</code><br><code>fastcgi_index index.php;</code><br><code>include fastcgi_params;</code><br><code>fastcgi_pass 127.0.0.1:9000;</code><br><code>}</code><br><br>5. Check the syntax: <code>$ nginx -t</code><br><br>6. Reload Nginx<br><br>7. Verify: <code>curl -L 127.0.0.1/status</code></td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/rabbitmq_http/README.md">RabbitMQ cluster by HTTP</a></td><td><strong>{$RABBITMQ.API.CLUSTER_HOST}</strong> - the hostname or IP address of RabbitMQ cluster API endpoint (default: 127.0.0.1).<br><strong>{$RABBITMQ.API.SCHEME}</strong> - the request scheme. Supported: http (default), https.<br><strong>{$RABBITMQ.API.USER}</strong>, <strong>{$RABBITMQ.API.PASSWORD}</strong> - RabbitMQ login credentials (default username: zbx_monitor, password: zabbix).</td><td>Enable RabbitMQ management plugin (see <a href="https://www.rabbitmq.com/management.html">RabbitMQ documentation</a>).<br><br>To create a RabbitMQ user with necessary permissions for monitoring, run:<br>'' rabbitmqctl add_user zbx_monitor <PASSWORD> ''<br><code>rabbitmqctl set_permissions -p / zbx_monitor %% "" "" ".*"%%</code><br><code>rabbitmqctl set_user_tags zbx_monitor monitoring</code><br><br>If the cluster consists of several nodes, it is recommended to assign the cluster template to a separate balancing host. In case of a single-node installation, the cluster template can be assigned to the host with a node template.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/tidb_http/tidb_tidb_http/README.md">TiDB by HTTP</a></td><td><strong>{$TIDB.PORT}</strong> - The port of TiDB server metrics web endpoint (default: 10080)<br><strong>{$TIDB.URL}</strong> - TiDB server URL (default: localhost).</td><td>This template works with TiDB server of PingCAP TiDB cluster.<br>Internal service metrics are collected from TiDB /metrics endpoint and TiDB monitoring API.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/tidb_http/tidb_pd_http/README.md">TiDB PD by HTTP</a></td><td><strong>{$TIDB.PORT}</strong> - The port of TiDB server metrics web endpoint (default: 2379)<br><strong>{$TIDB.URL}</strong> - TiDB server URL (default: localhost).</td><td>This template works with PD server of PingCAP TiDB cluster.<br>Internal service metrics are collected from PD /metrics endpoint and TiDB monitoring API.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/tidb_http/tidb_tikv_http/README.md">TiDB TiKV by HTTP</a></td><td><strong>{$TIDB.PORT}</strong> - The port of TiDB server metrics web endpoint (default: 20180)<br><strong>{$TIDB.URL}</strong> - TiDB server URL (default: localhost).</td><td>This template works with TiKV server of PingCAP TiDB cluster.<br>Internal service metrics are collected from TiKV /metrics endpoint.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/travis_ci_http/README.md">Travis CI by HTTP</a></td><td><strong>{$TRAVIS.API.TOKEN}</strong> - Travis API Token (default: not set)<br><strong>{$TRAVIS.API.URL}</strong> - Travis API URL (default: api.travis-ci.com).</td><td>Travis API authentication token can be found in the <em>User → Settings → API authentication</em> section.<br>{$TRAVIS.API.URL} format for a private project is <em>api.travis-ci.com</em>.<br>{$TRAVIS.API.URL} format for an enterprise project is <em>api.example.com</em> (replace example.com with the domain Travis CI is running on).</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/net/velocloud_http/README.md">VMWare SD-WAN VeloCloud by HTTP</a></td><td><strong>{$VELOCLOUD.TOKEN}</strong> - VMware SD-WAN Orchestrator API Token (default: ).{$VELOCLOUD.URL} - VMware SD-WAN Orchestrator URL, for example, velocloud.net (default: ``). | API token should be created in the VMware SD-WAN Orchestrator (see VMware documentation for details). |
ZooKeeper by HTTP | {$ZOOKEEPER.COMMAND_URL} - admin.commandURL; the URL for listing and issuing commands relative to the root URL (default: commands). {ZOOKEEPER.PORT} - admin.serverPort; the port the embedded Jetty server listens on (default: 8080). {$ZOOKEEPER.SCHEME} - the request scheme. Supported: http (default), https. | Metrics are collected from each ZooKeeper node by requests to AdminServer (enabled by default). See ZooKeeper documentation to enable or configure AdminServer. |