Page 1 of 2

Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Mon Apr 27, 2015 6:16 pm
by lvlammert
Recently upgraded a 3.5.1 machine to 4.1RC1, and I thought everything was OK until last Friday when there was a power issue; the server rebooted and I could not get Nagios started.

service nagios start consistently returns:

# service nagios status
nagios.service - LSB: Starts and stops the Nagios monitoring server
Loaded: loaded (/etc/init.d/nagios)
Active: active (exited) since Mon 2015-04-27 17:51:55 CDT; 14min ago
Process: 1848 ExecStart=/etc/init.d/nagios start (code=exited, status=0/SUCCESS)

Apr 27 17:51:55 WTNagios nagios[1848]: Starting nagios: done.

Went looking and found a bunch of the old Startup forum threads, .. so I tried to start manually, failure:

[1430175183] Failed to obtain lock on file /var/run/nagios/nagios.pid: No such file or directory
[1430175183] Bailing out due to errors encountered while attempting to daemonize... (PID=1927)permission issues

Had to *manually* create /var/run/nagios with ownership nagios:nagios, start successful. Tried a reboot, /var/run/nagios directory gone, same problem. Able to manually start, however, after creating /var/run/nagios again.

The init script still reports active (exited) even though Nagios is running [after starting manually]:

# ps ax | grep nagios
2115 ? Ss 0:01 /usr/local/nagios/bin/nagios -d /etc/nagios/nagios.cfg
2120 ? S 0:00 /usr/local/nagios/bin/nagios -d /etc/nagios/nagios.cfg
2879 ? S 0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
2880 ? S 0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
2881 ? S 0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh
2882 ? S 0:00 /usr/local/nagios/bin/nagios --worker /usr/local/nagios/var/rw/nagios.qh

Be happy to assist in any way we can, ... is anyone working on SuSE or RH?

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 11:09 am
by tmcdonald
The first thing you should do is post this to the Nagios Core Github: https://github.com/NagiosEnterprises/nagioscore/issues

The Core devs handle most of their issues through Github, so posting there will get it on their radar.

Can you post the init script here as an attachment?

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 11:18 am
by lvlammert
Can do, .. here is the current script.

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 11:31 am
by tmcdonald
Looks like you have not attached anything. Can you make sure to upload after selecting the file?

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 11:34 am
by lvlammert
I attached it, .. but did not notice the "this extension is not allowed"???

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 11:52 am
by lvlammert
Doing some more research, .. it appears the issue may be the migration to systemd, .. if so, would not an option in the source tree be beneficial? [Will update issue on github.]

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 4:45 pm
by jdalrymple
Since the traditional init scripts are still working in EL7 the transition to systemd hasn't been finalized for Core. It's definitely on the roadmap to add it. You've gone the right direction by documenting it on github.

Do init scripts no longer work at all in SUSE? The *BIGGEST* hangup with our full transition to systemd proper is that a lot of the components within our other commercial product NagiosXI relies on the init scripts for the time being, we need them to continue to work.

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Tue Apr 28, 2015 4:59 pm
by lvlammert
Do init scripts no longer work at all in SUSE?
It appears that 13.2 is a major transition, .. for example, there are 30 files in init.d on 13.2, whereas 13.1 has about 70. Most of the entries in a 13.2 installation are avahi, boot.___, ppoe, raw, rpmconfigcheck, snmp, & xfs.

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Wed Apr 29, 2015 9:18 am
by jdalrymple
Same with EL7, but the init scripts are still 100% backward compatible.

/etc/init.d/README on CentOS 7.0:

Code: Select all

You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?

Here's an explanation on what's going on:

You are running a systemd-based OS where traditional init scripts have
been replaced by native systemd services files. Service files provide
very similar functionality to init scripts. To make use of service
files simply invoke "systemctl", which will output a list of all
currently running services (and other units). Use "systemctl
list-unit-files" to get a listing of all known unit files, including
stopped, disabled and masked ones. Use "systemctl start
foobar.service" and "systemctl stop foobar.service" to start or stop a
service, respectively. For further details, please refer to
systemctl(1).

Note that traditional init scripts continue to function on a systemd
system. An init script /etc/rc.d/init.d/foobar is implicitly mapped
into a service unit foobar.service during system initialization.

Thank you!

Further reading:
        man:systemctl(1)
        man:systemd(1)
        http://0pointer.de/blog/projects/systemd-for-admins-3.html
        http://www.freedesktop.org/wiki/Software/systemd/Incompatibilities

Re: Nagios 4 (4.10 RC1) Startup (SuSE 13.2)

Posted: Wed Apr 29, 2015 9:25 am
by lvlammert
You are looking for the traditional init scripts in /etc/rc.d/init.d,
and they are gone?
No, some are still there - I was just reporting the differences.

If init scripts are still supposed to work, why does the nagios init script not? Is there a way to get the nagios init script running on systemd?