Page 1 of 1

Can not start Nagios Service

Posted: Fri Jun 07, 2019 8:57 pm
by mijretrop
Hello All, I just recently started in this IT department, I have close to zero experience with Ubuntu/Linux and had barely heard of Nagios before I got here (my last IT job was when Vista was new) but the guy I replaced was a big Linux fan so I inherited his processes.

I've been searching for over 4 hours for a resolution to this and nearly everything I find doesn't match up to the environment my predecessor left me with so I am REALLY hoping to find some help as I currently have no monitoring in place.

I tried to remove a server that is no longer active from the linuxhosts.cfg file. I've done it a few times with no issues but for some reason this time the Nagios3 service would not start again (yes nagios3 is the service that was running just fine until today).

When the service wouldn't restart I replaced the file i changed with the back up file i created but it still would not start

The only thing I could find from HOURS of looking at documentation was sudo journalctl -xn

Which gave me:

Code: Select all

-- Logs begin at Wed 2019-01-02 09:04:23 PST, end at Fri 2019-06-07 18:50:09 PDT. --
Jun 07 18:50:06 is-14s nagios3[3752]:      the HTML documentation regarding the config files, as well as the
Jun 07 18:50:06 is-14s systemd[1]: nagios3.service: Control process exited, code=exited status=1
Jun 07 18:50:06 is-14s nagios3[3752]:      'Whats New' section to find out what has changed.
Jun 07 18:50:06 is-14s systemd[1]: nagios3.service: Failed with result 'exit-code'.
Jun 07 18:50:06 is-14s nagios3[3752]:  * errors in config!
Jun 07 18:50:06 is-14s nagios3[3752]:    ...fail!
Jun 07 18:50:06 is-14s systemd[1]: Failed to start LSB: nagios host/service/network monitoring and management system.
-- Subject: Unit nagios3.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit nagios3.service has failed.
--
-- The result is RESULT.
Jun 07 18:50:06 is-14s sudo[3719]: pam_unix(sudo:session): session closed for user root
Jun 07 18:50:09 is-14s sudo[3772]: cedarsadmin : TTY=pts/0 ; PWD=/etc/nagios3 ; USER=root ; COMMAND=/bin/journalctl -xn
Jun 07 18:50:09 is-14s sudo[3772]: pam_unix(sudo:session): session opened for user root by cedarsadmin(uid=0)
cedarsadmin@is-14s:/etc/nagios3$
This is the error I get when i try Sudo Service nagios3 start

Code: Select all

Job for nagios3.service failed because the control process exited with error code.
See "systemctl status nagios3.service" and "journalctl -xe" for details.
I'm fairly certain it must have something to do with the last file I touched (linuxhosts.cfg) but I'm not sure and obviously can't post that file here for the world to see.

Any help is GREATLy appreciated.

Re: Can not start Nagios Service

Posted: Mon Jun 10, 2019 9:27 am
by tgriep
You can run a verification against the nagios configs to see what the errors are so you can try and fix them.

The following example is hot to run it from the command line. (Adjust the paths to your environment)

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
That should print out the config error and which file it is in so you can edit and fix the error.

View this site under the "Verifying your configuration" section for more details if needed.
https://assets.nagios.com/downloads/nag ... n/toc.html

Re: Can not start Nagios Service

Posted: Mon Jun 10, 2019 6:38 pm
by mijretrop
There were so many odd variables that I ended up just starting over on a new machine with Nagios 4. Now I just can't get the e-mail to work. I'll start a new topic, thanks for the help.

Re: Can not start Nagios Service

Posted: Tue Jun 11, 2019 8:44 am
by scottwilkerson
mijretrop wrote:There were so many odd variables that I ended up just starting over on a new machine with Nagios 4. Now I just can't get the e-mail to work. I'll start a new topic, thanks for the help.
Sounds good.

Locking this thread