This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
t3dus
Posts: 161 Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:
Post
by t3dus » Wed Jun 21, 2017 10:14 am
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
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:
Post
by dwhitfield » Wed Jun 21, 2017 4:02 pm
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?
t3dus
Posts: 161 Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:
Post
by t3dus » Thu Jun 22, 2017 9:38 am
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:
Post
by dwhitfield » Thu Jun 22, 2017 12:49 pm
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.
dwhitfield
Former Nagios Staff
Posts: 4583 Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:
Post
by dwhitfield » Thu Jun 22, 2017 2:47 pm
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.
t3dus
Posts: 161 Joined: Thu Feb 04, 2016 3:46 pm
Location: IA
Contact:
Post
by t3dus » Thu Jun 22, 2017 6:04 pm
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:
Post
by dwhitfield » Fri Jun 23, 2017 11:30 am
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!