HAPROXY

HAPROXY

HAProxy is free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers. It is written in C and has a reputation for being fast and efficient

Available solutions




Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/haproxy_http


Template App HAProxy by HTTP

Overview

For Zabbix version: 4.4
The template to monitor HAProxy by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.

Template App HAProxy by HTTP collects metrics by polling HAProxy Stats Page with HTTP agent remotely:

Note that this solution supports https and redirects.

This template was tested on:

  • HAProxy, version 1.8
  • Zabbix, version 4.4

Setup

Setup HAProxy Stats Page.

Example configuration of HAProxy:

frontend stats
    bind *:8404
    stats enable
    stats uri /stats
    stats refresh 10s
    #stats auth Username:Password  # Authentication credentials

If you use another location, don't forget to change the macros {$HAPROXY.STATS.SCHEME},{HOST.CONN}, {$HAPROXY.STATS.PORT},{$HAPROXY.STATS.PATH}. If you want to use authentication, set the username and password in the "stats auth" option of the configuration file and in the macros {$HAPROXY.USERNAME},{$HAPROXY.PASSWORD}.

Zabbix configuration

No specific Zabbix configuration is required.

Macros used

Name Description Default
{$HAPROXY.BACK_ERESP.MAX.WARN}

Maximum of responses with error on BACKEND for trigger expression.

10
{$HAPROXY.BACK_QCUR.MAX.WARN}

Maximum number of requests on BACKEND unassigned in queue for trigger expression.

10
{$HAPROXY.BACK_QTIME.MAX.WARN}

Maximum of average time spent in queue on BACKEND for trigger expression.

10s
{$HAPROXY.BACK_RTIME.MAX.WARN}

Maximum of average BACKEND response time for trigger expression.

10s
{$HAPROXY.FRONT_DREQ.MAX.WARN}

The HAProxy maximum denied requests for trigger expression.

10
{$HAPROXY.FRONT_EREQ.MAX.WARN}

The HAProxy maximum number of request errors for trigger expression.

10
{$HAPROXY.FRONT_SUTIL.MAX.WARN}

Maximum of session usage percentage on frontend for trigger expression.

80%
{$HAPROXY.PASSWORD}

The password of the HAProxy stats page.

``
{$HAPROXY.RESPONSE_TIME.MAX.WARN}

The HAProxy stats page maximum response time in seconds for trigger expression.

10s
{$HAPROXY.SERVER_ERESP.MAX.WARN}

Maximum of responses with error on server for trigger expression.

10
{$HAPROXY.SERVER_QCUR.MAX.WARN}

Maximum number of requests on server unassigned in queue for trigger expression.

10
{$HAPROXY.SERVER_QTIME.MAX.WARN}

Maximum of average time spent in queue on server for trigger expression.

10s
{$HAPROXY.SERVER_RTIME.MAX.WARN}

Maximum of average server response time for trigger expression.

10s
{$HAPROXY.STATS.PATH}

The path of the HAProxy stats page.

stats
{$HAPROXY.STATS.PORT}

The port of the HAProxy stats host or container.

8404
{$HAPROXY.STATS.SCHEME}

The scheme of HAProxy stats page(http/https).

http
{$HAPROXY.USERNAME}

The username of the HAProxy stats page.

``

Template links

There are no template links in this template.

Discovery rules

Name Description Type Key and additional info
BACKEND discovery

Discovery backends

DEPENDENT haproxy.backend.discovery

Filter:

AND

- A: {#SVNAME} MATCHES_REGEX BACKEND

- B: {#MODE} MATCHES_REGEX http

FRONTEND discovery

Discovery frontends

DEPENDENT haproxy.frontend.discovery

Filter:

AND

- A: {#SVNAME} MATCHES_REGEX FRONTEND

- B: {#MODE} MATCHES_REGEX http

Servers discovery

Discovery servers

DEPENDENT haproxy.server.discovery

Filter:

AND

- A: {#SVNAME} NOT_MATCHES_REGEX FRONTEND|BACKEND

- B: {#MODE} MATCHES_REGEX http

TCP BACKEND discovery

Discovery TCP backends

DEPENDENT haproxy.backend_tcp.discovery

Filter:

AND

- A: {#SVNAME} MATCHES_REGEX BACKEND

- B: {#MODE} MATCHES_REGEX tcp

TCP FRONTEND discovery

Discovery TCP frontends

DEPENDENT haproxy.frontend_tcp.discovery

Filter:

AND

- A: {#SVNAME} MATCHES_REGEX FRONTEND

- B: {#MODE} MATCHES_REGEX tcp

TCP Servers discovery

Discovery tcp servers

DEPENDENT haproxy.server_tcp.discovery

Filter:

AND

- A: {#SVNAME} NOT_MATCHES_REGEX FRONTEND|BACKEND

- B: {#MODE} MATCHES_REGEX tcp

Items collected

Group Name Description Type Key and additional info
HAProxy HAProxy: Version

-

DEPENDENT haproxy.version

Preprocessing:

- REGEX: HAProxy version ([^,]*), \1

⛔️ON_FAIL: CUSTOM_ERROR -> HAProxy version is not found

- DISCARD_UNCHANGED_HEARTBEAT: 1d

HAProxy HAProxy: Uptime

-

DEPENDENT haproxy.uptime

Preprocessing:

- JAVASCRIPT: try { var t = value.match(/(\d+)d (\d+)h(\d+)m(\d+)s/); return t[1] * 86400 + t[2] * 3600 + t[3] * 60 + t[4] * 1; } catch (error) { throw "HAProxy uptime is not found : " + error; }

HAProxy HAProxy: Service status

-

SIMPLE net.tcp.service["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"]

Preprocessing:

- DISCARD_UNCHANGED_HEARTBEAT: 10m

HAProxy HAProxy: Service response time

-

SIMPLE net.tcp.service.perf["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"]
HAProxy HAProxy Backend {#PXNAME}: Status

-

DEPENDENT haproxy.backend.status[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].status.first()

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 10m

HAProxy HAProxy Backend {#PXNAME}: Responses time

Average backend response time (in ms) for the last 1,024 requests

DEPENDENT haproxy.backend.rtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy Backend {#PXNAME}: Errors connection per second

Number of requests that encountered an error attempting to connect to a backend server.

DEPENDENT haproxy.backend.econ.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].econ.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Backend {#PXNAME}: Responses denied per second

Responses denied due to security concerns (ACL-restricted).

DEPENDENT haproxy.backend.dresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].dresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Backend {#PXNAME}: Response errors per second

Number of requests whose responses yielded an error

DEPENDENT haproxy.backend.eresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].eresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Backend {#PXNAME}: Unassigned requests

Current number of requests unassigned in queue.

DEPENDENT haproxy.backend.qcur[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qcur.first()

HAProxy HAProxy Backend {#PXNAME}: Time in queue

Average time spent in queue (in ms) for the last 1,024 requests

DEPENDENT haproxy.backend.qtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy Backend {#PXNAME}: Redispatched requests per second

Number of times a request was redispatched to a different backend.

DEPENDENT haproxy.backend.wredis.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wredis.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Backend {#PXNAME}: Retried connections per second

Number of times a connection was retried.

DEPENDENT haproxy.backend.wretr.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wretr.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Requests rate

HTTP requests per second

DEPENDENT haproxy.frontend.req_rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].req_rate.first()

HAProxy HAProxy Frontend {#PXNAME}: Sessions rate

Number of sessions created per second

DEPENDENT haproxy.frontend.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rate.first()

HAProxy HAProxy Frontend {#PXNAME}: Established sessions

The current number of established sessions.

DEPENDENT haproxy.frontend.scur[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].scur.first()

HAProxy HAProxy Frontend {#PXNAME}: Session limits

The most simultaneous sessions that are allowed, as defined by the maxconn setting in the frontend.

DEPENDENT haproxy.frontend.slim[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].slim.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

HAProxy HAProxy Frontend {#PXNAME}: Session utilization

Percentage of sessions used (scur / slim * 100).

CALCULATED haproxy.frontend.sutil[{#PXNAME}:{#SVNAME}]

Expression:

last(haproxy.frontend.scur[{#PXNAME}:{#SVNAME}]) / last(haproxy.frontend.slim[{#PXNAME}:{#SVNAME}]) * 100
HAProxy HAProxy Frontend {#PXNAME}: Request errors per second

Number of request errors per second.

DEPENDENT haproxy.frontend.ereq.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].ereq.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Denied requests per second

Requests denied due to security concerns (ACL-restricted) per second.

DEPENDENT haproxy.frontend.dreq.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].dreq.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Number of responses with codes 1xx per second

Number of informational HTTP responses per second.

DEPENDENT haproxy.frontend.hrsp_1xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_1xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Number of responses with codes 2xx per second

Number of successful HTTP responses per second.

DEPENDENT haproxy.frontend.hrsp_2xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_2xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Number of responses with codes 3xx per second

Number of HTTP redirections per second.

DEPENDENT haproxy.frontend.hrsp_3xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_3xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Number of responses with codes 4xx per second

Number of HTTP client errors per second.

DEPENDENT haproxy.frontend.hrsp_4xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_4xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Number of responses with codes 5xx per second

Number of HTTP server errors per second.

DEPENDENT haproxy.frontend.hrsp_5xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_5xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Incoming traffic

Number of bits received by the frontend

DEPENDENT haproxy.frontend.bin[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bin.first()

- MULTIPLIER: 8

- CHANGE_PER_SECOND

HAProxy HAProxy Frontend {#PXNAME}: Outgoing traffic

Number of bits sent by the frontend

DEPENDENT haproxy.frontend.bout[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bout.first()

- MULTIPLIER: 8

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Status

-

DEPENDENT haproxy.server.status[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].status.first()

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 10m

HAProxy HAProxy {#PXNAME} {#SVNAME}: Responses time

Average server response time (in ms) for the last 1,024 requests.

DEPENDENT haproxy.server.rtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy {#PXNAME} {#SVNAME}: Errors connection per second

Number of requests that encountered an error attempting to connect to a backend server.

DEPENDENT haproxy.server.econ.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].econ.first()

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Responses denied per second

Responses denied due to security concerns (ACL-restricted).

DEPENDENT haproxy.server.dresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].dresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Response errors per second

Number of requests whose responses yielded an error.

DEPENDENT haproxy.server.eresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].eresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Unassigned requests

Current number of requests unassigned in queue.

DEPENDENT haproxy.server.qcur[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qcur.first()

HAProxy HAProxy {#PXNAME} {#SVNAME}: Time in queue

Average time spent in queue (in ms) for the last 1,024 requests.

DEPENDENT haproxy.server.qtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy {#PXNAME} {#SVNAME}: Redispatched requests per second

Number of times a request was redispatched to a different backend.

DEPENDENT haproxy.server.wredis.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wredis.first()

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Retried connections per second

Number of times a connection was retried.

DEPENDENT haproxy.server.wretr.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wretr.first()

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 4xx per second

Number of HTTP client errors per second.

DEPENDENT haproxy.server.hrsp_4xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_4xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 5xx per second

Number of HTTP server errors per second.

DEPENDENT haproxy.server.hrsp_5xx.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].hrsp_5xx.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Backend {#PXNAME}: Status

-

DEPENDENT haproxy.backend_tcp.status[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].status.first()

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 10m

HAProxy HAProxy TCP Backend {#PXNAME}: Responses time

Average backend response time (in ms) for the last 1,024 requests

DEPENDENT haproxy.backend_tcp.rtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy TCP Backend {#PXNAME}: Errors connection per second

Number of requests that encountered an error attempting to connect to a backend server.

DEPENDENT haproxy.backend_tcp.econ.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].econ.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Backend {#PXNAME}: Responses denied per second

Responses denied due to security concerns (ACL-restricted).

DEPENDENT haproxy.backend_tcp.dresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].dresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Backend {#PXNAME}: Response errors per second

Number of requests whose responses yielded an error

DEPENDENT haproxy.backend_tcp.eresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].eresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Backend {#PXNAME}: Unassigned requests

Current number of requests unassigned in queue.

DEPENDENT haproxy.backend_tcp.qcur[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qcur.first()

HAProxy HAProxy TCP Backend {#PXNAME}: Time in queue

Average time spent in queue (in ms) for the last 1,024 requests

DEPENDENT haproxy.backend_tcp.qtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy TCP Backend {#PXNAME}: Redispatched requests per second

Number of times a request was redispatched to a different backend.

DEPENDENT haproxy.backend_tcp.wredis.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wredis.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Backend {#PXNAME}: Retried connections per second

Number of times a connection was retried.

DEPENDENT haproxy.backend_tcp.wretr.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wretr.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Frontend {#PXNAME}: Requests rate

HTTP requests per second

DEPENDENT haproxy.frontend_tcp.req_rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].req_rate.first()

HAProxy HAProxy TCP Frontend {#PXNAME}: Sessions rate

Number of sessions created per second

DEPENDENT haproxy.frontend_tcp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rate.first()

HAProxy HAProxy TCP Frontend {#PXNAME}: Established sessions

The current number of established sessions.

DEPENDENT haproxy.frontend_tcp.scur[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].scur.first()

HAProxy HAProxy TCP Frontend {#PXNAME}: Session limits

The most simultaneous sessions that are allowed, as defined by the maxconn setting in the frontend.

DEPENDENT haproxy.frontend_tcp.slim[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].slim.first()

- DISCARD_UNCHANGED_HEARTBEAT: 1h

HAProxy HAProxy TCP Frontend {#PXNAME}: Session utilization

Percentage of sessions used (scur / slim * 100).

CALCULATED haproxy.frontend_tcp.sutil[{#PXNAME}:{#SVNAME}]

Expression:

last(haproxy.frontend_tcp.scur[{#PXNAME}:{#SVNAME}]) / last(haproxy.frontend_tcp.slim[{#PXNAME}:{#SVNAME}]) * 100
HAProxy HAProxy TCP Frontend {#PXNAME}: Request errors per second

Number of request errors per second.

DEPENDENT haproxy.frontend_tcp.ereq.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].ereq.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Frontend {#PXNAME}: Denied requests per second

Requests denied due to security concerns (ACL-restricted) per second.

DEPENDENT haproxy.frontend_tcp.dreq.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].dreq.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Frontend {#PXNAME}: Incoming traffic

Number of bits received by the frontend

DEPENDENT haproxy.frontend_tcp.bin[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bin.first()

- MULTIPLIER: 8

- CHANGE_PER_SECOND

HAProxy HAProxy TCP Frontend {#PXNAME}: Outgoing traffic

Number of bits sent by the frontend

DEPENDENT haproxy.frontend_tcp.bout[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bout.first()

- MULTIPLIER: 8

- CHANGE_PER_SECOND

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Status

-

DEPENDENT haproxy.server_tcp.status[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].status.first()

- BOOL_TO_DECIMAL

- DISCARD_UNCHANGED_HEARTBEAT: 10m

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Responses time

Average server response time (in ms) for the last 1,024 requests.

DEPENDENT haproxy.server_tcp.rtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Errors connection per second

Number of requests that encountered an error attempting to connect to a backend server.

DEPENDENT haproxy.server_tcp.econ.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].econ.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Responses denied per second

Responses denied due to security concerns (ACL-restricted).

DEPENDENT haproxy.server_tcp.dresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].dresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Response errors per second

Number of requests whose responses yielded an error.

DEPENDENT haproxy.server_tcp.eresp.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].eresp.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Unassigned requests

Current number of requests unassigned in queue.

DEPENDENT haproxy.server_tcp.qcur[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qcur.first()

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Time in queue

Average time spent in queue (in ms) for the last 1,024 requests.

DEPENDENT haproxy.server_tcp.qtime[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].qtime.first()

- MULTIPLIER: 0.001

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Redispatched requests per second

Number of times a request was redispatched to a different backend.

DEPENDENT haproxy.server_tcp.wredis.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wredis.first()

- CHANGE_PER_SECOND

HAProxy HAProxy TCP {#PXNAME} {#SVNAME}: Retried connections per second

Number of times a connection was retried.

DEPENDENT haproxy.server_tcp.wretr.rate[{#PXNAME}:{#SVNAME}]

Preprocessing:

- JSONPATH: $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].wretr.first()

- CHANGE_PER_SECOND

Zabbix_raw_items HAProxy: Get stats

HAProxy Statistics Report in CSV format

HTTP_AGENT haproxy.get

Preprocessing:

- REGEX: # ([\s\S]*)\n \1

- CSV_TO_JSON: 1

Zabbix_raw_items HAProxy: Get stats page

HAProxy Statistics Report HTML

HTTP_AGENT haproxy.get_html

Triggers

Name Description Expression Severity Dependencies and additional info
HAProxy: Version has changed (new version: {ITEM.VALUE})

HAProxy version has changed. Ack to close.

{TEMPLATE_NAME:haproxy.version.diff()}=1 and {TEMPLATE_NAME:haproxy.version.strlen()}>0 INFO

Manual close: YES

HAProxy: has been restarted (uptime < 10m)

Uptime is less than 10 minutes

{TEMPLATE_NAME:haproxy.uptime.last()}<10m INFO

Manual close: YES

HAProxy: Service is down

-

{TEMPLATE_NAME:net.tcp.service["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"].last()}=0 AVERAGE

Manual close: YES

HAProxy: Service response time is too high (over {$HAPROXY.RESPONSE_TIME.MAX.WARN} for 5m)

-

{TEMPLATE_NAME:net.tcp.service.perf["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"].min(5m)}>{$HAPROXY.RESPONSE_TIME.MAX.WARN} WARNING

Manual close: YES

Depends on:

- HAProxy: Service is down

HAProxy backend {#PXNAME}: Server is DOWN

Backend is not available.

{TEMPLATE_NAME:haproxy.backend.status[{#PXNAME}:{#SVNAME}].max(#5)}=0 AVERAGE
HAProxy backend {#PXNAME}: Average response time is more than {$HAPROXY.BACK_RTIME.MAX.WARN} for 5m

Average backend response time (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_RTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend.rtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_RTIME.MAX.WARN} WARNING
HAProxy backend {#PXNAME}: Number of responses with error is more than {$HAPROXY.BACK_ERESP.MAX.WARN} for 5m

Number of requests on backend, whose responses yielded an error, is more than {$HAPROXY.BACK_ERESP.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend.eresp.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_ERESP.MAX.WARN} WARNING
HAProxy backend {#PXNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN} for 5m

Current number of requests on backend unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend.qcur[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_QCUR.MAX.WARN} WARNING
HAProxy backend {#PXNAME}: Average time spent in queue is more than {$HAPROXY.BACK_QTIME.MAX.WARN} for 5m

Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_QTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend.qtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_QTIME.MAX.WARN} WARNING
HAProxy frontend {#PXNAME}: Session utilization is more than {$HAPROXY.FRONT_SUTIL.MAX.WARN}% for 5m

Alerting on this metric is essential to ensure your server has sufficient capacity to handle all concurrent sessions. Unlike requests, upon reaching the session limit HAProxy will deny additional clients until resource consumption drops. Furthermore, if you find your session usage percentage to be hovering above 80%, it could be time to either modify HAProxy’s configuration to allow more sessions, or migrate your HAProxy server to a bigger box.

{TEMPLATE_NAME:haproxy.frontend.sutil[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.FRONT_SUTIL.MAX.WARN} WARNING
HAProxy frontend {#PXNAME}: Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN} for 5m

Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN}.

{TEMPLATE_NAME:haproxy.frontend.ereq.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.FRONT_EREQ.MAX.WARN} WARNING
HAProxy frontend {#PXNAME}: Number of requests denied is more than {$HAPROXY.FRONT_DREQ.MAX.WARN} for 5m

Number of requests denied due to security concerns (ACL-restricted) is more than {$HAPROXY.FRONT_DREQ.MAX.WARN}.

{TEMPLATE_NAME:haproxy.frontend.dreq.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.FRONT_DREQ.MAX.WARN} WARNING
HAProxy {#PXNAME} {#SVNAME}: Server is DOWN

Server is not available.

{TEMPLATE_NAME:haproxy.server.status[{#PXNAME}:{#SVNAME}].max(#5)}=0 WARNING
HAProxy {#PXNAME} {#SVNAME}: Average response time is more than {$HAPROXY.SERVER_RTIME.MAX.WARN} for 5m

Average server response time (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_RTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server.rtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_RTIME.MAX.WARN} WARNING
HAProxy {#PXNAME} {#SVNAME}: Number of responses with error is more than {$HAPROXY.SERVER_ERESP.MAX.WARN} for 5m

Number of requests on server, whose responses yielded an error, is more than {$HAPROXY.SERVER_ERESP.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server.eresp.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_ERESP.MAX.WARN} WARNING
HAProxy {#PXNAME} {#SVNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN} for 5m

Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server.qcur[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_QCUR.MAX.WARN} WARNING
HAProxy {#PXNAME} {#SVNAME}: Average time spent in queue is more than {$HAPROXY.SERVER_QTIME.MAX.WARN} for 5m

Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_QTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server.qtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_QTIME.MAX.WARN} WARNING
HAProxy TCP Backend {#PXNAME}: Server is DOWN

Backend is not available.

{TEMPLATE_NAME:haproxy.backend_tcp.status[{#PXNAME}:{#SVNAME}].max(#5)}=0 AVERAGE
HAProxy TCP Backend {#PXNAME}: Average response time is more than {$HAPROXY.BACK_RTIME.MAX.WARN} for 5m

Average backend response time (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_RTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend_tcp.rtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_RTIME.MAX.WARN} WARNING
HAProxy TCP Backend {#PXNAME}: Number of responses with error is more than {$HAPROXY.BACK_ERESP.MAX.WARN} for 5m

Number of requests on backend, whose responses yielded an error, is more than {$HAPROXY.BACK_ERESP.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend_tcp.eresp.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_ERESP.MAX.WARN} WARNING
HAProxy TCP Backend {#PXNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN} for 5m

Current number of requests on backend unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend_tcp.qcur[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_QCUR.MAX.WARN} WARNING
HAProxy TCP Backend {#PXNAME}: Average time spent in queue is more than {$HAPROXY.BACK_QTIME.MAX.WARN} for 5m

Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_QTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.backend_tcp.qtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.BACK_QTIME.MAX.WARN} WARNING
HAProxy TCP Frontend {#PXNAME}: Session utilization is more than {$HAPROXY.FRONT_SUTIL.MAX.WARN}% for 5m

Alerting on this metric is essential to ensure your server has sufficient capacity to handle all concurrent sessions. Unlike requests, upon reaching the session limit HAProxy will deny additional clients until resource consumption drops. Furthermore, if you find your session usage percentage to be hovering above 80%, it could be time to either modify HAProxy’s configuration to allow more sessions, or migrate your HAProxy server to a bigger box.

{TEMPLATE_NAME:haproxy.frontend_tcp.sutil[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.FRONT_SUTIL.MAX.WARN} WARNING
HAProxy TCP Frontend {#PXNAME}: Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN} for 5m

Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN}.

{TEMPLATE_NAME:haproxy.frontend_tcp.ereq.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.FRONT_EREQ.MAX.WARN} WARNING
HAProxy TCP Frontend {#PXNAME}: Number of requests denied is more than {$HAPROXY.FRONT_DREQ.MAX.WARN} for 5m

Number of requests denied due to security concerns (ACL-restricted) is more than {$HAPROXY.FRONT_DREQ.MAX.WARN}.

{TEMPLATE_NAME:haproxy.frontend_tcp.dreq.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.FRONT_DREQ.MAX.WARN} WARNING
HAProxy TCP {#PXNAME} {#SVNAME}: Server is DOWN

Server is not available.

{TEMPLATE_NAME:haproxy.server_tcp.status[{#PXNAME}:{#SVNAME}].max(#5)}=0 WARNING
HAProxy TCP {#PXNAME} {#SVNAME}: Average response time is more than {$HAPROXY.SERVER_RTIME.MAX.WARN} for 5m

Average server response time (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_RTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server_tcp.rtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_RTIME.MAX.WARN} WARNING
HAProxy TCP {#PXNAME} {#SVNAME}: Number of responses with error is more than {$HAPROXY.SERVER_ERESP.MAX.WARN} for 5m

Number of requests on server, whose responses yielded an error, is more than {$HAPROXY.SERVER_ERESP.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server_tcp.eresp.rate[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_ERESP.MAX.WARN} WARNING
HAProxy TCP {#PXNAME} {#SVNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN} for 5m

Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server_tcp.qcur[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_QCUR.MAX.WARN} WARNING
HAProxy TCP {#PXNAME} {#SVNAME}: Average time spent in queue is more than {$HAPROXY.SERVER_QTIME.MAX.WARN} for 5m

Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_QTIME.MAX.WARN}.

{TEMPLATE_NAME:haproxy.server_tcp.qtime[{#PXNAME}:{#SVNAME}].min(5m)}>{$HAPROXY.SERVER_QTIME.MAX.WARN} WARNING

Feedback

Please report any issues with the template at https://support.zabbix.com

You can also provide feedback, discuss the template or ask for help with it at ZABBIX forums.

Add your solution