Nagios 4.3.2 not starting at boot up

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Nagios 4.3.2 not starting at boot up

Post 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?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post 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?
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post 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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post 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.
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post 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"
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post 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.
User avatar
t3dus
Posts: 161
Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagios 4.3.2 not starting at boot up

Post by dwhitfield »

It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Locked