Icingacli with dedicated icingaweb2 HA setup

How to get the director to run all icingacli checks only on the 2 dedicated icingaweb2 hosts, independent on which host the service is attached to and in which zone the host with the service is located?

I guess in the DSL I could just set all the command_endpoint of all icingacli to one of the icingaweb2 servers or to the icingaweb2 zone?

Any ideas or how did you solve the conundrum?

I think the most practical way currently is, to set the command_endpoint attribute via the director HTTP API. Couldn’t find a guide to that spontaneously though.

Does the director HTTP API allow a fine grained definition of command_endpoint?
The web UI only allows run on agent yes/no wich translates to command_endpoint = host_name/null.

I think so, I will search for an appropriate example when I find the time.

If it doesn’t:
this will work:

for a service template named test:

icingacli director service set test --command_endpoint icinga-master-endpoint

for a service attached to a host:

icingacli director service set test --command_endpoint icinga-master-endpoint --host hostname-of-service

and if you add it to a template you can use this template and import it as a second template for your service

icingacli director service set tpl-svc-x509 --command_endpoint icingaweb-endpoint ran without error but still had to fix my zones mess as the checks where staying in overdue state.

1 Like

Thanks @moreamazingnick, that was what I had in mind.

1 Like

Just to add what is missing in my post:

  • add a Zone with the Agent name of the host that should execute the check, with the correct parent zone (This is the default so it doesnt interfear with the director config)
  • add an endpoint with the name of Agent name.
  • If you set the IP address of the endpoint, the Icinga-master will actively connect to the agent

after that you can add the command endpoint

1 Like