Ad Widget
Collapse
Discussion thread for official Zabbix Template HAProxy
Collapse
X
-
I think Incoming and Outgoing traffic is wrong, such that it is displayed in Units Bps, and multiplied by 8, this is wrong. The actual value from the stats page is in Bytes already... So there is no need to multiply it by 8, unless the Units is changed to bps, then the multiplication preprocessor by 8 can be kept...Last edited by metal; 14-05-2020, 19:25.Comment
-
Ok, I analyzed the JSON output, I think it is simpler than I thought!
I added some missing backend discovery items, below are the mods, also the modified template template is attached, hope that zabbix team considers this template, I just need confirmation from zabbix people to see if incoming/outgoing traffic is being correctly read from the stats page because the stats page shows bytes, and in the template it is multiplied by 8, while the item unit is in Bps and this is wrong so I kept the multiplication by 8 and changed the unit to bps:
HTML Code:BACKEND discovery ================= HAProxy Backend {#PXNAME}: Incoming traffic haproxy.backend.bin[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bin.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy Backend {#PXNAME}: Outgoing traffic haproxy.backend.bout[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bout.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy Backend {#PXNAME}: Session limits haproxy.backend.slim[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].slim.first() Preprocessor: Discard unchanged with heartbeat = 1h Type of information = Numeric (unsigned) HAProxy Backend {#PXNAME}: Sessions rate haproxy.backend.rate[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rate.first() Type of information = Numeric (unsigned) TCP BACKEND discovery ===================== HAProxy TCP Backend {#PXNAME}: Incoming traffic haproxy.backend_tcp.bin[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bin.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy TCP Backend {#PXNAME}: Outgoing traffic haproxy.backend_tcp.bout[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bout.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy TCP Backend {#PXNAME}: Session limits haproxy.backend_tcp.slim[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].slim.first() Preprocessor: Discard unchanged with heartbeat = 1h Type of information = Numeric (unsigned) HAProxy TCP Backend {#PXNAME}: Sessions rate haproxy.backend_tcp.rate[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rate.first() Type of information = Numeric (unsigned) Servers discovery ================= HAProxy {#PXNAME} {#SVNAME}: Incoming traffic haproxy.server.bin[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bin.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy {#PXNAME} {#SVNAME}: Outgoing traffic haproxy.server.bout[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bout.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy {#PXNAME} {#SVNAME}: Session limits haproxy.server.slim[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].slim.first() Preprocessor: Discard unchanged with heartbeat = 1h Type of information = Numeric (unsigned) HAProxy {#PXNAME} {#SVNAME}: Sessions rate haproxy.server.rate[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rate.first() Type of information = Numeric (unsigned) TCP Servers discovery ===================== HAProxy {#PXNAME} {#SVNAME}: Incoming traffic haproxy.server_tcp.bin[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bin.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy {#PXNAME} {#SVNAME}: Outgoing traffic haproxy.server_tcp.bout[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].bout.first() Preprocessor: Custom multiplier = 8 Preprocessor: Change per second Type of information = Numeric (float) Units = bps HAProxy {#PXNAME} {#SVNAME}: Session limits haproxy.server_tcp.slim[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].slim.first() Preprocessor: Discard unchanged with heartbeat = 1h Type of information = Numeric (unsigned) HAProxy {#PXNAME} {#SVNAME}: Sessions rate haproxy.server_tcp.rate[{#PXNAME}:{#SVNAME}] Preprocessor: JSONPath = $.[?(@.pxname == '{#PXNAME}' && @.svname == '{#SVNAME}')].rate.first() Type of information = Numeric (unsigned)Attached FilesComment
-
I suppose it's a custom template. The official templates for HAProxy use bps https://git.zabbix.com/projects/ZBX/.../templates/appI think Incoming and Outgoing traffic is wrong, such that it is displayed in Units Bps, and multiplied by 8, this is wrong. The actual value from the stats page is in Bytes already... So there is no need to multiply it by 8, unless the Units is changed to bps, then the multiplication preprocessor by 8 can be kept...Last edited by max.ch.88; 20-05-2020, 16:35.Comment
-
Hellow!
I'm used template v. 2020-04-17T09:24:27Z for Zabbix 5.0.0 and HaProxy 1.5.18. During discovery process an errors appears: "Cannot accurately apply filter: no value received for macro "{#MODE}" json path '$.mode'." This error is similar for all discovered dependent items. When i analyse master item (web.page.get) i really cannot see "mode" in server reply.
I try to use template for HTTP and Zabbix agent and get the same errors.
Please help me to solve this problem.Comment
-
Hello,
I'm running zabbix_server (Zabbix) 4.4.9 Revision 691355e610 25 May 2020 and using the "App HAProxy by Zabbix agent" templaye in version 2020-04-17T09:24:27Z with HA proxy server 1.5.18 révision 9.el7
I'm dissapointed because i get an endless error on all discovery rules, it always says "unable to send request, wrong type of discovery rule"
Moreover, i also get an error on "HAProxy: Get stats" item as you can see on screenshot and of course those which it depends on "HAProxy: Get stats page: HAProxy: Uptime" and "HAProxy: Get stats page: HAProxy: Version"
I correctly set frontend stats parameters as this:
bind *:8404
stats enable
stats uri /stats
stats refresh 10s
I get a correct file when requesting CSV stats on HA proxy server using curl from zabbix server
Templates macros are OK and matches host proprerties
By the way i can still get a correct response value from service status & response time items
I tried to delete the first preprocessing step of the "HAProxy: Get stats" item just to see, i don't get my error message anymore but there's an empty valeur returned in "last data" view for it
Also, when i fill the CSV content value directly in the first preprocessing step manual test it seems to be a correct processing of data end value printed
Finaly, i tried to replace the value web.page.get of the "HAProxy: Get stats" item with the real server CSV stats URL value or HOST.CONN by 127.0.0.1 but still get the same error
Any help would be appreciatedComment
-
Hi,
we have a loadbalancer with multiple haproxy instances which means we also have multiple haproxy stats pages.
Each of them is reachable with a different port.
Is it possible to check more ports with the current state of this template?
Thanks
br,
mstrasserComment
-
Hi. Yes, you can create a separated host for each HAproxy instance and define the port in host macro {$HAPROXY.STATS.PORT}.Comment
-
Hi. I can suggest only to upgrade your HAproxy. Template App HAProxy was tested for HAproxy 1.8 and later.Hellow!
I'm used template v. 2020-04-17T09:24:27Z for Zabbix 5.0.0 and HaProxy 1.5.18. During discovery process an errors appears: "Cannot accurately apply filter: no value received for macro "{#MODE}" json path '$.mode'." This error is similar for all discovered dependent items. When i analyse master item (web.page.get) i really cannot see "mode" in server reply.
I try to use template for HTTP and Zabbix agent and get the same errors.
Please help me to solve this problem.Comment
-
Hi thanks for the answer.
the haproxy instances run on the same host and the stats page are reachable with the same ip but different port.
in meantime i solved my problem.
i cloned the original template
removed the duplicated macros
and change the keys.
i have to clone the cloned template for each haproxy stats port but with the search and replace of a text editor its easy to change the template fast.
Maybe there is a better solution!
Comment
-
I meant you need to create separated hosts in Zabbix. With the same IP in interfaces field and the linked template. Just override {$HAPROXY.STATS.PORT} macro in each host. Then you don't need to clone and edit the template.
Hi thanks for the answer.
the haproxy instances run on the same host and the stats page are reachable with the same ip but different port.
in meantime i solved my problem.
i cloned the original template
removed the duplicated macros
and change the keys.
i have to clone the cloned template for each haproxy stats port but with the search and replace of a text editor its easy to change the template fast.
Maybe there is a better solution!Comment
-
my conf is:
frontend stats
bind :8080 ssl crt /etc/haproxy/certificate.pem alpn h2,http/1.1 npn spdy/2
bind-process 1
option http-use-htx
http-request use-service prometheus-exporter if { path /metrics }
maxconn 10
stats enable
stats uri /
stats realm Haproxy\ Statistics
#stats hide-version
stats auth admin
assword
stats refresh 15s
stats admin if TRUEComment
Comment