unable to re-establish a connection to the Endpoint

  • Hi guys,


    I'm facing issue while configuring Director module.
    My setup is as below:
    icinga2 : 2.6.0
    icingaweb2 : 2.4.0


    I tried installing director module 1.2.0 version.
    While running

    Code
    1. curl -k -s -u root:*** 'https://localhost:5665/v1/objects/hosts'


    i'm getting currect output in json format but while running web kickstart wizard and doing "Run Import" its showing error:

    Code
    1. I was unable to re-establish a connection to the Endpoint "***" (127.0.0.1:5665). When reconnecting to the configured Endpoint (***:5665) I get an error: CURL ERROR: couldn't connect to host Please re-check your Icinga 2 endpoint configuration


    & getting this in debug.log


    Code
    1. [2017-01-11 02:36:13 -0700] information/ApiListener: New client connection from [127.0.0.1]:36872 (no client certificate)
    2. [2017-01-11 02:36:13 -0700] notice/ApiListener: New HTTP client
    3. [2017-01-11 02:36:13 -0700] debug/HttpRequest: line: GET /v1/objects/zones HTTP/1.1, tokens: 3
    4. [2017-01-11 02:36:13 -0700] notice/WorkQueue: Spawning WorkQueue threads for 'HttpServerConnection'
    5. [2017-01-11 02:36:13 -0700] information/HttpServerConnection: Request: GET /v1/objects/zones (from [127.0.0.1]:36872, user: root)
    6. [2017-01-11 02:36:13 -0700] debug/HttpRequest: line: GET /v1/objects/endpoints HTTP/1.1, tokens: 3
    7. [2017-01-11 02:36:13 -0700] information/HttpServerConnection: Request: GET /v1/objects/endpoints (from [127.0.0.1]:36872, user: root)
    8. [2017-01-11 02:36:13 -0700] debug/HttpServerConnection: Http client disconnected

    This is my zone.conf file

    Code
    1. object Endpoint NodeName {
    2. host = NodeName
    3. }
    4. object Zone NodeName {
    5. endpoints = [ NodeName ]
    6. }

    My api-users.conf is


    Code
    1. object ApiUser "root" {
    2. password = "***"
    3. client_cn = "CN name"
    4. permissions = [ "*" ]
    5. }

    My CN-Name & Endpoint name is same which is FQDN.


    & api.conf is



    Code
    1. object ApiListener "api" {
    2. cert_path = SysconfDir + "/icinga2/pki/" + NodeName + ".crt"
    3. key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
    4. ca_path = SysconfDir + "/icinga2/pki/ca.crt"
    5. ticket_salt = TicketSalt
    6. }


    My /etc/icinga2/icinga2.conf refers to all required conf files.


    I followed below article to configure master node:
    https://docs.icinga.com/icinga…d-monitoring-setup-master


    I've only configured master node, no clients/satellite installed.



    I'm not sure what wrong I'm doing :( & what else i've missed. Kindly help.

  • did you try my suggestion and check what happens when you curl v1/objects/zones ? also a more verbose debuglog would be good

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • Hey @Kevin.Honka thanks a lot for your help. My issue is fixed now
    There was a wrong entry for my host in /etc/hosts , i deleted it & finally director module is installed now

  • Hi @Kevin.Honka,


    My Icinga Director is configured now but i'm still not able to import & sync data from my earlier configuration.
    I'm not sure is it possible or not. Didn't find something useful.
    Please help me out.

  • well, you should not try to import your old config into Director, simply rebuild them, as handwritten config will conflict with the director one way or the other.


    If you insist on importing it, there is a way which I will not disclose.

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • hehe.. please disclose :)
    There are almost 200 hosts & 1500 services configured with them.. Its quite impossible for me to add each of them.
    Specially for production server i just can't take risk.

  • you would need to add a import source from the core api that reads the hosts, also you need a sync rule that adds them to the director.

    Linux is dead, long live Linux


    Remember to NEVER EVER use git repositories in a productive environment if you CAN NOT control them

  • yeah.. i tried that too.. but "object_name" is too confusing.. I'm not getting all the fields from source config.
    Its still to complicated.