Page 1 of 1

nagios.service failed [Error]

Posted: Wed Dec 09, 2015 4:54 pm
by Dradden
Hi all,

I followed the guide from Digital Ocean: https://www.digitalocean.com/community/ ... n-centos-7

I get to the part where it is time to: sudo systemctl start nagios.service

I get the error:

Job for nagios.service failed. See 'systemctl status nagios.service' and 'journalctl -xn' for details.

'systemctl status nagios.service returns:

Code: Select all

[naggy@vps61651 ~]$ sudo systemctl status nagios.service
nagios.service - LSB: Starts and stops the Nagios monitoring server
   Loaded: loaded (/etc/rc.d/init.d/nagios)
   Active: failed (Result: exit-code) since Wed 2015-12-09 16:50:32 EST; 50s ago
  Process: 1081 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=8)

Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: ***> One or more problems was encountered while processing the config files...
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: Check your configuration file(s) to ensure that they contain valid
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: directives and data defintions.  If you are upgrading from a previous
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: version of Nagios, you should be aware that some variables/definitions
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: may have been removed or modified in this version.  Make sure to read
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: the HTML documentation regarding the config files, as well as the
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: 'Whats New' section to find out what has changed.
Dec 09 16:50:32 vps61651.vps.ovh.ca systemd[1]: nagios.service: control process exited, code=exited status=8
Dec 09 16:50:32 vps61651.vps.ovh.ca systemd[1]: Failed to start LSB: Starts and stops the Nagios monitoring server.
Dec 09 16:50:32 vps61651.vps.ovh.ca systemd[1]: Unit nagios.service entered failed state.
I have checked and double checked the edited config files and I see nothing wrong, don't get it.

journalctl -xn returns:

Code: Select all

-- Logs begin at Wed 2015-12-09 16:46:28 EST, end at Wed 2015-12-09 16:52:32 EST. --
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: directives and data defintions.  If you are upgrading from a previous
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: version of Nagios, you should be aware that some variables/definitions
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: may have been removed or modified in this version.  Make sure to read
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: the HTML documentation regarding the config files, as well as the
Dec 09 16:50:32 vps61651.vps.ovh.ca nagios[1081]: 'Whats New' section to find out what has changed.
Dec 09 16:50:32 vps61651.vps.ovh.ca systemd[1]: nagios.service: control process exited, code=exited status=8
Dec 09 16:50:32 vps61651.vps.ovh.ca systemd[1]: Failed to start LSB: Starts and stops the Nagios monitoring server.
-- Subject: Unit nagios.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nagios.service has failed.
--
-- The result is failed.
Dec 09 16:50:32 vps61651.vps.ovh.ca systemd[1]: Unit nagios.service entered failed state.
Dec 09 16:51:22 vps61651.vps.ovh.ca sudo[1097]: naggy : TTY=pts/0 ; PWD=/home/naggy ; USER=root ; COMMAND=/bin/systemctl status nagios.service
Dec 09 16:52:32 vps61651.vps.ovh.ca sudo[1100]: naggy : TTY=pts/0 ; PWD=/home/naggy ; USER=root ; COMMAND=/bin/journalctl -xn
Is there a way to get more detailed output, maybe down to a line that is causing the issue? Or maybe somebody knows by looking at this the issue?

Re: nagios.service failed [Error]

Posted: Wed Dec 09, 2015 5:04 pm
by rkennedy
Can you run the following command and post the output?

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Re: nagios.service failed [Error]

Posted: Wed Dec 09, 2015 5:44 pm
by Dradden
That's what I was missing!

Code: Select all

Reading configuration data...
   Read main config file okay...
Error: Could not open config directory '/usr/local/nagios/etc/servers' for reading.
   Error processing object config files!
sudo mkdir /usr/local/nagios/etc/servers

Fixed. Thanks :D

Re: nagios.service failed [Error]

Posted: Wed Dec 09, 2015 6:07 pm
by rkennedy
Glad to see this working! I will now close this thread out, but feel free to open a new one if you ever need assistance.