Page 1 of 1

Nagios 4.3.2 not starting at boot up

Posted: Wed Jun 21, 2017 10:14 am
by t3dus
I have Nagios 4.3.2 running on a Raspberry PI 3 B on OS raspbian

I've ran the following commands to try to fix nagios starting on boot up but nothing fixes it.

Code: Select all

sudo ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
If I run

Code: Select all

sudo update-rc.d nagios defaults
it returns this:

Code: Select all

root@raspberrypi:~# sudo update-rc.d nagios defaults
insserv: warning: current start runlevel(s) (S) of script `nagios' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (empty) of script `nagios' overrides LSB defaults (0 1 6).
insserv: can not symlink(../init.d/nagios, ../rcS.d/S12nagios): File exists
any ideas on what i'm doing wrong?

Re: Nagios 4.3.2 not starting at boot up

Posted: Wed Jun 21, 2017 4:02 pm
by dwhitfield
Can you attach the two following files: /etc/init.d/nagios /etc/rcS.d/S99nagios

Also, what is the output of the following:

Code: Select all

ls -la /etc/init.d/nagios 
ls -la /etc/rcS.d/S99nagios
Lastly, do you have systemd available on your system?

Re: Nagios 4.3.2 not starting at boot up

Posted: Thu Jun 22, 2017 9:38 am
by t3dus
Uploaded "/etc/init.d/nagios" to dropbox (wouldn't let me attach it here) but I didn't find a file at the other path "/etc/rcS.d/S99nagios"

Output

Code: Select all

root@raspberrypi:~# ls -la /etc/init.d/nagios
-rwxr-xr-x 1 root root 8456 Jun 21 14:10 /etc/init.d/nagios

Code: Select all

root@raspberrypi:~# ls -la /etc/rcS.d/S99nagios
ls: cannot access /etc/rcS.d/S99nagios: No such file or directory

Re: Nagios 4.3.2 not starting at boot up

Posted: Thu Jun 22, 2017 12:49 pm
by dwhitfield
What's the output of cat /etc/*lease? I know you gave OS information, but I'm not familiar with raspbian. I know it's based on Debian. I'm hoping the release info will tell me what version of Debian so I can figure out how the init should work.

Re: Nagios 4.3.2 not starting at boot up

Posted: Thu Jun 22, 2017 1:21 pm
by t3dus
root@raspberrypi:~# cat /etc/*lease
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Re: Nagios 4.3.2 not starting at boot up

Posted: Thu Jun 22, 2017 2:47 pm
by dwhitfield
create /etc/systemd/system/nagios.service and add the following to it:

Code: Select all

[Unit]
Description=Nagios Core Monitoring Daemon
After=network.target

[Service]
User=nagios
Group=nagios
Type=forking
ExecStart=/etc/init.d/nagios start
ExecStop=/etc/init.d/nagios stop
ExecReload=/etc/init.d/nagios reload

[Install]
WantedBy=multi-user.target
Then run sudo systemctl enable /etc/systemd/system/nagios.service

Please let us know if you run into any issues.

Re: Nagios 4.3.2 not starting at boot up

Posted: Thu Jun 22, 2017 6:04 pm
by t3dus
Done..

Code: Select all

root@raspberrypi:/usr/local/nagios/etc/objects# sudo systemctl enable /etc/systemd/system/nagios.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nagios.service to /etc/systemd/system/nagios.service.
Rebooted server and looks like Nagios started up without issue.

Re: Nagios 4.3.2 not starting at boot up

Posted: Fri Jun 23, 2017 11:30 am
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!