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 |
---|---|---|
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. |
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. |
Jenkins by HTTP | {$JENKINS.API.KEY} - API key to access Metrics Servlet; required for common metrics (default: ).<br><strong>{$JENKINS.<abbr title="Application Programming Interface">API</abbr>.TOKEN}</strong> - <abbr title="Application Programming Interface">API</abbr> token for HTTP BASIC authentication; required for monitoring computers and builds (default: ).{$JENKINS.URL} - Jenkins URL in the format <scheme>://<host>:<port> ; required for monitoring computers and builds (default: ).<br><strong>{$JENKINS.USER}</strong> - username for HTTP BASIC authentication; required for monitoring computers and builds (default: zabbix).</td><td>Metrics are collected by requests to Metrics <abbr title="Application Programming Interface">API</abbr>.<br><br>For common metrics: install and configure Metrics plugin parameters according to the <a href="https://plugins.jenkins.io/metrics/" class="urlextern" title="https://plugins.jenkins.io/metrics/" rel="nofollow">official documentation</a>. Issue an <abbr title="Application Programming Interface">API</abbr> key for access to the Metrics Servlet, then use it as {$JENKINS.<abbr title="Application Programming Interface">API</abbr>.KEY} macro value.<br><br>For monitoring computers and builds: create an <abbr title="Application Programming Interface">API</abbr> token for the Jenkins user that will be used for monitoring, then use it as {$JENKINS.<abbr title="Application Programming Interface">API</abbr>.TOKEN} macro value. See Jenkins <a href="https://www.jenkins.io/doc/book/system-administration/authenticating-scripted-clients/" class="urlextern" title="https://www.jenkins.io/doc/book/system-administration/authenticating-scripted-clients/" rel="nofollow">documentation</a> for details.</td></tr><tr><td><a href="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/sharepoint_http/README.md" class="urlextern" title="https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/sharepoint_http/README.md" rel="nofollow">Microsoft SharePoint by HTTP</a></td><td><strong>{$SHAREPOINT.<abbr title="Uniform Resource Locator">URL</abbr>}</strong> - portal page <abbr title="Uniform Resource Locator">URL</abbr>, for example <em>http://sharepoint.companyname.local/</em> (default: ).{$SHAREPOINT.ROOT} - a root directory; only the specified directory and all its subfolders will be monitored (default: /Shared Documents) {$SHAREPOINT.USER}, {$SHAREPOINT.PASSWORD} - SharePoint login credentials (default: not set). | The template contains additional macros, which can be used to filter out certain dictionaries and types during LLD process (see template’s Readme.md for the description of available filter macros). |
Nginx by HTTP | {$NGINX.STUBSTATUS.HOST} - the hostname or IP address of Nginx stub_status host or container (default: localhost). {$NGINX.STUB_STATUS.PATH} - the path of Nginx stub_status page (default: basic_status). {$NGINX.STUB_STATUS.PORT} - the port of Nginx stub_status host or container (default: 80). {$NGINX.STUB_STATUS.SCHEME} - the request scheme. Supported: http (default), https. | ‘ngx_http_stub_status_module should be set up (see Nginx documentation for details or template’s Readme.md for configuration example).To check availability, run: nginx -V 2>&1 | grep -o with-http_stub_status_module |
PHP-FPM by HTTP | {$PHP_FPM.HOST} - a hostname or an IP of PHP-FPM status host or container (default: localhost ).{$PHP_FPM.PING.PAGE} - PHP-FPM ping page path (default: ping ).{$PHP_FPM.PORT} - the port of PHP-FPM status host or container (default: 80 ).{$PHP_FPM.PROCESS_NAME} - PHP-FPM process name (default: php-fpm ).{$PHP_FPM.SCHEME} - the request scheme. Supported: http (default), https. {$PHP_FPM.STATUS.PAGE} - PHP-FPM status page path (default: status ). | 1. Open the php-fpm configuration file and enable the status page:pm.status_path = /status ping.path = /ping 2. Validate the syntax: $ php-fpm7 -t 3. Reload the php-fpm service. 4. In the Nginx Server Block (virtual host) configuration file, add (see template’s Readme.md for an expanded example with comments): location ~ ^/(status|ping)$ { access_log off; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } 5. Check the syntax: $ nginx -t 6. Reload Nginx 7. Verify: curl -L 127.0.0.1/status |
RabbitMQ cluster by HTTP | {$RABBITMQ.API.CLUSTER_HOST} - the hostname or IP address of RabbitMQ cluster API endpoint (default: 127.0.0.1). {$RABBITMQ.API.SCHEME} - the request scheme. Supported: http (default), https. {$RABBITMQ.API.USER}, {$RABBITMQ.API.PASSWORD} - RabbitMQ login credentials (default username: zbx_monitor, password: zabbix). | Enable RabbitMQ management plugin (see RabbitMQ documentation). To create a RabbitMQ user with nessesary permissions for monitoring, run: rabbitmqctl add_user zbx_monitor <PASSWORD> rabbitmqctl set_permissions -p / zbx_monitor “” “” “.*” rabbitmqctl set_user_tags zbx_monitor monitoring 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. |
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. |
ZooKeeper by HTTP | {$ZOOKEEPER.COMMANDURL} - 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. |