Page 1 of 1

Nagios fails after systemctl restart nagios

PostPosted: Tue Aug 02, 2022 4:45 am
by supmethods
Nagios fails when I do a systemctl restart nagios. I have to reboot it to get it to work again. Here's the log.

Code: Select all
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Copyright (c) 1999-2009 Ethan Galstad
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Last Modified: 2022-04-14
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: License: GPL
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Website: https://www.nagios.org
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Reading configuration data...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:    Read main config file okay...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:    Read object config files okay...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Running pre-flight check on configuration data...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Checking objects...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 8 services.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 1 hosts.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 1 host groups.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 0 service groups.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 1 contacts.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 1 contact groups.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 24 commands.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 5 time periods.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 0 host escalations.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 0 service escalations.
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Checking for circular paths...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 1 hosts
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 0 service dependencies
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 0 host dependencies
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]:         Checked 5 timeperiods
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Checking global event handlers...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Checking obsessive compulsive processor commands...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Checking misc settings...
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Total Warnings: 0
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Total Errors:   0
Aug 02 19:40:14 alma8.innovisage.local nagios[1759]: Things look okay - No serious problems were detected during the pre-flight check
Aug 02 19:40:14 alma8.innovisage.local systemd[1]: Started Nagios Core 4.4.7.
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: Nagios 4.4.7 starting... (PID=1762)
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: Local time is Tue Aug 02 19:40:14 AEST 2022
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: LOG VERSION: 2.0
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: qh: core query handler registered
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: qh: echo service query handler registered
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: qh: help for the query handler registered
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: wproc: Successfully registered manager as @wproc with query handler
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: wproc: Registry request: name=Core Worker 1766;pid=1766
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: wproc: Registry request: name=Core Worker 1764;pid=1764
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: wproc: Registry request: name=Core Worker 1763;pid=1763
Aug 02 19:40:14 alma8.innovisage.local nagios[1762]: wproc: Registry request: name=Core Worker 1765;pid=1765
Aug 02 19:40:15 alma8.innovisage.local nagios[1762]: Caught SIGSEGV, shutting down...
Aug 02 19:40:15 alma8.innovisage.local systemd[1]: nagios.service: Main process exited, code=exited, status=254/n/a
Aug 02 19:40:17 alma8.innovisage.local systemd[1]: nagios.service: Failed with result 'exit-code'.

Re: Nagios fails after systemctl restart nagios

PostPosted: Tue Aug 02, 2022 5:03 am
by supmethods
Disabling updates seems to solve the problem
Code: Select all
check_for_updates=0

Re: Nagios fails after systemctl restart nagios

PostPosted: Mon Aug 08, 2022 2:20 am
by BremdanJohnso
I am running Nagios Core 4.2.0 to monitor hosts and services via Check_MK plugin. This is running on a VM. Once I rebooted, I cannot get a PID for Nagios.

root@hostname:/etc/init.d# service nagios status
‚óŹ nagios.service - Nagios
Loaded: loaded (/etc/systemd/system/nagios.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code)
Process: 2369 ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)
Main PID: 2369 (code=exited, status=1/FAILURE)

Aug 8 09:09:34 hostname systemd[1]: Started Nagios.
Aug 8 09:09:34 hostname systemd[1]: nagios.service: Main process exited, code=exited, status=1/FAILURE
Aug 8 09:09:34 hostname systemd[1]: nagios.service: Unit entered failed state.
Aug 8 09:09:34 hostname systemd[1]: nagios.service: Failed with result 'exit-code'.
Is there a way to get this PID to run? I am not sure how a simple reboot can make this go bad.