Ad Widget

Collapse

Zabbix behind haproxy on single public port.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bittlab
    Junior Member
    • Oct 2016
    • 2

    #1

    Zabbix behind haproxy on single public port.

    Dear Experts.


    Our haproxy front end takes connections on port 80.
    How to split an ordinary incoming traffic from traffic to zabbix agent which runs behind the haproxy?

    All ordinary traffic has URL like 222.222.222.222:80/some_path.
    Zabbix has URL like 222.222.222.222:80
    Again, there is only one public port open on server PC: it is 80.
    There is no DNS name for this port.

    Can the following config. work:

    frontend main
    bind *:80

    # ordinarytraffic
    acl ordinary path_beg -i /some_path
    use_backend ordinary_back if ordinary

    # zabbix
    acl is_zabbix
    use_backend zabbix_back if is_zabbix

    # how to match empty "path" ?
    ......

    Thank you.
  • Bittlab
    Junior Member
    • Oct 2016
    • 2

    #2
    configuration seems working, but with unknown errors

    It looks like zabbix and haproxy do cooperate if simply
    zabbix front-end is set as "default" in haproxy and the rest of traffic is caught by path_beg.

    It looks like there are no error messages in zabbix-agent log and its PC is "Enabled" with no errors in Zabbix server dashboard.

    But, there are sometimes errors in haproxy log, not sure why:

    Oct 27 12:58:05 localhost haproxy[19097]: XXX.XXX.XXX.XXX:58266 [27/Oct/2016:12:58:05.999] main main/<NOSRV> -1/-1/-1/-1/0 400 187 - - PR-- 48/48/0/0/0 0/0 "<BADREQ>"
    Oct 27 12:58:06 localhost haproxy[19097]: XXX.XXX.XXX.XXX:58272 [27/Oct/2016:12:58:06.021] main main/<NOSRV> -1/-1/-1/-1/5 400 187 - - PR-- 48/48/0/0/0 0/0 "<BADREQ>"
    Oct 27 12:58:07 localhost haproxy[19097]: XXX.XXX.XXX.XXX:58464 [27/Oct/2016:12:58:07.048] main main/<NOSRV> -1/-1/-1/-1/5 400 187 - - PR-- 48/48/0/0/0 0/0 "<BADREQ>"
    Oct 27 12:58:08 localhost haproxy[19097]: XXX.XXX.XXX.XXX:58662 [27/Oct/2016:12:58:08.074] main main/<NOSRV> -1/-1/-1/-1/6 400 187 - - PR-- 48/48/0/0/0 0/0 "<BADREQ>"
    Oct 27 12:58:09 localhost haproxy[19097]: XXX.XXX.XXX.XXX:58866 [27/Oct/2016:12:58:09.108] main main/<NOSRV> -1/-1/-1/-1/4 400 187 - - PR-- 48/48/0/0/0 0/0 "system.users.num"
    Oct 27 12:58:10 localhost haproxy[19097]: XXX.XXX.XXX.XXX:59058 [27/Oct/2016:12:58:10.134] main main/<NOSRV> -1/-1/-1/-1/0 400 187 - - PR-- 48/48/0/0/0 0/0 "<BADREQ>"
    Oct 27 12:58:11 localhost haproxy[19097]: XXX.XXX.XXX.XXX:49540 [27/Oct/2016:12:58:11.170] main main/<NOSRV> -1/-1/-1/-1/0 400 187 - - PR-- 48/48/0/0/0 0/0 "system.uptime"
    Oct 27 12:58:12 localhost haproxy[19097]: XXX.XXX.XXX.XXX:59452 [27/Oct/2016:12:58:12.192] main main/<NOSRV> -1/-1/-1/-1/0 400 187 - - PR-- 48/48/0/0/0 0/0 "<BADREQ>"

    Thank you.

    Comment

    Working...