Problem with Icinga 2 Daemon

New installation of Icinga 2 on a new VM running Oracle Linux 8.1

Got Icinga 2 installed ok, got Icinga Web installed ok. Eventually got Icinga Director installed, that was a chore. Lol. But it’s eventually installed and technically working, but it’s complaining that the Daemon isn’t running. So I try to manually start the Daemon service and it fails:

[root@npbvmjazicinga-dc local]# systemctl start icinga-director.service
Job for icinga-director.service failed because the control process exited with error code.
See "systemctl status icinga-director.service" and "journalctl -xe" for details.
[root@npbvmjazicinga-dc local]# journalctl -xe
--
-- The unit icinga-director.service has entered the 'failed' state with result 'exit-code'.
Jun 04 16:36:56 npbvmjazicinga-dc systemd[1]: Failed to start Icinga Director - Monitoring Configuration.
-- Subject: Unit icinga-director.service has failed
-- Defined-By: systemd
-- Support: https://support.oracle.com
--
-- Unit icinga-director.service has failed.
--
-- The result is failed.
Jun 04 16:36:56 npbvmjazicinga-dc sshd[6538]: Connection closed by 127.0.0.1 port 57164 [preauth]
Jun 04 16:37:00 npbvmjazicinga-dc icinga2[6501]: Cannot connect to host '10.32.8.124' on port '5665': Connection refused
Jun 04 16:37:10 npbvmjazicinga-dc icinga2[6501]: Cannot connect to host '10.32.8.124' on port '5665': Connection refused
Jun 04 16:37:20 npbvmjazicinga-dc icinga2[6501]: Cannot connect to host '10.32.8.124' on port '5665': Connection refused
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: icinga-director.service: Service RestartSec=30s expired, scheduling restart.
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: icinga-director.service: Scheduled restart job, restart counter is at 300.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://support.oracle.com
--
-- Automatic restarting of the unit icinga-director.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: Stopped Icinga Director - Monitoring Configuration.
-- Subject: Unit icinga-director.service has finished shutting down
-- Defined-By: systemd
-- Support: https://support.oracle.com
--
-- Unit icinga-director.service has finished shutting down.
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: Starting Icinga Director - Monitoring Configuration...
-- Subject: Unit icinga-director.service has begun start-up
-- Defined-By: systemd
-- Support: https://support.oracle.com
--
-- Unit icinga-director.service has begun starting up.
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: PHP Fatal error:  Uncaught Error: Call to undefined function posix_getpid() in /usr/share/icingaweb2/modules/incubator/vendor/gipfl/systemd/src/NotifySystemD.php:186
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: Stack trace:
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #0 /usr/share/icingaweb2/modules/director/library/Director/Daemon/BackgroundDaemon.php(74): gipfl\SystemD\NotifySystemD->setReady()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #1 /usr/share/icingaweb2/modules/director/library/Director/Daemon/BackgroundDaemon.php(52): Icinga\Module\Director\Daemon\BackgroundDaemon->initialize()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #2 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/Tick/FutureTickQueue.php(46): Icinga\Module\Director\Daemon\BackgroundDaemon->Icinga\Module\Director\Daemon\{closure}()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #3 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/StreamSelectLoop.php(182): React\EventLoop\Tick\FutureTickQueue->tick()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #4 /usr/share/icingaweb2/modules/director/library/Director/Daemon/BackgroundDaemon.php(55): React\EventLoop\StreamSelectLoop->run()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #5 /usr/share/icingaweb2/modules/director/application/clicommands/DaemonCommand.php(24): Icinga\Module\Director\Daemon\BackgroundDaemo in /usr/share/icingaweb2/modules/incubator/vendor/gipfl/systemd/src/NotifySystemD.php on l>
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: Fatal error: Uncaught Error: Call to undefined function posix_getpid() in /usr/share/icingaweb2/modules/incubator/vendor/gipfl/systemd/src/NotifySystemD.php:186
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: Stack trace:
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #0 /usr/share/icingaweb2/modules/director/library/Director/Daemon/BackgroundDaemon.php(74): gipfl\SystemD\NotifySystemD->setReady()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #1 /usr/share/icingaweb2/modules/director/library/Director/Daemon/BackgroundDaemon.php(52): Icinga\Module\Director\Daemon\BackgroundDaemon->initialize()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #2 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/Tick/FutureTickQueue.php(46): Icinga\Module\Director\Daemon\BackgroundDaemon->Icinga\Module\Director\Daemon\{closure}()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #3 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/StreamSelectLoop.php(182): React\EventLoop\Tick\FutureTickQueue->tick()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #4 /usr/share/icingaweb2/modules/director/library/Director/Daemon/BackgroundDaemon.php(55): React\EventLoop\StreamSelectLoop->run()
Jun 04 16:37:26 npbvmjazicinga-dc icingadirector[6554]: #5 /usr/share/icingaweb2/modules/director/application/clicommands/DaemonCommand.php(24): Icinga\Module\Director\Daemon\BackgroundDaemo in /usr/share/icingaweb2/modules/incubator/vendor/gipfl/systemd/src/NotifySystemD.php on l>
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: icinga-director.service: Main process exited, code=exited, status=255/n/a
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: icinga-director.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://support.oracle.com
--
-- The unit icinga-director.service has entered the 'failed' state with result 'exit-code'.
Jun 04 16:37:26 npbvmjazicinga-dc systemd[1]: Failed to start Icinga Director - Monitoring Configuration.
-- Subject: Unit icinga-director.service has failed
-- Defined-By: systemd
-- Support: https://support.oracle.com
--
-- Unit icinga-director.service has failed.
--
-- The result is failed.
Jun 04 16:37:30 npbvmjazicinga-dc icinga2[6501]: Cannot connect to host '10.32.8.124' on port '5665': Connection refused
Jun 04 16:37:40 npbvmjazicinga-dc icinga2[6501]: Cannot connect to host '10.32.8.124' on port '5665': Connection refused

Any ideas what’s going on? I see the first error, “PHP Fatal Error: Uncaught Error…” followed by the other stuff. But none of it makes any sense to me.
Then it says “Failed to start Icinga Director - Monitoring Configuration”. But I’m not sure what it means since Director IS actually working, normally from what I can see so far.

Help?

Seems like the PHP posix_getpid function is not available. Usually, the PHP POSIX extension should be enabled by default, but this might differ based on your distribution. Please verify that this extension is available and loaded.

Maybe your distribution has packaged it in a special package. I have seen php-process or php-posix in the past. However, since I am not so familiar with PHP and even less with Oracle Linux, I can only guess.

Edit: I have just re-read the topic. This error is related to the Icinga Director service, not Icinga 2. While there are a few messages from the icinga2 unit in the logs, they are not so bad. Seems like your Icinga 2 cannot connect to another Icinga 2 at 10.32.8.124.

10.32.8.124 isn’t another icinga server, it’s the one and only Windows Server I’ve installed the agent onto for monitoring. And I’m not worried about it fully communicating with that server just yet. I don’t see how communicating with that Windows Server would have any effect on being able to launch/run the Icinga Daemon.

To rephrase, your Icinga 2 server tries to connect to an Icinga 2 agent at this legacy IP address.

This is indeed unrelated. However, as I stated in the main part of my message, the posix_getpid PHP function seems to be unavailable. Please check this.