Page 1 of 2

Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 12:18 pm
by blariv
Nagios XI version: 5.5.7
XI installed from: source
XI UUID: c32d835d-6ff5-46be-9267-9f927af5ef8a
Release info: nagiosxi.na.hasbro.com 3.10.0-957.el7.x86_64 x86_64
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Gnome is not installed

upgraded last week and all was fine.

I was applying the config afterwards for some new services on hosts and now getting this error on starting nagios.

Job for nagios.service failed because a configured resource limit was exceeded. See "systemctl status nagios.service" and "journalctl -xe" for details.

[root@nagiosxi ~]# systemctl status nagios.service
● nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
Active: failed (Result: resources) since Mon 2018-11-19 12:16:24 EST; 1min 20s ago
Docs: man:systemd-sysv-generator(8)
Process: 29574 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)

Nov 19 12:16:21 nagiosxi.na.hasbro.com systemd[1]: Starting LSB: Starts and stops the Nagios monitoring server...
Nov 19 12:16:24 nagiosxi.na.hasbro.com nagios[29714]: Failed to obtain lock on file /var/run/nagios.lock: Permission denied
Nov 19 12:16:24 nagiosxi.na.hasbro.com nagios[29574]: Starting nagios: done.
Nov 19 12:16:24 nagiosxi.na.hasbro.com systemd[1]: Failed to read PID from file /usr/local/nagios/var/nagios.lock: Invalid argument
Nov 19 12:16:24 nagiosxi.na.hasbro.com systemd[1]: Failed to start LSB: Starts and stops the Nagios monitoring server.
Nov 19 12:16:24 nagiosxi.na.hasbro.com systemd[1]: Unit nagios.service entered failed state.
Nov 19 12:16:24 nagiosxi.na.hasbro.com systemd[1]: nagios.service failed

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 12:21 pm
by scottwilkerson
can you post the output of the following

Code: Select all

grep nagios.lock /etc/init.d/nagios
grep nagios.lock /usr/local/nagios/etc/nagios.cfg

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 12:25 pm
by blariv
[root@nagiosxi ~]# grep nagios.lock /etc/init.d/nagios
# pidfile: /usr/local/nagios/var/nagios.lock
NagiosRunFile=${prefix}/var/nagios.lock
[root@nagiosxi ~]# grep nagios.lock /usr/local/nagios/etc/nagios.cfg
lock_file=/var/run/nagios.lock
[root@nagiosxi ~]#

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 12:54 pm
by lmiltchev
The path to the nagios.lock should be the same in the nagios init file and nagios.cfg.

Comment out this line in the /etc/init.d/nagios file:

Code: Select all

# NagiosRunFile=${prefix}/var/nagios.lock
and add the following one below it:

Code: Select all

NagiosRunFile=/var/run/nagios.lock
You may need to also remove the nagios.lock:

Code: Select all

rm -f /usr/local/nagios/var/nagios.lock /var/run/nagios.lock
before starting nagios:

Code: Select all

systemctl start nagios.service
Let us know if this helped.

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 1:06 pm
by blariv
[root@nagiosxi ~]# systemctl start nagios.service
Warning: nagios.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 1:18 pm
by lmiltchev
Run:

Code: Select all

systemctl daemon-reload
then:

Code: Select all

systemctl restart nagios.service
Is nagios running now?

Code: Select all

systemctl status nagios.service

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 2:12 pm
by blariv
still not starting.

it just sits at starting nagios. I have rebooted a few times in between.

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 2:15 pm
by blariv
[root@nagiosxi ~]# systemctl status nagios.service
● nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
Active: failed (Result: timeout) since Mon 2018-11-19 14:14:18 EST; 34s ago
Docs: man:systemd-sysv-generator(8)
Process: 19533 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 2:35 pm
by lmiltchev
There have been some cases, where there weren't sufficient permissions on the /var/run directory for some users, depending on their specific environment. If this is the case here, you could try changing the path to the nagios.lock file again, this time to /usr/local/nagios/var/nagios.lock.

Remove this line from /etc/init.d/nagios:

Code: Select all

NagiosRunFile=/var/run/nagios.lock
and un-comment this line:

Code: Select all

NagiosRunFile=${prefix}/var/nagios.lock
Change this line in the /usr/local/nagios/etc/nagios.cfg file from this:

Code: Select all

lock_file=/var/run/nagios.lock
to this:

Code: Select all

lock_file=/usr/local/nagios/var/nagios.lock
Remove lock files:

Code: Select all

rm -f /usr/local/nagios/var/nagios.lock /var/run/nagios.lock
and restart nagios:

Code: Select all

systemctl daemon-reload
systemctl start nagios.service

Re: Version 5.5.7 Monitoring Engine Won't Start

Posted: Mon Nov 19, 2018 2:42 pm
by blariv
now we are good to go!!

as usual thanks for the great support

[root@nagiosxi ~]# systemctl status nagios.service
● nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/rc.d/init.d/nagios; bad; vendor preset: disabled)
Active: active (running) since Mon 2018-11-19 14:40:02 EST; 7s ago
Docs: man:systemd-sysv-generator(8)
Process: 78631 ExecStart=/etc/rc.d/init.d/nagios start (code=exited, status=0/SUCCESS)
Main PID: 78657 (nagios)