Page 1 of 2

Error on nagios.service

Posted: Fri Jul 13, 2018 11:53 am
by parkpia
I'm new to Nagios and received the below error. Any help is appreciated. Thanks.

[root@HDCMON1 ~]# systemctl status nagios.service
● nagios.service - Nagios Core 4.4.1
Loaded: loaded (/usr/lib/systemd/system/nagios.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2018-07-12 16:52:37 PDT; 16h ago
Docs: https://www.nagios.org/documentation
Process: 1976 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)
Main PID: 8565 (code=exited, status=0/SUCCESS)

Jul 12 16:52:37 HDCMON1.deq.state.or.us nagios[1976]: Check your configuration file(s) to ensure that they contain valid
Jul 12 16:52:37 HDCMON1.deq.state.or.us nagios[1976]: directives and data definitions. If you are upgrading from a previous
Jul 12 16:52:37 HDCMON1.deq.state.or.us nagios[1976]: version of Nagios, you should be aware that some variables/definitions
Jul 12 16:52:37 HDCMON1.deq.state.or.us nagios[1976]: may have been removed or modified in this version. Make sure to read
Jul 12 16:52:37 HDCMON1.deq.state.or.us nagios[1976]: the HTML documentation regarding the config files, as well as the
Jul 12 16:52:37 HDCMON1.deq.state.or.us nagios[1976]: 'Whats New' section to find out what has changed.
Jul 12 16:52:37 HDCMON1.deq.state.or.us systemd[1]: nagios.service: control process exited, code=exited status=1
Jul 12 16:52:37 HDCMON1.deq.state.or.us systemd[1]: Failed to start Nagios Core 4.4.1.
Jul 12 16:52:37 HDCMON1.deq.state.or.us systemd[1]: Unit nagios.service entered failed state.
Jul 12 16:52:37 HDCMON1.deq.state.or.us systemd[1]: nagios.service failed.

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 12:35 pm
by jomann
This likely means that your configuration is not correct, if you run journalctl -xe next time you restart you should be able to see the whole message. Did you make any changes to your configuration on the system?

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 1:19 pm
by parkpia
I did "journalctl -xe", "systemctl stop Nagios", then "systemctl start Nagios". The message is:
Job for Nagios.service failed because the control process exited with error code. See "systemctl status Nagios.service" and "journalctl -xe" for details.

code=exited, status=1/FAILURE
Failed to start Nagios Core 4.4.1.
Unit Nagios.service entered failed state.
Nagios.service failed.

Help...!

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 1:27 pm
by jomann
You can just do a systemctl start nagios and then after it fails, do the journalctl -xe

You can also try to run the config check manually by running:

Code: Select all

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

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 1:42 pm
by parkpia
The line that shows error is:

polkitd[614]: Unregistered Authentication Agent for unix-process:44341:33495649 (system bus name: 1.1177

Does it help?

Thanks.

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 1:47 pm
by jomann
Do you have selinux or some other type of policy set up on this system? We disable and turn off selinux and must have the main process running as the nagios user. We also heavily use sudo.

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 1:59 pm
by parkpia
I am a new user as of this week, downloaded virtual appliance for Hyper-v and loaded. This VA has Redhat/apache I am not familiar with..

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 2:01 pm
by jomann
Well if you log in as the root user, or run through sudo the following command, you should get an output that shows you all about the Nagios Core configuration, which will let us know if you have a bad configuration - which is what the very first post had in the logs.

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Just run that command in the terminal, as root.

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 3:06 pm
by parkpia
When I ran it, got an error:

Cannot open main configuration file '/usr/localnagios/etc/Nagios.cfg/ for reading!

Re: Error on nagios.service

Posted: Fri Jul 13, 2018 3:41 pm
by jomann
Is that exactly what you ran? It is definitely case sensitive so you have to run the exact command.