Newbie to Icinga: Installation of Director

This forum was archived to /woltlab and is now in read-only mode.
  • Hey everyone,


    I am brand new to Icinga and know very little about Linux. I can follow instructions very well and was able to get Icinga installed this morning after spending most of yesterday following some instructions I found online. I could not figure out how to add hosts until I did a google search and discovered the module called Director for Icinga. I followed the instructions on the GitHub site, created the database and the user, added the resource in the web UI, however that is where I am stuck. I do not know where to go from here in order to get the Director Module installed. Can someone help me please?


    Thanks


    Phil

  • Hi,

    It is not uncommon to struggle with reading all the important docs until the first lab installation does what is expected.

    The official docu is very good, but it just takes some time to find your way through it.


    You should read:

    Step I: Icinga2 and IcingaWeb2:

    https://docs.icinga.com/icinga…2/chapter/getting-started

    https://docs.icinga.com/icinga…chapter/monitoring-basics


    Make your first steps in icinga2 and icingaweb2 without using the director, ideally in a lab environment.

    Configure a few hosts and services and perhaps a custom check command using the static config files,

    so that you get a feeling about how icinga2 operates *and* what configuration steps the director tries to automate if you use it later.


    Be told that you absolutely need to create / modify /etc/icinga2/zones.conf by hand - the director can not help you with that but

    needs the information within that later.



    Step II: Icingaweb2 Module Director:

    https://github.com/Icinga/icin…er/doc/01-Introduction.md


    Most important but easy to overlook:

    https://github.com/Icinga/icin…doc/04-Getting-started.md

    (Refers to but does not name explicitely: /etc/icinga2/zones.conf and /etc/icinga2/conf.d/api-users.conf)


    https://github.com/Icinga/icin…er/doc/02-Installation.md

    Follow that so that you are able to run the kickstart wizzard which will

    • ask questions about the config (i. e. needs to know the db resource you have created)
    • import existing zones
    • end in a screen with a "start using director" button.


    https://github.com/Icinga/icin…er/doc/10-How-it-works.md



    That looks like a lot of stuff to read, but i can not help it - that is what you need to know.

    The post was edited 4 times, last by sru ().

  • So after weeks of searching the internet and struggling I was somehow magically able to get the director enabled. However now I am getting the error:

    CURL Error: Failed to connect to Icinga Port 5665: Connection refused (RestApiClient.php:177)

    https://gyazo.com/72da7d75f04ceba1e9e78e8bbdae3964

    I did manage to get CURL installed, I got the CA certificate installed, I really need some help with the next steps as I feel that I am so close to getting this up and running. Please help. :)

  • For me it seems that you didn't configured your API feature. You can active the API feature either by icinga2 feature enable api or by the node wizard. I recommend the node wizard method because it will create most of the dependencies you need for the director (API, certificates, etc.). Don't forget to add the global-director zone, mentioned by sru in Step II.

  • I'm having a problem similar to what philt had. Using the Kickstart Wizard, when I leave the port at 5665 I get the message:


    CURL ERROR: Failed to connect to av-monitor02.mssp.local port 5665: Connection refused (RestApiClient.php:177)


    If I change the port to 80, I get:


    CURL ERROR: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (RestApiClient.php:177)


    and if I change the port to 443, I get:


    Parsing JSON result failed: Syntax error (RestApiResponse.php:88)


    This suggests to me that the module is installed correctly and that CURL is running as I'd expect it to. I'm not sure why the connection is refused on port 5665, as I've manually configured some hosts to monitor and am seeing them in icingaweb2 as expected, which seems to indicate that the API is running properly. I have a global-director zone setup as required. Suggestions, anyone?

    The post was edited 1 time, last by drloss ().

  • Port 5665 is served by the icinga2 binary while ports 80 and 443 are (usually) served by your web server (apache, nginx, etc.).

    So if 5665 gives a "Connection refused", it may hit the wrong host for what reason ever (DNS?).

    and am seeing them in icingaweb2 as expected, which seems to indicate that the API is running properly

    I agree. It is running *somewhere*, but there seems to be a difference about what machine icingaweb2 and director are talking to.

    So, what is the host below System/Monitoring Health/ active endpoint ?

  • The host listed there is "av-monitor02.mssp.local". I have restarted icinga2, and now when I run the Kickstart Wizard import on port 5665 I receive the message:


    I was unable to re-establish a connection to the Endpoint "av-monitor02.mssp.local" (av-monitor02.mssp.local:5665). When reconnecting to the configured Endpoint (172.17.20.2:5665) I get an error: CURL ERROR: Connection timed out after 3000 milliseconds Please re-check your Icinga 2 endpoint configuration (KickstartHelper.php:370)


    The messages for ports 80 and 443 remain the same, as expected. Under the Activity Log, I get the message:


    Unable to detect your deployment endpoint. I was looking for the first endpoint configured with an assigned API user in the "master" zone.

    The remainder of the error follows:


    Code
    1. #0 /usr/share/icingaweb2/modules/director/library/Director/Db.php(163): Icinga\Module\Director\Db->getDeploymentEndpointName()
    2. #1 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ActionController.php(366): Icinga\Module\Director\Db->getDeploymentEndpoint()
    3. #2 /usr/share/icingaweb2/modules/director/application/controllers/ConfigController.php(133): Icinga\Module\Director\Web\Controller\ActionController->api()
    4. #3 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\ConfigController->activitiesAction()
    5. #4 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('activitiesActio...')
    6. #5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
    7. #6 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
    8. #7 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
    9. #8 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
    10. #9 {main}