DinoTools / monitoring-check_haproxy

Monitoring plugin to check HAProxy with Icinga, Nagios and other compatible monitoring solutions
https://DinoTools.github.io/monitoring-check_haproxy/
GNU General Public License v2.0
7 stars 4 forks source link

Space separated overrides not working #2

Closed kepi closed 2 years ago

kepi commented 2 years ago

Hi,

there is section Overrides section in Readme specifying, that overrides should be space separated:

Add as many as you like as space-delimited options:

--overrides api:,15,10 assets:d,2,5 webmail:u,3,2

This unfortunately doesn't work and looking into code, I don't believe it ever worked.

❯ ./check_haproxy --defaults d,1,1 -overrides "nginx:x bkredis:d,3,3" --debug                                                                                                                                                                                                                                                     
get_data{} is reading data from HAProxy
build_checks{} setting defaults to d,1.00,1.00,0.75,0.90
build_checks{} building FRONTEND check for apis
build_checks{} building BACKEND check for bk-expanzo-portaltest
build_checks{} building BACKEND check for bk-letsencrypt
build_checks{} building BACKEND check for bkredis
build_checks{} building FRONTEND check for internet
build_checks{} building BACKEND check for nginx
build_checks{} building BACKEND check for nginx-only-berry
build_checks{} building FRONTEND check for redis-cluster
build_checks{} building BACKEND check for stats
build_checks{} processing override nginx:x bkredis:d,3,3
build_checks{} found override part nginx
build_checks{} setting override for nginx to x,1,1,0.75,0.90
check_frontends{} is starting check on frontends

I tried to specify option multiple time and that works without problem.

So instead of (btw I tried with and without quotes):

./check_haproxy --defaults d,1,1 -overrides "nginx:x bkredis:d,3,3" --debug

running:

./check_haproxy --defaults d,1,1 -overrides nginx:x --overrides bkredis:d,3,3" --debug

works as supposed. Same problem is with jonathanio/monitoring-nagios-haproxy but as your fork is alive, it seems better to resolve here.

IMHO documentation change would be best instead of implementing parsing space separated arguments.

Thanks for reviving this project.

phibos commented 2 years ago

Thanks for reporting the issue. I have updated the documentation.