Aller au contenu principal

template-haproxy

Ce template est un fichier de configuration pour Zabbix, un outil de surveillance de réseau et d'infrastructure. Il est spécifiquement conçu pour surveiller HAProxy, un logiciel de répartition de charge (load balancer) et de proxy. Voici une explication détaillée de ce que fait ce template :

{
"zabbix_export": {
"version": "7.2",
"template_groups": [
{
"uuid": "a571c0d144b14fd4a87a9d9b2aa9fcd6",
"name": "Templates/Applications"
}
],
"templates": [
{
"uuid": "812073bf8df143bcae2a84b32c3965e5",
"template": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"description": "Le modèle pour surveiller HAProxy par Zabbix qui fonctionne sans scripts externes. La plupart des métriques sont collectées en une seule fois, grâce à la collecte de données en vrac de Zabbix. Le modèle collecte des métriques en interrogeant la page de statistiques de HAProxy avec l'agent Zabbix. Notez que ce modèle ne supporte pas l'authentification et les redirections (limitations de 'web.page.get'). Configuration : 1. Configurez la page de statistiques HAProxy : https://www.haproxy.com/blog/exploring-the-haproxy-stats-page/ L'exemple de configuration de HAProxy : frontend stats bind *:8404 stats enable stats uri /stats stats refresh 10s 2. Définissez le nom d'hôte ou l'adresse IP de l'hôte ou du conteneur de statistiques HAProxy dans la macro '{$HAPROXY.STATS.HOST}'. Vous pouvez également modifier le port de la page d'état dans la macro '{$HAPROXY.STATS.PORT}', le schéma de la page d'état dans la macro '{$HAPROXY.STATS.SCHEME}' et le chemin de la page d'état dans la macro '{$HAPROXY.STATS.PATH}' si nécessaire. Vous pouvez discuter de ce modèle ou laisser des commentaires sur notre forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/393527-discussion-thread-for-official-zabbix-template-haproxy Généré par l'outil officiel de création de modèles Zabbix 'Templator'",
"vendor": {
"name": "Zabbix",
"version": "7.2-1"
},
"groups": [
{
"name": "Templates/Applications"
}
],
"items": [
{
"uuid": "ca85e2fda99b42a4ad2b373211a6b07d",
"name": "Get nodes",
"type": "DEPENDENT",
"key": "haproxy.get.nodes",
"history": "0",
"value_type": "TEXT",
"description": "Array for LLD rules.",
"preprocessing": [
{
"type": "JAVASCRIPT",
"parameters": [
"return JSON.stringify(JSON.parse(value),['mode','pxname','svname'])"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv\"]"
},
"tags": [
{
"tag": "component",
"value": "raw"
}
]
},
{
"uuid": "29381f1e0bdc4628a82ef1b7724f2e6f",
"name": "Uptime",
"type": "DEPENDENT",
"key": "haproxy.uptime",
"value_type": "FLOAT",
"units": "s",
"preprocessing": [
{
"type": "JAVASCRIPT",
"parameters": [
"try {\n\tvar t = value.match(/(\\d+)d (\\d+)h(\\d+)m(\\d+)s/);\n\treturn t[1] * 86400 + t[2] * 3600 + t[3] * 60 + t[4] * 1;\n}\ncatch (error) {\n\tthrow \"HAProxy uptime is not found : \" + error;\n}"
]
}
],
"master_item": {
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "application"
}
],
"triggers": [
{
"uuid": "e76d5b82b0ad421ea62cd1dc069e036b",
"expression": "last(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.uptime)<10m",
"name": "HAProxy: has been restarted",
"event_name": "HAProxy: has been restarted (uptime < 10m)",
"priority": "INFO",
"description": "Uptime is less than 10 minutes.",
"manual_close": "YES",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "e930e70fb1b44d9cbe673f35133c6e77",
"name": "Version",
"type": "DEPENDENT",
"key": "haproxy.version",
"value_type": "CHAR",
"preprocessing": [
{
"type": "REGEX",
"parameters": [
"HAProxy version ([^,]*),",
"\\1"
],
"error_handler": "CUSTOM_ERROR",
"error_handler_params": "HAProxy version is not found"
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1d"
]
}
],
"master_item": {
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH}\"]"
},
"tags": [
{
"tag": "component",
"value": "application"
}
],
"triggers": [
{
"uuid": "db6ef8f306f64f0f81a590e4b45b370c",
"expression": "last(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.version,#1)<>last(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.version,#2) and length(last(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.version))>0",
"name": "HAProxy: Version has changed",
"event_name": "HAProxy: Version has changed (new version: {ITEM.VALUE})",
"priority": "INFO",
"description": "HAProxy version has changed. Acknowledge to close the problem manually.",
"manual_close": "YES",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "c224cfe9b7474f9e80618dde78cfcb11",
"name": "Service response time",
"key": "net.tcp.service.perf[\"{$HAPROXY.STATS.SCHEME}\",\"{$HAPROXY.STATS.HOST}\",\"{$HAPROXY.STATS.PORT}\"]",
"value_type": "FLOAT",
"units": "s",
"tags": [
{
"tag": "component",
"value": "health"
},
{
"tag": "component",
"value": "network"
}
],
"triggers": [
{
"uuid": "4e881047bbd54c5984922d1189567ece",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/net.tcp.service.perf[\"{$HAPROXY.STATS.SCHEME}\",\"{$HAPROXY.STATS.HOST}\",\"{$HAPROXY.STATS.PORT}\"],5m)>{$HAPROXY.RESPONSE_TIME.MAX.WARN}",
"name": "HAProxy: Service response time is too high",
"event_name": "HAProxy: Service response time is too high (over {$HAPROXY.RESPONSE_TIME.MAX.WARN} for 5m)",
"priority": "WARNING",
"manual_close": "YES",
"dependencies": [
{
"name": "HAProxy: Service is down",
"expression": "last(/TPL_HAProxy_by_zabbix_agent_MEKOO/net.tcp.service[\"{$HAPROXY.STATS.SCHEME}\",\"{$HAPROXY.STATS.HOST}\",\"{$HAPROXY.STATS.PORT}\"])=0"
}
],
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
]
},
{
"uuid": "97e45c508f5a4df78fc783382088e233",
"name": "Service status",
"key": "net.tcp.service[\"{$HAPROXY.STATS.SCHEME}\",\"{$HAPROXY.STATS.HOST}\",\"{$HAPROXY.STATS.PORT}\"]",
"valuemap": {
"name": "Service state"
},
"preprocessing": [
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"10m"
]
}
],
"tags": [
{
"tag": "component",
"value": "health"
},
{
"tag": "component",
"value": "network"
}
],
"triggers": [
{
"uuid": "8d5c7940e5924b469b3e7804043ea7b6",
"expression": "last(/TPL_HAProxy_by_zabbix_agent_MEKOO/net.tcp.service[\"{$HAPROXY.STATS.SCHEME}\",\"{$HAPROXY.STATS.HOST}\",\"{$HAPROXY.STATS.PORT}\"])=0",
"name": "HAProxy: Service is down",
"priority": "AVERAGE",
"manual_close": "YES",
"tags": [
{
"tag": "scope",
"value": "availability"
}
]
}
]
},
{
"uuid": "e70009bd4e3041a3952738673ebb5c29",
"name": "Get stats page",
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH}\"]",
"history": "0",
"value_type": "TEXT",
"description": "HAProxy Statistics Report HTML",
"tags": [
{
"tag": "component",
"value": "raw"
}
]
},
{
"uuid": "aabdb5706b6744379561f269e0709141",
"name": "Get stats",
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv\"]",
"history": "0",
"value_type": "TEXT",
"description": "HAProxy Statistics Report in CSV format",
"preprocessing": [
{
"type": "REGEX",
"parameters": [
"# ([\\s\\S]*)",
"\\1"
]
},
{
"type": "CSV_TO_JSON",
"parameters": [
"",
"",
"1"
]
}
],
"tags": [
{
"tag": "component",
"value": "raw"
}
]
}
],
"discovery_rules": [
{
"uuid": "9899f0a11ece4b9194ca44a8fc34b066",
"name": "Backend discovery",
"type": "DEPENDENT",
"key": "haproxy.backend.discovery",
"filter": {
"evaltype": "AND",
"conditions": [
{
"macro": "{#MODE}",
"value": "http|tcp"
},
{
"macro": "{#SVNAME}",
"value": "BACKEND"
}
]
},
"description": "Discovery backends",
"item_prototypes": [
{
"uuid": "1ee660a3cfbd4e76a20a32524cdb707f",
"name": "Backend {#PXNAME}: Number of active servers",
"type": "DEPENDENT",
"key": "haproxy.backend.act[{#PXNAME},{#SVNAME}]",
"description": "Number of active servers.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.act"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "servers"
}
]
},
{
"uuid": "6c4b8a679428455aadbd307162635e6e",
"name": "Backend {#PXNAME}: Number of backup servers",
"type": "DEPENDENT",
"key": "haproxy.backend.bck[{#PXNAME},{#SVNAME}]",
"description": "Number of backup servers.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bck"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "servers"
}
]
},
{
"uuid": "7d5a7b04e836417b96f2301d91fabab4",
"name": "Backend {#PXNAME}: Incoming traffic",
"type": "DEPENDENT",
"key": "haproxy.backend.bin.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "bps",
"description": "Number of bits received by the backend",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bin"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"8"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "network"
}
]
},
{
"uuid": "fc353e7b680648698ecf949f784ca0ce",
"name": "Backend {#PXNAME}: Outgoing traffic",
"type": "DEPENDENT",
"key": "haproxy.backend.bout.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "bps",
"description": "Number of bits sent by the backend",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bout"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"8"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "network"
}
]
},
{
"uuid": "3df452e68f144fc3a8e5ff7644ace606",
"name": "Backend {#PXNAME}: Responses denied per second",
"type": "DEPENDENT",
"key": "haproxy.backend.dresp.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Responses denied due to security concerns (ACL-restricted).",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.dresp"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
]
},
{
"uuid": "5e315f24828d45b285e92971d5456234",
"name": "Backend {#PXNAME}: Errors connection per second",
"type": "DEPENDENT",
"key": "haproxy.backend.econ.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of requests that encountered an error attempting to connect to a backend server.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.econ"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "connections"
}
]
},
{
"uuid": "f1ca728c571e4cf4ac9ebc36e96df27e",
"name": "Backend {#PXNAME}: Response errors per second",
"type": "DEPENDENT",
"key": "haproxy.backend.eresp.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of requests whose responses yielded an error",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.eresp"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
],
"trigger_prototypes": [
{
"uuid": "892d6f67eeff4520aadbf4f3841f8174",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.backend.eresp.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_ERESP.MAX.WARN}",
"name": "HAProxy: backend {#PXNAME}: Number of responses with error is high",
"event_name": "HAProxy: backend {#PXNAME}: Number of responses with error is more than {$HAPROXY.BACK_ERESP.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Number of requests on backend, whose responses yielded an error, is more than {$HAPROXY.BACK_ERESP.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "a32d07355a9c4e9f9f63bac4ef2ef342",
"name": "Backend {#PXNAME}: Number of responses with codes 1xx per second",
"type": "DEPENDENT",
"key": "haproxy.backend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of informational HTTP responses per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_1xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
]
},
{
"uuid": "2b02a86c01a245859ad4305d25569ab0",
"name": "Backend {#PXNAME}: Number of responses with codes 2xx per second",
"type": "DEPENDENT",
"key": "haproxy.backend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of successful HTTP responses per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_2xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
]
},
{
"uuid": "24de211953f8480c9e1118abde731344",
"name": "Backend {#PXNAME}: Number of responses with codes 3xx per second",
"type": "DEPENDENT",
"key": "haproxy.backend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP redirections per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_3xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
]
},
{
"uuid": "221ef133420f4140a17146eb976744eb",
"name": "Backend {#PXNAME}: Number of responses with codes 4xx per second",
"type": "DEPENDENT",
"key": "haproxy.backend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP client errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_4xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
]
},
{
"uuid": "3a3f40a93c184673bdbd220add5ef458",
"name": "Backend {#PXNAME}: Number of responses with codes 5xx per second",
"type": "DEPENDENT",
"key": "haproxy.backend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP server errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_5xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
]
},
{
"uuid": "389e5f77b422419386c2fa21db612697",
"name": "Backend {#PXNAME}: Unassigned requests",
"type": "DEPENDENT",
"key": "haproxy.backend.qcur[{#PXNAME},{#SVNAME}]",
"description": "Current number of requests unassigned in queue.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.qcur"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "requests"
}
],
"trigger_prototypes": [
{
"uuid": "89ccc4b4a55349c7869c2202881dcb2a",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.backend.qcur[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_QCUR.MAX.WARN}",
"name": "HAProxy: backend {#PXNAME}: Current number of requests unassigned in queue is high",
"event_name": "HAProxy: backend {#PXNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Current number of requests on backend unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "a58ff94387824acb81b27cab5cfc680a",
"name": "Backend {#PXNAME}: Time in queue",
"type": "DEPENDENT",
"key": "haproxy.backend.qtime[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "s",
"description": "Average time spent in queue (in ms) for the last 1,024 requests",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.qtime"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"0.001"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "requests"
}
],
"trigger_prototypes": [
{
"uuid": "1aff4be13f0f4aee8a512d4b962215a6",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.backend.qtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_QTIME.MAX.WARN}",
"name": "HAProxy: backend {#PXNAME}: Average time spent in queue is high",
"event_name": "HAProxy: backend {#PXNAME}: Average time spent in queue is more than {$HAPROXY.BACK_QTIME.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_QTIME.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
]
},
{
"uuid": "109438f053a24866a8c001c2260f1c37",
"name": "Backend {#PXNAME}: Raw data",
"type": "DEPENDENT",
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]",
"history": "0",
"value_type": "TEXT",
"description": "The raw data of the Backend with the name `{#PXNAME}`",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].first()"
]
}
],
"master_item": {
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv\"]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "raw"
}
]
},
{
"uuid": "7e801fd81fed448db7dd6c6eeaa398d5",
"name": "Backend {#PXNAME}: Responses time",
"type": "DEPENDENT",
"key": "haproxy.backend.rtime[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "s",
"description": "Average backend response time (in ms) for the last 1,024 requests",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.rtime"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"0.001"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "responses"
}
],
"trigger_prototypes": [
{
"uuid": "e0dd27ac272a4fbf9495c09f3291db8f",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.backend.rtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_RTIME.MAX.WARN}",
"name": "HAProxy: backend {#PXNAME}: Average response time is high",
"event_name": "HAProxy: backend {#PXNAME}: Average response time is more than {$HAPROXY.BACK_RTIME.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Average backend response time (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_RTIME.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
]
},
{
"uuid": "5826a63314314ef297c81749561574d2",
"name": "Backend {#PXNAME}: Status",
"type": "DEPENDENT",
"key": "haproxy.backend.status[{#PXNAME},{#SVNAME}]",
"value_type": "CHAR",
"description": "Possible values:\nUP - The server is reporting as healthy.\nDOWN - The server is reporting as unhealthy and unable to receive requests.\nNOLB - You've added http-check disable-on-404 to the backend and the health checked URL has returned an HTTP 404 response.\nMAINT - The server has been disabled or put into maintenance mode.\nDRAIN - The server has been put into drain mode.\nno check - Health checks are not enabled for this server.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.status"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"10m"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "health"
}
],
"trigger_prototypes": [
{
"uuid": "51452fd94c12448fab0703e867f69fd2",
"expression": "count(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.backend.status[{#PXNAME},{#SVNAME}],#5,\"eq\",\"DOWN\")=5",
"name": "HAProxy: backend {#PXNAME}: Server is DOWN",
"opdata": "Current value: {ITEM.LASTVALUE1}",
"priority": "AVERAGE",
"description": "Backend is not available.",
"tags": [
{
"tag": "scope",
"value": "availability"
}
]
}
]
},
{
"uuid": "d11c9b4c7027475e897456e712675cc9",
"name": "Backend {#PXNAME}: Sessions per second",
"type": "DEPENDENT",
"key": "haproxy.backend.stot.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Cumulative number of sessions (end-to-end connections) per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.stot"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "sessions"
}
]
},
{
"uuid": "21cc9c7a1b7042f0bb14eeab91464ae8",
"name": "Backend {#PXNAME}: Weight",
"type": "DEPENDENT",
"key": "haproxy.backend.weight[{#PXNAME},{#SVNAME}]",
"description": "Total effective weight.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.weight"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "balancer"
}
]
},
{
"uuid": "bebad9eb0731474db798eacde7771238",
"name": "Backend {#PXNAME}: Redispatched requests per second",
"type": "DEPENDENT",
"key": "haproxy.backend.wredis.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of times a request was redispatched to a different backend.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.wredis"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "requests"
}
]
},
{
"uuid": "0f09a6b800d747f4beed96a25b5cfa49",
"name": "Backend {#PXNAME}: Retried connections per second",
"type": "DEPENDENT",
"key": "haproxy.backend.wretr.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of times a connection was retried.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.wretr"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.backend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "backend",
"value": "{#PXNAME}"
},
{
"tag": "component",
"value": "connections"
}
]
}
],
"graph_prototypes": [
{
"uuid": "70bf1a17304e495dae74b86b93ac9773",
"name": "HAProxy: Backend {#PXNAME} In/Out traffic",
"graph_items": [
{
"drawtype": "GRADIENT_LINE",
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.bin.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"drawtype": "GRADIENT_LINE",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.bout.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "a8518997e8ce40339f5d2384a011f3ba",
"name": "HAProxy: Backend {#PXNAME} Redispatched requests and retried connections per second",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.wredis.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.wretr.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "50d592985cd74d0a95904971dc40767d",
"name": "HAProxy: Backend {#PXNAME} Responses by HTTP code",
"type": "STACKED",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "2",
"color": "00611C",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "3",
"color": "F7941D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "4",
"color": "FC6EA3",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.backend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]"
}
}
]
}
],
"master_item": {
"key": "haproxy.get.nodes"
},
"lld_macro_paths": [
{
"lld_macro": "{#MODE}",
"path": "$.mode"
},
{
"lld_macro": "{#PXNAME}",
"path": "$.pxname"
},
{
"lld_macro": "{#SVNAME}",
"path": "$.svname"
}
],
"overrides": [
{
"name": "Discard HTTP status codes",
"step": "1",
"filter": {
"conditions": [
{
"macro": "{#MODE}",
"value": "tcp"
}
]
},
"operations": [
{
"operator": "LIKE",
"value": "Number of responses with codes",
"discover": "NO_DISCOVER",
"status": "ENABLED"
}
]
}
]
},
{
"uuid": "69264415d8644ef597affd3dc95d42b2",
"name": "Frontend discovery",
"type": "DEPENDENT",
"key": "haproxy.frontend.discovery",
"filter": {
"evaltype": "AND",
"conditions": [
{
"macro": "{#MODE}",
"value": "http|tcp"
},
{
"macro": "{#SVNAME}",
"value": "FRONTEND"
}
]
},
"description": "Discovery frontends",
"item_prototypes": [
{
"uuid": "434f9c1dd63946d3a181c42bcee94e07",
"name": "Frontend {#PXNAME}: Incoming traffic",
"type": "DEPENDENT",
"key": "haproxy.frontend.bin.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "bps",
"description": "Number of bits received by the frontend",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bin"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"8"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "network"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "047ec4b444af4bc38f74eb7fabf2fb94",
"name": "Frontend {#PXNAME}: Outgoing traffic",
"type": "DEPENDENT",
"key": "haproxy.frontend.bout.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "bps",
"description": "Number of bits sent by the frontend",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bout"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"8"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "network"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "4542ee3da6334468b6a146083bfa1208",
"name": "Frontend {#PXNAME}: Denied requests per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.dreq.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Requests denied due to security concerns (ACL-restricted) per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.dreq"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "requests"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "269d5e491e3d41b6be5257c8a8a85efb",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.frontend.dreq.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.FRONT_DREQ.MAX.WARN}",
"name": "HAProxy: frontend {#PXNAME}: Number of requests denied is high",
"event_name": "HAProxy: frontend {#PXNAME}: Number of requests denied is more than {$HAPROXY.FRONT_DREQ.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Number of requests denied due to security concerns (ACL-restricted) is more than {$HAPROXY.FRONT_DREQ.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "2da48ea7b7fb4432b041b9706017778e",
"name": "Frontend {#PXNAME}: Request errors per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.ereq.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of request errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.ereq"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "requests"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "8361fb028aed4bd9bf3356249699d424",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.frontend.ereq.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.FRONT_EREQ.MAX.WARN}",
"name": "HAProxy: frontend {#PXNAME}: Number of request errors is high",
"event_name": "HAProxy: frontend {#PXNAME}: Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "d4d6d7092c524a4aa9ac83f9506fcb44",
"name": "Frontend {#PXNAME}: Number of responses with codes 1xx per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of informational HTTP responses per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_1xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "34bb4142cb4c48678f1136ed7a582ff7",
"name": "Frontend {#PXNAME}: Number of responses with codes 2xx per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of successful HTTP responses per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_2xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "3d6966759c864b0d94daceead022e421",
"name": "Frontend {#PXNAME}: Number of responses with codes 3xx per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP redirections per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_3xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "3fe3871812254cf0a228b6607f02ea12",
"name": "Frontend {#PXNAME}: Number of responses with codes 4xx per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP client errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_4xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "85d7aa81598b48ee9d40ce3e5b7fc7ea",
"name": "Frontend {#PXNAME}: Number of responses with codes 5xx per second",
"type": "DEPENDENT",
"key": "haproxy.frontend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP server errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_5xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "24ee024f493e47f4b4405bc469976c8e",
"name": "Frontend {#PXNAME}: Sessions rate",
"type": "DEPENDENT",
"key": "haproxy.frontend.rate[{#PXNAME},{#SVNAME}]",
"description": "Number of sessions created per second",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.rate"
]
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "sessions"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "8cac0a6b219e49c2ae1fd61e78be4ee0",
"name": "Frontend {#PXNAME}: Raw data",
"type": "DEPENDENT",
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]",
"history": "0",
"value_type": "TEXT",
"description": "The raw data of the Frontend with the name `{#PXNAME}`",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].first()"
]
}
],
"master_item": {
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv\"]"
},
"tags": [
{
"tag": "component",
"value": "raw"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "2290bc0944774d54a89d5b6195f81ad4",
"name": "Frontend {#PXNAME}: Requests rate",
"type": "DEPENDENT",
"key": "haproxy.frontend.req_rate[{#PXNAME},{#SVNAME}]",
"description": "HTTP requests per second",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.req_rate"
]
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "requests"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "b01d1b02b9da4609acaa278cf5f2ebbd",
"name": "Frontend {#PXNAME}: Established sessions",
"type": "DEPENDENT",
"key": "haproxy.frontend.scur[{#PXNAME},{#SVNAME}]",
"description": "The current number of established sessions.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.scur"
]
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "sessions"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "4ed338fd24e14aeda1f6058a36371455",
"name": "Frontend {#PXNAME}: Session limits",
"type": "DEPENDENT",
"key": "haproxy.frontend.slim[{#PXNAME},{#SVNAME}]",
"description": "The most simultaneous sessions that are allowed, as defined by the maxconn setting in the frontend.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.slim"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "sessions"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "5a48a087c07c4cbbaf0332930d59244b",
"name": "Frontend {#PXNAME}: Status",
"type": "DEPENDENT",
"key": "haproxy.frontend.status[{#PXNAME},{#SVNAME}]",
"value_type": "CHAR",
"description": "Possible values: OPEN, STOP.\nWhen Status is OPEN, the frontend is operating normally and ready to receive traffic.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.status"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"6h"
]
}
],
"master_item": {
"key": "haproxy.frontend.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "health"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
]
},
{
"uuid": "4aedda0904954ade92a4aad6460d759b",
"name": "Frontend {#PXNAME}: Session utilization",
"type": "CALCULATED",
"key": "haproxy.frontend.sutil[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "%",
"params": "last(//haproxy.frontend.scur[{#PXNAME},{#SVNAME}]) / last(//haproxy.frontend.slim[{#PXNAME},{#SVNAME}]) * 100",
"description": "Percentage of sessions used (scur / slim * 100).",
"tags": [
{
"tag": "component",
"value": "sessions"
},
{
"tag": "frontend",
"value": "{#PXNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "9af44a07b1a347979492063ee756b025",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.frontend.sutil[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.FRONT_SUTIL.MAX.WARN}",
"name": "HAProxy: frontend {#PXNAME}: Session utilization is high",
"event_name": "HAProxy: frontend {#PXNAME}: Session utilization is more than {$HAPROXY.FRONT_SUTIL.MAX.WARN}% for 5m",
"priority": "WARNING",
"description": "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.",
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
]
}
],
"graph_prototypes": [
{
"uuid": "30141ef1c5bf4c4a9cca0f8ce2ea3373",
"name": "HAProxy: Frontend {#PXNAME} Errors and denials per second",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.ereq.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.dreq.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "f6a6bb900b4e45c9af863e6e0aa9af8a",
"name": "HAProxy: Frontend {#PXNAME} In/Out traffic",
"graph_items": [
{
"drawtype": "GRADIENT_LINE",
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.bin.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"drawtype": "GRADIENT_LINE",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.bout.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "065d1ef09a404cf1bcc67f0e987482ab",
"name": "HAProxy: Frontend {#PXNAME} Requests and sessions per second",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.req_rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "3ce6177d02a045219cec0d348b970860",
"name": "HAProxy: Frontend {#PXNAME} Responses by HTTP code",
"type": "STACKED",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "2",
"color": "00611C",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "3",
"color": "F7941D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "4",
"color": "FC6EA3",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.frontend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]"
}
}
]
}
],
"master_item": {
"key": "haproxy.get.nodes"
},
"lld_macro_paths": [
{
"lld_macro": "{#MODE}",
"path": "$.mode"
},
{
"lld_macro": "{#PXNAME}",
"path": "$.pxname"
},
{
"lld_macro": "{#SVNAME}",
"path": "$.svname"
}
],
"overrides": [
{
"name": "Discard HTTP status codes",
"step": "1",
"filter": {
"conditions": [
{
"macro": "{#MODE}",
"value": "tcp"
}
]
},
"operations": [
{
"operator": "LIKE",
"value": "Number of responses with codes",
"discover": "NO_DISCOVER",
"status": "ENABLED"
}
]
}
]
},
{
"uuid": "a2f7f79b8f094afd93648f62f99d3369",
"name": "Server discovery",
"type": "DEPENDENT",
"key": "haproxy.server.discovery",
"filter": {
"evaltype": "AND",
"conditions": [
{
"macro": "{#MODE}",
"value": "http|tcp"
},
{
"macro": "{#SVNAME}",
"value": "FRONTEND|BACKEND",
"operator": "NOT_MATCHES_REGEX"
}
]
},
"description": "Discovery servers",
"item_prototypes": [
{
"uuid": "82b1f8a01ba04818a990c336eb7154e3",
"name": "{#PXNAME} {#SVNAME}: Server is active",
"type": "DEPENDENT",
"key": "haproxy.server.act[{#PXNAME},{#SVNAME}]",
"description": "Shows whether the server is active (marked with a Y) or a backup (marked with a -).",
"valuemap": {
"name": "Server mode"
},
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.act"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "role"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "3617492e9cfd49b6b5576ed231dc2614",
"name": "{#PXNAME} {#SVNAME}: Server is backup",
"type": "DEPENDENT",
"key": "haproxy.server.bck[{#PXNAME},{#SVNAME}]",
"description": "Shows whether the server is a backup (marked with a Y) or active (marked with a -).",
"valuemap": {
"name": "Server mode"
},
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bck"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "role"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "20d5a69a9aa24fc6abf21c1c317ac425",
"name": "{#PXNAME} {#SVNAME}: Incoming traffic",
"type": "DEPENDENT",
"key": "haproxy.server.bin.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "bps",
"description": "Number of bits received by the backend",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bin"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"8"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "network"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "7fbc335144b74c08ba6a79a108e8e894",
"name": "{#PXNAME} {#SVNAME}: Outgoing traffic",
"type": "DEPENDENT",
"key": "haproxy.server.bout.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "bps",
"description": "Number of bits sent by the backend",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.bout"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"8"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "network"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "c46228518a3a460b894aea999ca0feab",
"name": "{#PXNAME} {#SVNAME}: Status of last health check",
"type": "DEPENDENT",
"key": "haproxy.server.check_status[{#PXNAME},{#SVNAME}]",
"value_type": "CHAR",
"description": "Status of last health check, one of:\nUNK -> unknown\nINI -> initializing\nSOCKERR -> socket error\nL4OK -> check passed on layer 4, no upper layers testing enabled\nL4TOUT -> layer 1-4 timeout\nL4CON -> layer 1-4 connection problem, for example \"Connection refused\" (tcp rst) or \"No route to host\" (icmp)\nL6OK -> check passed on layer 6\nL6TOUT -> layer 6 (SSL) timeout\nL6RSP -> layer 6 invalid response - protocol error\nL7OK -> check passed on layer 7\nL7OKC -> check conditionally passed on layer 7, for example 404 with disable-on-404\nL7TOUT -> layer 7 (HTTP/SMTP) timeout\nL7RSP -> layer 7 invalid response - protocol error\nL7STS -> layer 7 response error, for example HTTP 5xx\nNotice: If a check is currently running, the last known status will be reported, prefixed with \"* \". e. g. \"* L7OK\".",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.check_status"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"10m"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "health"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "1378f45ad65a498aae7b571a69547352",
"expression": "find(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.check_status[{#PXNAME},{#SVNAME}],#3,\"regexp\",\"(?:L[4-7]OK|^$)\")=0",
"name": "HAProxy: {#PXNAME} {#SVNAME}: Health check error",
"opdata": "Current value: {ITEM.LASTVALUE1}",
"priority": "WARNING",
"description": "Please check the server for faults.",
"dependencies": [
{
"name": "HAProxy: {#PXNAME} {#SVNAME}: Server is DOWN",
"expression": "count(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.status[{#PXNAME},{#SVNAME}],#5,\"eq\",\"DOWN\")=5"
}
],
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "537f0b807f784b6cba1032ff77fad499",
"name": "{#PXNAME} {#SVNAME}: Responses denied per second",
"type": "DEPENDENT",
"key": "haproxy.server.dresp.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Responses denied due to security concerns (ACL-restricted).",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.dresp"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "f688e1e62fa94d1db1d59735094f0bc4",
"name": "{#PXNAME} {#SVNAME}: Errors connection per second",
"type": "DEPENDENT",
"key": "haproxy.server.econ.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of requests that encountered an error attempting to connect to a backend server.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.econ"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "connections"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "bdcac24a8b1e4dd5a441edb61ca13156",
"name": "{#PXNAME} {#SVNAME}: Response errors per second",
"type": "DEPENDENT",
"key": "haproxy.server.eresp.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of requests whose responses yielded an error.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.eresp"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "5a982a97f812468eb8e7163f06f0ee77",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.eresp.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_ERESP.MAX.WARN}",
"name": "HAProxy: {#PXNAME} {#SVNAME}: Number of responses with error is high",
"event_name": "HAProxy: {#PXNAME} {#SVNAME}: Number of responses with error is more than {$HAPROXY.SERVER_ERESP.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Number of requests on server, whose responses yielded an error, is more than {$HAPROXY.SERVER_ERESP.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "71fbb982c23c498fb52b68b3f839c642",
"name": "{#PXNAME} {#SVNAME}: Number of responses with codes 1xx per second",
"type": "DEPENDENT",
"key": "haproxy.server.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of informational HTTP responses per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_1xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "a1aa6301ea1445bdbc509ec31cc9ebfc",
"name": "{#PXNAME} {#SVNAME}: Number of responses with codes 2xx per second",
"type": "DEPENDENT",
"key": "haproxy.server.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of successful HTTP responses per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_2xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "5b5576604886429ca22db333c9886c25",
"name": "{#PXNAME} {#SVNAME}: Number of responses with codes 3xx per second",
"type": "DEPENDENT",
"key": "haproxy.server.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP redirections per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_3xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "3af9ae3041bb4cd588cc6048370d9be7",
"name": "{#PXNAME} {#SVNAME}: Number of responses with codes 4xx per second",
"type": "DEPENDENT",
"key": "haproxy.server.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP client errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_4xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "9f2f6e181dca47ab8e1ae9064ab9fe15",
"name": "{#PXNAME} {#SVNAME}: Number of responses with codes 5xx per second",
"type": "DEPENDENT",
"key": "haproxy.server.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of HTTP server errors per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.hrsp_5xx"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "responses"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "8a7257e803b84783a8c9964807a336a5",
"name": "{#PXNAME} {#SVNAME}: Server was selected per second",
"type": "DEPENDENT",
"key": "haproxy.server.lbtot.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of times that server was selected.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.lbtot"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "connections"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "03c6d54204104fa0a320ff76204fc825",
"name": "{#PXNAME} {#SVNAME}: Unassigned requests",
"type": "DEPENDENT",
"key": "haproxy.server.qcur[{#PXNAME},{#SVNAME}]",
"description": "Current number of requests unassigned in queue.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.qcur"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "requests"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "b88e0b4baa2e4738a161a7fc437d6e1c",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.qcur[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_QCUR.MAX.WARN}",
"name": "HAProxy: {#PXNAME} {#SVNAME}: Current number of requests unassigned in queue is high",
"event_name": "HAProxy: {#PXNAME} {#SVNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "notice"
}
]
}
]
},
{
"uuid": "50a837b40d624492b0248324d8b62694",
"name": "{#PXNAME} {#SVNAME}: Configured maxqueue",
"type": "DEPENDENT",
"key": "haproxy.server.qlimit[{#PXNAME},{#SVNAME}]",
"description": "Configured maxqueue for the server, or nothing in the value is 0 (default, meaning no limit).",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.qlimit"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"6h"
]
},
{
"type": "MATCHES_REGEX",
"parameters": [
"^\\d+$"
],
"error_handler": "CUSTOM_VALUE",
"error_handler_params": "0"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "queues"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "58c074ebc26145a6847d425d51f7cbca",
"name": "{#PXNAME} {#SVNAME}: Time in queue",
"type": "DEPENDENT",
"key": "haproxy.server.qtime[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "s",
"description": "Average time spent in queue (in ms) for the last 1,024 requests.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.qtime"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"0.001"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "requests"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "abf3d9e3f6fa43d8bf722bcc58c37388",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.qtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_QTIME.MAX.WARN}",
"name": "HAProxy: {#PXNAME} {#SVNAME}: Average time spent in queue is high",
"event_name": "HAProxy: {#PXNAME} {#SVNAME}: Average time spent in queue is more than {$HAPROXY.SERVER_QTIME.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_QTIME.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
]
},
{
"uuid": "3db97a60d637466bb7038dd08b9f5c7e",
"name": "Server {#PXNAME} {#SVNAME}: Raw data",
"type": "DEPENDENT",
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]",
"history": "0",
"value_type": "TEXT",
"description": "The raw data of the Server named `{#SVNAME}` and the proxy with the name `{#PXNAME}`",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].first()"
]
}
],
"master_item": {
"key": "web.page.get[\"{$HAPROXY.STATS.SCHEME}://{$HAPROXY.STATS.HOST}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv\"]"
},
"tags": [
{
"tag": "component",
"value": "raw"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "25c22d3eca2d4eb7b83791d36edcf470",
"name": "{#PXNAME} {#SVNAME}: Responses time",
"type": "DEPENDENT",
"key": "haproxy.server.rtime[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"units": "s",
"description": "Average server response time (in ms) for the last 1,024 requests.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.rtime"
]
},
{
"type": "MULTIPLIER",
"parameters": [
"0.001"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "health"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "51ae2aca459b453cb433c5cc0f043a25",
"expression": "min(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.rtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_RTIME.MAX.WARN}",
"name": "HAProxy: {#PXNAME} {#SVNAME}: Average response time is high",
"event_name": "HAProxy: {#PXNAME} {#SVNAME}: Average response time is more than {$HAPROXY.SERVER_RTIME.MAX.WARN} for 5m",
"priority": "WARNING",
"description": "Average server response time (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_RTIME.MAX.WARN}.",
"tags": [
{
"tag": "scope",
"value": "performance"
}
]
}
]
},
{
"uuid": "973e886a54374bd4815f71d9f9174e80",
"name": "{#PXNAME} {#SVNAME}: Status",
"type": "DEPENDENT",
"key": "haproxy.server.status[{#PXNAME},{#SVNAME}]",
"value_type": "CHAR",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.status"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"10m"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "health"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
],
"trigger_prototypes": [
{
"uuid": "ec64ec00aa164ac09faf90794264907a",
"expression": "count(/TPL_HAProxy_by_zabbix_agent_MEKOO/haproxy.server.status[{#PXNAME},{#SVNAME}],#5,\"eq\",\"DOWN\")=5",
"name": "HAProxy: {#PXNAME} {#SVNAME}: Server is DOWN",
"opdata": "Current value: {ITEM.LASTVALUE1}",
"priority": "WARNING",
"description": "Server is not available.",
"tags": [
{
"tag": "scope",
"value": "availability"
}
]
}
]
},
{
"uuid": "6f5c20d65ba34afbb47cd65af1d1b368",
"name": "{#PXNAME} {#SVNAME}: Sessions per second",
"type": "DEPENDENT",
"key": "haproxy.server.stot.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Cumulative number of sessions (end-to-end connections) per second.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.stot"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "sessions"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "02605cd644e14e2398af89433a6d976d",
"name": "{#PXNAME} {#SVNAME}: Weight",
"type": "DEPENDENT",
"key": "haproxy.server.weight[{#PXNAME},{#SVNAME}]",
"description": "Effective weight.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.weight"
]
},
{
"type": "DISCARD_UNCHANGED_HEARTBEAT",
"parameters": [
"1h"
]
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "balancer"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "606acc119e0d4d9c934e200e037434fe",
"name": "{#PXNAME} {#SVNAME}: Redispatched requests per second",
"type": "DEPENDENT",
"key": "haproxy.server.wredis.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of times a request was redispatched to a different backend.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.wredis"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "requests"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
},
{
"uuid": "1e2188320b834562b6b33e96f90a5b44",
"name": "{#PXNAME} {#SVNAME}: Retried connections per second",
"type": "DEPENDENT",
"key": "haproxy.server.wretr.rate[{#PXNAME},{#SVNAME}]",
"value_type": "FLOAT",
"description": "Number of times a connection was retried.",
"preprocessing": [
{
"type": "JSONPATH",
"parameters": [
"$.wretr"
]
},
{
"type": "CHANGE_PER_SECOND"
}
],
"master_item": {
"key": "haproxy.server.raw[{#PXNAME},{#SVNAME}]"
},
"tags": [
{
"tag": "component",
"value": "connections"
},
{
"tag": "server",
"value": "{#PXNAME}"
},
{
"tag": "service",
"value": "{#SVNAME}"
}
]
}
],
"graph_prototypes": [
{
"uuid": "15210cbf31ab459ca77d35206255f317",
"name": "HAProxy: {#PXNAME} {#SVNAME} In/Out traffic",
"graph_items": [
{
"drawtype": "GRADIENT_LINE",
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.bin.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"drawtype": "GRADIENT_LINE",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.bout.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "09fb856698f441b29103e3b8c8bcb8dd",
"name": "HAProxy: {#PXNAME} {#SVNAME} Responses by HTTP code",
"type": "STACKED",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "2",
"color": "00611C",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "3",
"color": "F7941D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "4",
"color": "FC6EA3",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]"
}
}
]
},
{
"uuid": "e3e10b66deb14b33a436481cc34eeb84",
"name": "HAProxy: {#PXNAME} {#SVNAME} Response time and time in queue",
"graph_items": [
{
"color": "199C0D",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.rtime[{#PXNAME},{#SVNAME}]"
}
},
{
"sortorder": "1",
"color": "F63100",
"item": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"key": "haproxy.server.qtime[{#PXNAME},{#SVNAME}]"
}
}
]
}
],
"master_item": {
"key": "haproxy.get.nodes"
},
"lld_macro_paths": [
{
"lld_macro": "{#MODE}",
"path": "$.mode"
},
{
"lld_macro": "{#PXNAME}",
"path": "$.pxname"
},
{
"lld_macro": "{#SVNAME}",
"path": "$.svname"
}
],
"overrides": [
{
"name": "Discard HTTP status codes",
"step": "1",
"filter": {
"conditions": [
{
"macro": "{#MODE}",
"value": "tcp"
}
]
},
"operations": [
{
"operator": "LIKE",
"value": "Number of responses with codes",
"discover": "NO_DISCOVER",
"status": "ENABLED"
}
]
}
]
}
],
"tags": [
{
"tag": "class",
"value": "software"
},
{
"tag": "target",
"value": "haproxy"
}
],
"macros": [
{
"macro": "{$HAPROXY.BACK_ERESP.MAX.WARN}",
"value": "10",
"description": "Maximum of responses with error on BACKEND for trigger expression."
},
{
"macro": "{$HAPROXY.BACK_QCUR.MAX.WARN}",
"value": "10",
"description": "Maximum number of requests on BACKEND unassigned in queue for trigger expression."
},
{
"macro": "{$HAPROXY.BACK_QTIME.MAX.WARN}",
"value": "10s",
"description": "Maximum of average time spent in queue on BACKEND for trigger expression."
},
{
"macro": "{$HAPROXY.BACK_RTIME.MAX.WARN}",
"value": "10s",
"description": "Maximum of average BACKEND response time for trigger expression."
},
{
"macro": "{$HAPROXY.FRONT_DREQ.MAX.WARN}",
"value": "10",
"description": "The HAProxy maximum denied requests for trigger expression."
},
{
"macro": "{$HAPROXY.FRONT_EREQ.MAX.WARN}",
"value": "10",
"description": "The HAProxy maximum number of request errors for trigger expression."
},
{
"macro": "{$HAPROXY.FRONT_SUTIL.MAX.WARN}",
"value": "80",
"description": "Maximum of session usage percentage on frontend for trigger expression."
},
{
"macro": "{$HAPROXY.RESPONSE_TIME.MAX.WARN}",
"value": "10s",
"description": "The HAProxy stats page maximum response time in seconds for trigger expression."
},
{
"macro": "{$HAPROXY.SERVER_ERESP.MAX.WARN}",
"value": "10",
"description": "Maximum of responses with error on server for trigger expression."
},
{
"macro": "{$HAPROXY.SERVER_QCUR.MAX.WARN}",
"value": "10",
"description": "Maximum number of requests on server unassigned in queue for trigger expression."
},
{
"macro": "{$HAPROXY.SERVER_QTIME.MAX.WARN}",
"value": "10s",
"description": "Maximum of average time spent in queue on server for trigger expression."
},
{
"macro": "{$HAPROXY.SERVER_RTIME.MAX.WARN}",
"value": "10s",
"description": "Maximum of average server response time for trigger expression."
},
{
"macro": "{$HAPROXY.STATS.HOST}",
"value": "localhost",
"description": "The hostname or IP address of the HAProxy stats host or container."
},
{
"macro": "{$HAPROXY.STATS.PATH}",
"value": "stats",
"description": "The path of HAProxy stats page."
},
{
"macro": "{$HAPROXY.STATS.PORT}",
"value": "8404",
"description": "The port of the HAProxy stats host or container."
},
{
"macro": "{$HAPROXY.STATS.SCHEME}",
"value": "http",
"description": "The scheme of HAProxy stats page(http/https)."
}
],
"dashboards": [
{
"uuid": "6d515de988274ac6b31938eebd175973",
"name": "HAProxy Backend performance",
"pages": [
{
"widgets": [
{
"type": "graphprototype",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Backend {#PXNAME} Redispatched requests and retried connections per second"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAE"
}
]
},
{
"type": "graphprototype",
"y": "5",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Backend {#PXNAME} Responses by HTTP code"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAF"
}
]
},
{
"type": "graphprototype",
"y": "10",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Backend {#PXNAME} In/Out traffic"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAG"
}
]
}
]
}
]
},
{
"uuid": "7c4decb2fefc4cfe9c4a3f8717d710ca",
"name": "HAProxy Frontend performance",
"pages": [
{
"widgets": [
{
"type": "graphprototype",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Frontend {#PXNAME} Requests and sessions per second"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAA"
}
]
},
{
"type": "graphprototype",
"y": "5",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Frontend {#PXNAME} Errors and denials per second"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAB"
}
]
},
{
"type": "graphprototype",
"y": "10",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Frontend {#PXNAME} Responses by HTTP code"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAC"
}
]
},
{
"type": "graphprototype",
"y": "15",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: Frontend {#PXNAME} In/Out traffic"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAD"
}
]
}
]
}
]
},
{
"uuid": "ebc5a517fa544fada42550059c014c5b",
"name": "HAProxy Server performance",
"pages": [
{
"widgets": [
{
"type": "graphprototype",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: {#PXNAME} {#SVNAME} Response time and time in queue"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAH"
}
]
},
{
"type": "graphprototype",
"y": "5",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: {#PXNAME} {#SVNAME} Responses by HTTP code"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAI"
}
]
},
{
"type": "graphprototype",
"y": "10",
"width": "72",
"height": "5",
"fields": [
{
"type": "INTEGER",
"name": "columns",
"value": "1"
},
{
"type": "GRAPH_PROTOTYPE",
"name": "graphid.0",
"value": {
"host": "TPL_HAProxy_by_zabbix_agent_MEKOO",
"name": "HAProxy: {#PXNAME} {#SVNAME} In/Out traffic"
}
},
{
"type": "STRING",
"name": "reference",
"value": "AAAAJ"
}
]
}
]
}
]
}
],
"valuemaps": [
{
"uuid": "bf2e9463450d4f4899abcac85cde0a92",
"name": "Server mode",
"mappings": [
{
"value": "0",
"newvalue": "-"
},
{
"value": "1",
"newvalue": "Y"
}
]
},
{
"uuid": "4980ec41c6644ecb9d5b52027a381fd8",
"name": "Service state",
"mappings": [
{
"value": "0",
"newvalue": "Down"
},
{
"value": "1",
"newvalue": "Up"
}
]
}
]
}
]
}
}


1. Objectif du Template

Ce template permet de surveiller HAProxy en utilisant l'agent Zabbix. Il collecte des métriques en interrogeant la page de statistiques d'HAProxy (généralement accessible via une URL comme http://<haproxy-host>:<port>/stats). Les données sont récupérées en vrac, ce qui permet de minimiser les requêtes et d'optimiser les performances.


2. Fonctionnalités Principales

Le template surveille les aspects suivants d'HAProxy :

  • Statut général du service HAProxy (disponibilité, temps de réponse, etc.).
  • Performances des backends (nombre de serveurs actifs, trafic entrant/sortant, erreurs, etc.).
  • Performances des frontends (taux de requêtes, sessions actives, erreurs, etc.).
  • Statut des serveurs individuels (health checks, poids, temps de réponse, etc.).
  • Découverte automatique des backends, frontends et serveurs configurés dans HAProxy.

3. Structure du Template

Le template est structuré en plusieurs sections clés :

a. Template Groups

  • Le template appartient au groupe "Templates/Applications", ce qui facilite son organisation dans Zabbix.

b. Templates

  • Le template est nommé "TPL_HAProxy_by_zabbix_agent_MEKOO".
  • Il inclut une description détaillée expliquant comment configurer HAProxy pour exposer ses statistiques et comment configurer les macros Zabbix pour adapter le template à l'environnement.

c. Items

Les items sont des métriques collectées par Zabbix. Ce template inclut des items pour :

  • Récupérer les données brutes de la page de statistiques HAProxy.
  • Extraire des informations spécifiques comme :
    • Le temps de fonctionnement (uptime) d'HAProxy.
    • La version d'HAProxy.
    • Le temps de réponse du service.
    • Le statut du service (up/down).

d. Discovery Rules

Le template utilise des règles de découverte pour détecter automatiquement :

  • Les backends (groupes de serveurs).
  • Les frontends (points d'entrée des requêtes).
  • Les serveurs individuels (instances gérées par HAProxy).

Ces règles permettent de créer dynamiquement des items, des triggers et des graphiques pour chaque backend, frontend ou serveur découvert.

e. Triggers

Les triggers sont des alertes configurées pour notifier en cas de problèmes. Par exemple :

  • HAProxy a redémarré (uptime < 10 minutes).
  • Le temps de réponse est trop élevé.
  • Un serveur backend est down.
  • Le nombre d'erreurs dépasse un seuil critique.

f. Graphs

Le template inclut des graphiques pour visualiser les données collectées, comme :

  • Le trafic entrant/sortant.
  • Les erreurs HTTP (codes 4xx, 5xx).
  • Le temps de réponse des serveurs.

g. Dashboards

Des tableaux de bord prédéfinis sont inclus pour visualiser les performances des backends, frontends et serveurs.

h. Macros

Les macros sont des variables configurables pour adapter le template à l'environnement. Par exemple :

  • {$HAPROXY.STATS.HOST} : L'hôte ou l'adresse IP du serveur HAProxy.
  • {$HAPROXY.STATS.PORT} : Le port de la page de statistiques.
  • {$HAPROXY.STATS.PATH} : Le chemin de la page de statistiques.

i. Valuemaps

Les valuemaps sont utilisées pour mapper des valeurs brutes à des états compréhensibles. Par exemple :

  • 0 → "Down", 1 → "Up" pour le statut du service.
  • 0 → "-", 1 → "Y" pour le mode serveur (actif/backup).

4. Prérequis pour Utiliser ce Template

Pour utiliser ce template, vous devez :

  1. Configurer HAProxy pour exposer sa page de statistiques. Par exemple :
    frontend stats
    bind *:8404
    stats enable
    stats uri /stats
    stats refresh 10s
  2. Configurer les macros Zabbix pour pointer vers l'hôte, le port et le chemin de la page de statistiques HAProxy.
  3. Importer le template dans Zabbix et l'appliquer à l'hôte surveillant HAProxy.

5. Avantages de ce Template

  • Automatisation : La découverte automatique des backends, frontends et serveurs réduit la configuration manuelle.
  • Complet : Il couvre tous les aspects critiques d'HAProxy (disponibilité, performances, erreurs).
  • Optimisé : La collecte en vrac minimise l'impact sur les performances.
  • Personnalisable : Les macros permettent d'adapter le template à différents environnements.

6. Exemples de Métriques Surveillées

  • HAProxy Uptime : Temps écoulé depuis le dernier redémarrage.
  • Version d'HAProxy : Détecte les changements de version.
  • Statut du service : Vérifie si HAProxy est opérationnel.
  • Trafic réseau : Bits entrants/sortants pour les backends et frontends.
  • Erreurs HTTP : Nombre de réponses avec codes 4xx et 5xx.
  • Temps de réponse : Temps moyen de réponse des serveurs.

7. Exemples de Triggers

  • HAProxy a redémarré : Si l'uptime est inférieur à 10 minutes.
  • Temps de réponse élevé : Si le temps de réponse dépasse 10 secondes.
  • Serveur backend down : Si un serveur backend est down pendant 5 checks consécutifs.
  • Erreurs HTTP excessives : Si le nombre d'erreurs 5xx dépasse un seuil configurable.

8. Tableaux de Bord Inclus

  • HAProxy Backend Performance : Visualise les performances des backends (trafic, erreurs, etc.).
  • HAProxy Frontend Performance : Affiche les métriques des frontends (requêtes, sessions, etc.).
  • HAProxy Server Performance : Montre les performances des serveurs individuels (temps de réponse, erreurs, etc.).

9. Conclusion

Ce template est un outil puissant pour surveiller HAProxy avec Zabbix. Il offre une surveillance complète, automatisée et personnalisable, permettant aux administrateurs système de détecter rapidement les problèmes et d'optimiser les performances d'HAProxy.