Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Space separated overrides not working #2

Closed
kepi opened this issue Feb 25, 2022 · 1 comment · Fixed by #3
Closed

Space separated overrides not working #2

kepi opened this issue Feb 25, 2022 · 1 comment · Fixed by #3

Comments

@kepi
Copy link
Contributor

kepi commented Feb 25, 2022

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 phibos closed this as completed in #3 Mar 14, 2022
phibos added a commit that referenced this issue Mar 14, 2022
Update doc of --override option (Fixes: #2)
@phibos
Copy link
Member

phibos commented Mar 14, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants