[SOLVED] Cannot start nagios automatically

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
User avatar
sebastiaopburnay
Posts: 105
Joined: Sun Oct 31, 2010 1:40 pm
Location: Lisbon, Portugal

[SOLVED] Cannot start nagios automatically

Post by sebastiaopburnay »

Hi!

I've installed a nagios 4.3.1 on a 64 bit Ubuntu Server 16.04.

I can use the '/etc/init.d/nagios start' to start the nagios daemon and it works fine.

However, on boot, nagios does not start by itself.

When I try to run update-rc.d to register/enable nagios I get a warning I'm not understanding:

Code: Select all

root@srvtmsmon:~# update-rc.d nagios defaults
insserv: warning: current start runlevel(s) (2 3 4 5 S) of script `nagios' overrides LSB defaults (2 3 4 5).

root@srvtmsmon:~# update-rc.d nagios enable
insserv: warning: current start runlevel(s) (2 3 4 5 S) of script `nagios' overrides LSB defaults (2 3 4 5).
I have tried several init scripts:
a) the one created by the 'make install-init'
b) an altered version of the skeleton
c) a copies script from another host with nagios 4.x which works fine

I'm losing my imagination I couldn't find a post with an answer.

The closest I found was the one below, but it didn't work for me
ref = https://support.nagios.com/forum/viewt ... 7&t=11511
Last edited by sebastiaopburnay on Thu Nov 16, 2017 9:45 am, edited 2 times in total.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Cannot start nagios automatically

Post by tgriep »

Can you start nagios and enable it using systemctl?

Code: Select all

systemctl enable nagios.service
systemctl start nagios.service
Be sure to check out our Knowledgebase for helpful articles and solutions!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Cannot start nagios automatically

Post by dwhitfield »

If @tgriep's suggestion doesn't work, you may need to reinstall the init

Code: Select all

cd /tmp
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.3.1.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.3.1/
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
sudo make install-init
sudo update-rc.d nagios defaults
User avatar
sebastiaopburnay
Posts: 105
Joined: Sun Oct 31, 2010 1:40 pm
Location: Lisbon, Portugal

Re: Cannot start nagios automatically

Post by sebastiaopburnay »

tgriep wrote:Can you start nagios and enable it using systemctl?

Code: Select all

systemctl enable nagios.service
systemctl start nagios.service
I've tried but it made no diference:

Code: Select all

root@srvtmsmon:~# systemctl enable nagios.service
Synchronizing state of nagios.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable nagios
root@srvtmsmon:~# systemctl start nagios.service
root@srvtmsmon:~# ps -ef |grep nagios
root       1717   1591  0 10:10 pts/0    00:00:00 grep --color=auto nagios
root@srvtmsmon:~#
User avatar
sebastiaopburnay
Posts: 105
Joined: Sun Oct 31, 2010 1:40 pm
Location: Lisbon, Portugal

Re: Cannot start nagios automatically

Post by sebastiaopburnay »

dwhitfield wrote:If @tgriep's suggestion doesn't work, you may need to reinstall the init

Code: Select all

cd /tmp
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.3.1.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.3.1/
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
sudo make install-init
sudo update-rc.d nagios defaults
It didn't work either.

When I run the 'sudo update-rc.d nagios defaults', the terminal didn't complain about LSB defaults, but the service does not start on boot either.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Cannot start nagios automatically

Post by dwhitfield »

You may have done this but after going through my instructions use the enable command with systemctl. As long as it's registered with systemctl, enable should start it at boot.
User avatar
sebastiaopburnay
Posts: 105
Joined: Sun Oct 31, 2010 1:40 pm
Location: Lisbon, Portugal

Re: Cannot start nagios automatically

Post by sebastiaopburnay »

Ive trashed the previous VM, reinstalled Ubuntu and Nagios - SOLVED
kyang

Re: [SOLVED] Cannot start nagios automatically

Post by kyang »

Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!
Locked