Adding Director Endpoints automatically?

Hey,

to install the icinga2 agent packages on remote hosts to monitor them, I use for windows-server the powershell-framework and for debian machines the bash script from there own host object in director under “Agent”.

In the scenario from the windows-server, the windows-server will be generated and created automatically in the director as host. Perfect. But if I want to run some agent services (like cpu, disk status) the master or agent cant connect to each other, because I have do add the endpoint configuration for this specific host in the director under “Icinga-Infrastructure”.

Is that the right way? Why I cant just role up the powershell script on the client and the monitoring begins via host-template etc. to execute the agent based services to monitor?

Please help. :slight_smile:
Thanks! Have a nice weekend.

Hi,

Does the problem apply to Windows and Linux hosts?

Did you specify the correct api key in the script? What is the host status critical or green? To me this seems like a problem with your zone.

please post the zones.conf from your machine.

When you roll out the powershell script you need to deploy the changes in the director.

Best regards.

did you set “Icinga2 Agent” to yes? This is necessary for endpoint creation in director config.
You can do this for hosts individually or for a host template.

Services that should run on agents should be equipped with “Run on agent”=Yes service templates

Yes, I ticked these options.

So that means (?): If I create a new host with the option “Icinga-2-Agent” and save that object, the director automatically creates a endpoint object for the master icinga where the director is installed?

If yes, I dont get this endpoint object under: Icinga-Director → Icinga Infrastructure → Endpoints
Is empty. No host is there created. Services are not running because of "Endpoint is not connect to xxx (master).

If I create manually the endpoint object in the director, the service runs without problems… :frowning:

But If I want to publish as e.g. this powershell framework command to deploy that script as package to like 30 different windows-server, It cant be the soloution to create for every windows-system manually the endpoint object in the director. Because via the API the host-object with all right informations is created in the host “table” in the director.

Yes the director creates the endpoint, but not as an endpoint in that specific list.
you can check it in your deployment files:
last deployment-> config →

Config file “zones.d/master/agent_endpoints.conf”

Hey,

it’s create the following config-files:

  • “agent_endpoints.conf”
  • “agent_zones.conf”

Buuuuuut: It doesnt store there anywhere the IP-address of the host. Because this network doesnt support DNS. I entered in the host-object the ip-address…

Okaaaaaaaaaaay. Now I got it fixed. I had also to check the box “Connect to Agent” from the master/satellite endpoint in the host-object. Now also the IP-address of the host in listed in the “agent_endpoints.conf” file!

Perfect, many thanks!