Zero values are replaced by hardcoded limits in defaults and by defaults in overrides arguments.
This pull request implements #7.
Given this HAProxy configuration:
listen read-write
bind *:8000
mode http
server instance1 127.0.0.1:8001 check
server instance2 127.0.0.1:8002 check
listen read-only
bind *:9000
mode http
server instance1 127.0.0.1:9001 check
server instance2 127.0.0.1:9002 check
server read-write 127.0.0.1:8000 backup
The important part is when all servers in the read-only backend are down, there is still a backup server pointing to the read-write port:
$ curl -I -XGET http://127.0.0.1:9000/
HTTP/1.0 200 OK
The situation isn't critical because it still works but it would be nice to be notified because something is wrong with the read-only backend. For defaults, we could set u,2,1 for thresholds to warn when available servers go below count of 2 and crit below 1. It works. For the special read-only backend, we could set u,1,0 to warn below 1 host down and "ignore" critical as it will never go strictly below 0:
Zero values are replaced by hardcoded limits in
defaults
and by defaults inoverrides
arguments.This pull request implements #7.
Given this HAProxy configuration:
The important part is when all servers in the read-only backend are down, there is still a backup server pointing to the read-write port:
The situation isn't critical because it still works but it would be nice to be notified because something is wrong with the read-only backend. For defaults, we could set
u,2,1
for thresholds to warn when available servers go below count of 2 and crit below 1. It works. For the special read-only backend, we could setu,1,0
to warn below 1 host down and "ignore" critical as it will never go strictly below 0:Critical. It's because perl considers
0
as absence of value socheck_haproxy
falls back to defaults:Overrides go from
u,1,0
tou,1,1,0.80,0.90
and notu,1,0,0.80,0.90
.This pull request fixes this behaviour: