Hello everyone,
i am new to nagios and installed it with the documentation presented by nagios.
But when i try to start the service it won't work.
[nagios.service]
Unit]
Description=Nagios Core 4.4.14
Documentation=https://www.nagios.org/documentation
After=network.target local-fs.target
[Service]
Type=forking
ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
ExecStop=/usr/bin/kill -s TERM ${MAINPID}
ExecStopPost=/usr/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd
ExecReload=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
ExecReload=/usr/bin/kill -s HUP ${MAINPID}
[Install]
WantedBy=multi-user.target
[systemctl status nagios.service]
● nagios.service - Nagios Core Monitoring Daemon
Loaded: loaded (/etc/systemd/system/nagios.service; enabled; preset: enabled)
Active: activating (start) since Wed 2024-06-12 11:21:26 CEST; 2min 2s ago
Docs: https://www.nagios.org/documentation
Cntrl PID: 68221 (nagios)
Tasks: 8 (limit: 9247)
CPU: 128ms
CGroup: /system.slice/nagios.service
├─68221 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
├─68222 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─68223 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─68224 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─68225 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─68226 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
├─68227 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
└─68229 /usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68225;pid=68225
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68225;pid=68225
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68226;pid=68226
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68226;pid=68226
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68222;pid=68222
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68227;pid=68227
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68222;pid=68222
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68227;pid=68227
Jun 12 11:21:26 raspberrypi nagios[68221]: Successfully launched command file worker with pid 68229
Jun 12 11:21:26 raspberrypi nagios[68221]: Successfully launched command file worker with pid 68229
[journalctl xeu nagios.service]
The job identifier is 27341 and the job result is failed.
Jun 12 11:21:26 raspberrypi systemd[1]: nagios.service: Scheduled restart job, restart counter is at 4.
Subject: Automatic restarting of a unit has been scheduled
Defined-By: systemd
Support: https://www.debian.org/support
Automatic restarting of the unit nagios.service has been scheduled, as the result for
the configured Restart= setting for the unit.
Jun 12 11:21:26 raspberrypi systemd[1]: Stopped nagios.service - Nagios Core Monitoring Daemon.
Subject: A stop job for unit nagios.service has finished
Defined-By: systemd
Support: https://www.debian.org/support
A stop job for unit nagios.service has finished.
The job identifier is 27418 and the job result is done.
Jun 12 11:21:26 raspberrypi systemd[1]: Starting nagios.service - Nagios Core Monitoring Daemon...
Subject: A start job for unit nagios.service has begun execution
Defined-By: systemd
Support: https://www.debian.org/support
A start job for unit nagios.service has begun execution.
The job identifier is 27418.
Jun 12 11:21:26 raspberrypi nagios[68221]: Nagios 4.4.14 starting... (PID=68221)
Jun 12 11:21:26 raspberrypi nagios[68221]: Local time is Wed Jun 12 11:21:26 CEST 2024
Jun 12 11:21:26 raspberrypi nagios[68221]: Nagios Core 4.4.14
Jun 12 11:21:26 raspberrypi nagios[68221]: Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Jun 12 11:21:26 raspberrypi nagios[68221]: Copyright (c) 1999-2009 Ethan Galstad
Jun 12 11:21:26 raspberrypi nagios[68221]: Last Modified: 2023-08-01
Jun 12 11:21:26 raspberrypi nagios[68221]: License: GPL
Jun 12 11:21:26 raspberrypi nagios[68221]: Website: https://www.nagios.org
Jun 12 11:21:26 raspberrypi nagios[68221]: Nagios 4.4.14 starting... (PID=68221)
Jun 12 11:21:26 raspberrypi nagios[68221]: Local time is Wed Jun 12 11:21:26 CEST 2024
Jun 12 11:21:26 raspberrypi nagios[68221]: LOG VERSION: 2.0
Jun 12 11:21:26 raspberrypi nagios[68221]: qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
Jun 12 11:21:26 raspberrypi nagios[68221]: qh: core query handler registered
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Successfully registered manager as @wproc with query handler
Jun 12 11:21:26 raspberrypi nagios[68221]: qh: echo service query handler registered
Jun 12 11:21:26 raspberrypi nagios[68221]: qh: help for the query handler registered
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Successfully registered manager as @wproc with query handler
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68223;pid=68223
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68223;pid=68223
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68224;pid=68224
Jun 12 11:21:26 raspberrypi nagios[68221]: wproc: Registry request: name=Core Worker 68224;pid=68224
i hope someone can help me get at least the core service started
thanks in advance d3rek
Nagios Core won't start
Re: Nagios Core won't start
Hello @d3rek,
Have you verified that your configuration is valid before trying to start Nagios Core? You can verify this via the command line with
You can also check the Nagios Core logs located at /usr/local/nagios/var/nagios.log
I hope that helps!
Have you verified that your configuration is valid before trying to start Nagios Core? You can verify this via the command line with
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgI hope that helps!
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Re: Nagios Core won't start
Thank you bbahn.
I verified my configuration and it looked fine.
So i looked into the .log and found:
[1718285570] Local time is Thu Jun 13 15:32:50 CEST 2024
[1718285570] LOG VERSION: 2.0
[1718285570] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1718285570] qh: core query handler registered
[1718285570] qh: echo service query handler registered
[1718285570] qh: help for the query handler registered
[1718285570] wproc: Successfully registered manager as @wproc with query handler
[1718285570] wproc: Registry request: name=Core Worker 85061;pid=85061
[1718285570] wproc: Registry request: name=Core Worker 85056;pid=85056
[1718285570] wproc: Registry request: name=Core Worker 85057;pid=85057
[1718285570] wproc: Registry request: name=Core Worker 85058;pid=85058
[1718285570] wproc: Registry request: name=Core Worker 85060;pid=85060
[1718285570] wproc: Registry request: name=Core Worker 85059;pid=85059
[1718285570] Successfully launched command file worker with pid 85062
[1718285911] Auto-save of retention data completed successfully.
[1718286170] Caught SIGTERM, shutting down...
[1718286170] Caught SIGTERM, shutting down...
[1718286170] Successfully shutdown... (PID=85055)
[1718286171] Nagios 4.4.14 starting... (PID=85177)
[1718286171] Local time is Thu Jun 13 15:42:51 CEST 2024
[1718286171] LOG VERSION: 2.0
[1718286171] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1718286171] qh: core query handler registered
[1718286171] qh: echo service query handler registered
[1718286171] qh: help for the query handler registered
[1718286171] wproc: Successfully registered manager as @wproc with query handler
[1718286171] wproc: Registry request: name=Core Worker 85178;pid=85178
[1718286171] wproc: Registry request: name=Core Worker 85181;pid=85181
[1718286171] wproc: Registry request: name=Core Worker 85182;pid=85182
[1718286171] wproc: Registry request: name=Core Worker 85180;pid=85180
[1718286171] wproc: Registry request: name=Core Worker 85179;pid=85179
[1718286171] wproc: Registry request: name=Core Worker 85183;pid=85183
[1718286171] Successfully launched command file worker with pid 85184
Interesting enough it didn't get the "caught SIGTERM, shutting down" on the last try where it just stopped.
I looked into another topic from 27.may.15 and i don't have any brokers installed but i don't know where to find the init.d script.
I looked in the init.d directory but i didn't see any skript for nagios.
-rwxr-xr-x 1 root root 5623 Nov 30 2022 alsa-utils
-rwxr-xr-x 1 root root 8139 Apr 5 14:00 apache2
-rwxr-xr-x 1 root root 2489 Oct 11 2023 apache-htcacheclean
-rwxr-xr-x 1 root root 3740 Feb 14 2023 apparmor
-rwxr-xr-x 1 root root 2948 Dec 10 2023 bluetooth
-rwxr-xr-x 1 root root 1235 May 30 2023 console-setup.sh
-rwxr-xr-x 1 root root 3059 Jul 17 2022 cron
-rwxr-xr-x 1 root root 2804 Dec 1 2023 cups
-rwxr-xr-x 1 root root 1961 May 19 2023 cups-browsed
-rwxr-xr-x 1 root root 3152 Sep 16 2023 dbus
-rwxr-xr-x 1 root root 2198 Oct 24 2016 dphys-swapfile
-rwxr-xr-x 1 root root 824 Sep 5 2014 fake-hwclock
-rwxr-xr-x 1 root root 734 Nov 28 2022 fio
-rwxr-xr-x 1 root root 2667 Apr 28 2018 gpm
-rwxr-xr-x 1 root root 1748 Feb 13 2023 hwclock.sh
-rwxr-xr-x 1 root root 1482 Jul 18 2022 keyboard-setup.sh
-rwxr-xr-x 1 root root 2063 Dec 9 2022 kmod
-rwxr-xr-x 1 root root 2610 Jan 11 2022 lightdm
-rwxr-xr-x 1 root root 1364 May 13 2023 netfilter-persistent
-rwxr-xr-x 1 root root 4531 Jan 23 2023 networking
-rwxr-xr-x 1 root root 5658 Jan 11 2023 nfs-common
-rwxr-xr-x 1 root root 1386 Feb 1 2023 plymouth
-rwxr-xr-x 1 root root 760 Feb 1 2023 plymouth-log
-rwxr-xr-x 1 root root 959 Dec 19 2022 procps
-rwxr-xr-x 1 root root 469 Sep 22 2022 pulseaudio-enable-autospawn
-rwxr-xr-x 1 root root 1999 Oct 4 2023 raspi-config
-rwxr-xr-x 1 root root 2505 Jul 27 2022 rpcbind
-rwxr-xr-x 1 root root 4417 Dec 18 2022 rsync
-rwxr-xr-x 1 root root 2224 May 16 2023 saned
-rwxr-xr-x 1 root root 4060 Dec 19 13:55 ssh
-rwxr-xr-x 1 root root 1161 Jun 27 2023 sudo
-rwxr-xr-x 1 root root 3217 Aug 30 2016 triggerhappy
-rwxr-xr-x 1 root root 6871 Jan 26 22:46 udev
-rwxr-xr-x 1 root root 2762 Aug 18 2021 x11-common
-rwxr-xr-x 1 root root 7294 Dec 20 2022 xrdp
is any of these entries the init.d skript?
Or maybe there is another method to fix this problem
I verified my configuration and it looked fine.
So i looked into the .log and found:
[1718285570] Local time is Thu Jun 13 15:32:50 CEST 2024
[1718285570] LOG VERSION: 2.0
[1718285570] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1718285570] qh: core query handler registered
[1718285570] qh: echo service query handler registered
[1718285570] qh: help for the query handler registered
[1718285570] wproc: Successfully registered manager as @wproc with query handler
[1718285570] wproc: Registry request: name=Core Worker 85061;pid=85061
[1718285570] wproc: Registry request: name=Core Worker 85056;pid=85056
[1718285570] wproc: Registry request: name=Core Worker 85057;pid=85057
[1718285570] wproc: Registry request: name=Core Worker 85058;pid=85058
[1718285570] wproc: Registry request: name=Core Worker 85060;pid=85060
[1718285570] wproc: Registry request: name=Core Worker 85059;pid=85059
[1718285570] Successfully launched command file worker with pid 85062
[1718285911] Auto-save of retention data completed successfully.
[1718286170] Caught SIGTERM, shutting down...
[1718286170] Caught SIGTERM, shutting down...
[1718286170] Successfully shutdown... (PID=85055)
[1718286171] Nagios 4.4.14 starting... (PID=85177)
[1718286171] Local time is Thu Jun 13 15:42:51 CEST 2024
[1718286171] LOG VERSION: 2.0
[1718286171] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1718286171] qh: core query handler registered
[1718286171] qh: echo service query handler registered
[1718286171] qh: help for the query handler registered
[1718286171] wproc: Successfully registered manager as @wproc with query handler
[1718286171] wproc: Registry request: name=Core Worker 85178;pid=85178
[1718286171] wproc: Registry request: name=Core Worker 85181;pid=85181
[1718286171] wproc: Registry request: name=Core Worker 85182;pid=85182
[1718286171] wproc: Registry request: name=Core Worker 85180;pid=85180
[1718286171] wproc: Registry request: name=Core Worker 85179;pid=85179
[1718286171] wproc: Registry request: name=Core Worker 85183;pid=85183
[1718286171] Successfully launched command file worker with pid 85184
Interesting enough it didn't get the "caught SIGTERM, shutting down" on the last try where it just stopped.
I looked into another topic from 27.may.15 and i don't have any brokers installed but i don't know where to find the init.d script.
I looked in the init.d directory but i didn't see any skript for nagios.
-rwxr-xr-x 1 root root 5623 Nov 30 2022 alsa-utils
-rwxr-xr-x 1 root root 8139 Apr 5 14:00 apache2
-rwxr-xr-x 1 root root 2489 Oct 11 2023 apache-htcacheclean
-rwxr-xr-x 1 root root 3740 Feb 14 2023 apparmor
-rwxr-xr-x 1 root root 2948 Dec 10 2023 bluetooth
-rwxr-xr-x 1 root root 1235 May 30 2023 console-setup.sh
-rwxr-xr-x 1 root root 3059 Jul 17 2022 cron
-rwxr-xr-x 1 root root 2804 Dec 1 2023 cups
-rwxr-xr-x 1 root root 1961 May 19 2023 cups-browsed
-rwxr-xr-x 1 root root 3152 Sep 16 2023 dbus
-rwxr-xr-x 1 root root 2198 Oct 24 2016 dphys-swapfile
-rwxr-xr-x 1 root root 824 Sep 5 2014 fake-hwclock
-rwxr-xr-x 1 root root 734 Nov 28 2022 fio
-rwxr-xr-x 1 root root 2667 Apr 28 2018 gpm
-rwxr-xr-x 1 root root 1748 Feb 13 2023 hwclock.sh
-rwxr-xr-x 1 root root 1482 Jul 18 2022 keyboard-setup.sh
-rwxr-xr-x 1 root root 2063 Dec 9 2022 kmod
-rwxr-xr-x 1 root root 2610 Jan 11 2022 lightdm
-rwxr-xr-x 1 root root 1364 May 13 2023 netfilter-persistent
-rwxr-xr-x 1 root root 4531 Jan 23 2023 networking
-rwxr-xr-x 1 root root 5658 Jan 11 2023 nfs-common
-rwxr-xr-x 1 root root 1386 Feb 1 2023 plymouth
-rwxr-xr-x 1 root root 760 Feb 1 2023 plymouth-log
-rwxr-xr-x 1 root root 959 Dec 19 2022 procps
-rwxr-xr-x 1 root root 469 Sep 22 2022 pulseaudio-enable-autospawn
-rwxr-xr-x 1 root root 1999 Oct 4 2023 raspi-config
-rwxr-xr-x 1 root root 2505 Jul 27 2022 rpcbind
-rwxr-xr-x 1 root root 4417 Dec 18 2022 rsync
-rwxr-xr-x 1 root root 2224 May 16 2023 saned
-rwxr-xr-x 1 root root 4060 Dec 19 13:55 ssh
-rwxr-xr-x 1 root root 1161 Jun 27 2023 sudo
-rwxr-xr-x 1 root root 3217 Aug 30 2016 triggerhappy
-rwxr-xr-x 1 root root 6871 Jan 26 22:46 udev
-rwxr-xr-x 1 root root 2762 Aug 18 2021 x11-common
-rwxr-xr-x 1 root root 7294 Dec 20 2022 xrdp
is any of these entries the init.d skript?
Or maybe there is another method to fix this problem
Re: Nagios Core won't start
@d3rek, I don't think Nagios Core has had an init.d script in a while and I'm not really sure what your issue is. If you would like more in-depth support, you can create a ticket at https://answerhub.nagios.com/support/s/
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.