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

Define multiple backends with "--override" doesn't work in Icinga2 #9

Open
xtavras opened this issue Mar 14, 2019 · 1 comment · May be fixed by #10
Open

Define multiple backends with "--override" doesn't work in Icinga2 #9

xtavras opened this issue Mar 14, 2019 · 1 comment · May be fixed by #10

Comments

@xtavras
Copy link

xtavras commented Mar 14, 2019

Hello,

I have strange problems, I've defined multiple backends in "--override" option in Icinga2. but somehow, Icinga command run ignores it. Trying to run command copy-pasted from "Inspect" in terminal give the same result.

'/usr/local/hs/icinga-plugins/check_haproxy' '--overrides' 'backend-gscache:,1,0 be-rancher:,2,0 be-letsencrypt:x' '--socket' '/var/lib/haproxy/stats'
HAPROXY CRITICAL: BACKEND be-letsencrypt has fallen below 2 available server(s) (0 up, 0 down, 0 disabled) (check_haproxy 1.0.3)

but if I remove single quotes for --override, it's working

 '/usr/local/hs/icinga-plugins/check_haproxy' '--overrides' backend-gscache:,1,0 be-rancher:,2,0 be-letsencrypt:x '--socket' '/var/lib/haproxy/stats'
HAPROXY OK: HAProxy is functioning within established parameters. (3 frontends, 3 backends, 6 servers, 6 services) (check_haproxy 1.0.3)

Not sure there is the bug, I'm using latest Icinga 2.10 with Director.

object Service "Check HAProxy" {
    host_name = "ldb.example.com"
    import "check haproxy"

    vars.haproxy_overrides = "backend-gscache:,1,0 be-rancher:,2,0 be-letsencrypt:x"
}
@fdellwing fdellwing linked a pull request Aug 12, 2020 that will close this issue
@bensig
Copy link

bensig commented Aug 15, 2022

I used the code from @fdellinwing to make this work for overrides.

Critical to have this change for the haproxy plugin to be functional on icinga2. Does not appear to be reflected in the state on master branch.

        "--overrides" = {
            value = {{
                return macro("$haproxy_overrides$").split(" ")
            }}            
            description = "Override the defaults for a particular frontend or backend, in the form {name}:{override}, where {override} is the same format as --defaults above."
        }

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