Building of a Icinga2 Agent installation on AWS AMI 2017.03 is not possible

This forum was archived to /woltlab and is now in read-only mode.
  • Thanks jat for your reply,


    unfortunately the procedure is done on Amazon Linux that does not support systemctl and it does not have any /etc/systemd being based on Enterprise Linux 6.

  • Then it's running init. The service file should be located in /etc/init.d and "service --status-all" should show icinga2 as service.

    The service can be enabled with "service icinga2 enable".

  • Hi jat,


    exactly, it should run in /etc/init.d but it was not there, so, as your suggestion, I copied the icinga2 init script from the official repo.


    Running service icinga2 enable as well as service icinga2 start return the following statement:

    Could not fetch RunAsUser variable. Error 'critical/cli: Invalid group specified: icinga'. Exiting.

    I am also pretty sure I have not specified any user pr group either.


    Has anybody experienced anything similar?


    Thanks in advance for any help!

  • My Icinga2 and Amazon Linux skills are pretty limited (never used Amazon Linux and the last time i used Icinga2 is a few years ago, in the beta times), but this looks like a problem with environmental variables problem. The init script is referencing to the following line (source)

    Code
    1. ICINGA2_USER=`$DAEMON variable get --current RunAsUser`

    whicht triggers the error.

    It could be a missing user (icinga2 per default), missing group, missing environmental variable, but it's just a guess.


    Amazon Linux is based on RHEL, right? Why not try the official Icinga2 RHEL RPM's?

  • Ok. Solved. Following are the steps I made to make icinga2 up and running in Amazon Linux AMI.

    Then, in the file $HOME/rpmbuild/BUILD/icinga2-2.6.3/etc/initsystem/CMakeLists.txt I substitute the line

    Code
    1. set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")

    with

    Code
    1. if(NOT DEFINED ICINGA2_SYSCONFIGFILE)
    2. set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
    3. endif()

    Again, in the file $HOME/rpmbuild/BUILD/icinga2-2.6.3/etc/initsystem/icinga2.service.cmake I substitute the line

    Code
    1. ExecStartPre=@CMAKE_INSTALL_PREFIX@/lib/icinga2/prepare-dirs @ICINGA2_SYSCONFIGFILE@

    with

    Code
    1. ExecStartPre=@CMAKE_INSTALL_FULL_SBINDIR@/icinga2-prepare-dirs @ICINGA2_SYSCONFIGFILE@

    After all the steps mentioned above, I started the service icinga2 and it was perfectly up and running without any errors.


    Thank all for the guidelines and the support.