No autostart on Nagios after OS upgrade

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pelle_viktor
Posts: 6
Joined: Thu Aug 03, 2017 4:17 am

No autostart on Nagios after OS upgrade

Post by pelle_viktor »

Hello,

I recently upgraded my Nagios Core 4.4.5 server from Ubuntu Server 16.04 to Ubuntu Server 18.04. The Nagios install was made from source. The upgrade went fine and Nagios works on 18.04. There is one small issue though. The Nagios process doesn't autostart on boot. I have to start it manually and then everything works as normal. I'm quite sure this is no problem related to Nagios, it's probably some configuration in the operating system. But I can't figure it out. Maybe anyone here have experienced the same.

I use this to start the service "sudo systemctl start nagios.service" and it gives me no errors. So there are no problems starting the service. I have checked the logs when booting with journalctl and I can't see any errors there either. I can't see any reference that the OS is trying to start the service at all so I guess the service is not enabled or something. The output of "sudo systemctl status nagios.service" on 16.04 shows this:

Code: Select all

Loaded: loaded (/etc/init.d/nagios; bad; vendor preset: enabled)
The same output on 18.04 however shows this:

Code: Select all

Loaded: loaded (/etc/init.d/nagios; generated)
So it doesn't look enabled. However this is the output of "sudo systemctl is-enabled nagios.service"

Code: Select all

nagios.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled nagios
enabled
There it says "enabled". But I guess something must have happened with the service during the upgrade process. When I try to enable the service I get this:

Code: Select all

nagios.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nagios
update-rc.d: error: no runlevel symlinks to modify, aborting!
I'm not sure how to proceed from here. Does anyone of you have a clue on what's going on?
pelle_viktor
Posts: 6
Joined: Thu Aug 03, 2017 4:17 am

Re: No autostart on Nagios after OS upgrade

Post by pelle_viktor »

I have solved it now. The solution was to install Nagios Core 4.4.6 (reinstall of 4.4.5 would probably also have worked). Then run "make install-init" and then "sudo systemctl reenable nagios.service". Now the nagios service starts automatically after a reboot. This topic can be closed.
Locked