Cannot start nagios automatically

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Cannot start nagios automatically

Postby sebastiaopburnay » Thu Apr 20, 2017 8:50 am

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 =[url] viewtopic.php?f=7&t=11511
[/url]
User avatar
sebastiaopburnay
 
Posts: 103
Joined: Sun Oct 31, 2010 1:40 pm
Location: Lisbon, Portugal

Re: Cannot start nagios automatically

Postby tgriep » Thu Apr 20, 2017 3:46 pm

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!
User avatar
tgriep
Madmin
 
Posts: 5653
Joined: Thu Oct 30, 2014 9:02 am

Re: Cannot start nagios automatically

Postby dwhitfield » Thu Apr 20, 2017 3:53 pm

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
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3252
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC

Re: Cannot start nagios automatically

Postby sebastiaopburnay » Fri Apr 21, 2017 4:12 am

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: 103
Joined: Sun Oct 31, 2010 1:40 pm
Location: Lisbon, Portugal

Re: Cannot start nagios automatically

Postby sebastiaopburnay » Fri Apr 21, 2017 4:23 am

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

Re: Cannot start nagios automatically

Postby dwhitfield » Fri Apr 21, 2017 8:01 am

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 3252
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC


Return to Nagios Core

Who is online

Users browsing this forum: Bing [Bot], mcapra, sartecat, tmattingly and 14 guests