Explicitly disable stats on TCP-mode


#1

If the defaults block contains stats enable, then there is no way to explicitly disable stats on each TCP-mode listener, and you always get a warning about the config:
[WARNING] 349/011014 (16056) : config : 'stats' statement ignored for proxy 'my-listen-name' as it requires HTTP mode.

This could be worked around by removing stats enable from the defaults and manually adding to EVERY http-mode listen, but that is annoying. Can we get something like stats disable added, that disables the stats on that listen block?


#2

“no stats …” should work.

Also, you may want to use two default sections, on without stats and the other one with stats. Frontends/Backends/Listen section will inherit previous default sections afaik:

default

blabal default configuration

no stats here

frontend asd

frontend without stats

backend xy

backend without stats

default
stats enable
frontend abcd

stats enabled


#3

no stats enable does NOT work.

1.7.0 gives this output for it:

[ALERT] 349/165116 (16649) : parsing [haproxy.cfg:36]: negation/default currently supported only for options and log.
[ALERT] 349/165116 (16649) : Error(s) found in configuration file : haproxy.cfg
[WARNING] 349/165116 (16649) : config : 'stats' statement ignored for proxy 'my-tcp-listener' as it requires HTTP mode.
[ALERT] 349/165116 (16649) : Fatal errors found in configuration.

(and it fails)

The multiple default blocks is interesting, but not easy to implement with some configuration management tools.


#4

I submitted a patch to implement stats disable.