Page 1 of 1

Can't restart nagios using sudo /etc/init.d/nagios restart

Posted: Tue Jan 22, 2019 3:07 pm
by vy3734
Hi,
I had to do an offline NagiosXI install due to internet connectivity issues. On a regular online Nagios XI installation i could restart by using
sudo /etc/init.d/nagios start/restart/stop. after doing an offline install i don't even see /etc/init.d/nagios. I know for a fact that i missed something. However systemctl start nagios.service works, but in case of errors in config files i don't see a nagios.configtest file in /usr/local/nagios/var/ directory. Can someone please help!

Re: Can't restart nagios using sudo /etc/init.d/nagios resta

Posted: Tue Jan 22, 2019 3:26 pm
by lmiltchev
You are not going to see "/etc/init.d/nagios" on a new install of Nagios XI, and this is normal. You can use systemctl to start/stop/restart nagios, and view the status:

Code: Select all

systemctl start nagios.service
systemctl stop nagios.service
systemctl restart nagios.service
systemctl status nagios.service
You can verify the config (check for errors) from the command line by running:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
or in the GUI:

CCM > Tools > Config File Management > Write Configs > Verify Files

Note: Sometimes, the nagios.configtest cannot be created or updated because the nagios account does not have a user shell. See more here:

https://support.nagios.com/kb/article/n ... t-760.html

Re: Can't restart nagios using sudo /etc/init.d/nagios resta

Posted: Tue Jan 22, 2019 3:49 pm
by vy3734
Thanks lmiltchev for the quick response! That clarifies my concerns!

Re: Can't restart nagios using sudo /etc/init.d/nagios resta

Posted: Tue Jan 22, 2019 3:56 pm
by lmiltchev
Sounds good! Is it OK if we close this topic?