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).

TemplateMandatory macrosAdditional steps/comments
Template App 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 modstatus 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>
Template App 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.
-
Template App 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.
Template App Hadoop by HTTP{$HADOOP.CAPACITY_REMAINING.MIN.WARN} - the Hadoop cluster capacity remaining percent for trigger expression (default: 20).
{$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.NAMENODE.RESPONSE_TIME.MAX.WARN} - the Hadoop NameNode API page maximum response time in seconds for trigger expression (default: 10s).
{$HADOOP.RESOURCEMANAGER.HOST} - the Hadoop ResourceManager host IP address or FQDN (default: ResourceManager).
{$HADOOP.RESOURCEMANAGER.PORT} - the Hadoop ResourceManager web-UI port (default: 8088).
{$HADOOP.RESOURCEMANAGER.RESPONSE_TIME.MAX.WARN} - the Hadoop ResourceManager API page maximum response time in seconds for trigger expression (default: 10s).
Metrics are collected by polling the Hadoop API remotely using an HTTP agent and JSONPath preprocessing. Zabbix server (or proxy) execute direct requests to ResourceManager, NodeManagers, NameNode, DataNodes APIs. All metrics are collected at once, thanks to the Zabbix bulk data collection.
Template App 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).
Template App Nginx by HTTP{$NGINX.STUB_STATUS.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
Template App 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
Template App 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.
Template DB 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.
Template SAN NetApp AFF A700 by HTTP{$URL} - AFF700 cluster URL address (default: ‘ ‘ )
{$USERNAME}, {PASSWORD} - AFF700 login credentials (default: not set).
Create a host for AFF A700 with cluster management IP as the Zabbix agent interface.
Template Tel 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.
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.