Page 2 of 2

Re: service nagios restart not restarting nagios

Posted: Wed Feb 07, 2018 1:42 pm
by t3dus
kyang wrote:Are they using different network devices?
Separate networks, separate systems.
kyang wrote:Will you stop using this Nagios server? Or did you want to continue troubleshooting this?

Let us know how you would like to continue. Thanks!
I may stop using that system because I simply don't understand why it thinks everything is down/up when it isn't...

But I have an issue where nagios isn't starting on startup on my VPS server. No idea why that isn't working right.

I ran this command below to create a symbolic link to fix the startup issue but it already exists.

Code: Select all

# ln -s /etc/init.d/nagios /etc/rc
ln: failed to create symbolic link '/etc/rc': File exists
Nagios still doens't start up on boot.

If I edit /etc/rc I see this in the file.

Code: Select all

DESC="Nagios"
NAME=nagios
DAEMON=/usr/local/nagios/bin/$NAME
DAEMON_ARGS="-d /usr/local/nagios/etc/nagios.cfg"
PIDFILE=/usr/local/nagios/var/$NAME.lock

Re: service nagios restart not restarting nagios

Posted: Wed Feb 07, 2018 2:24 pm
by kyang
Could you run this command and post the output?

Code: Select all

dpkg --list | grep upstart

Re: service nagios restart not restarting nagios

Posted: Wed Feb 07, 2018 2:27 pm
by t3dus
kyang wrote:Could you run this command and post the output?

Code: Select all

dpkg --list | grep upstart
did nothing but bring me back to a command prompt.

Re: service nagios restart not restarting nagios

Posted: Wed Feb 07, 2018 4:26 pm
by kyang
On your VPS server what's the output of this?

Code: Select all

sudo update-rc.d nagios default
sudo update-rc.d nagios enable
Any errors?

Re: service nagios restart not restarting nagios

Posted: Wed Feb 07, 2018 4:42 pm
by t3dus

Code: Select all

# sudo update-rc.d nagios default
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
                -n: not really
                -f: force

The disable|enable API is not stable and might change in the future.

Code: Select all

# sudo update-rc.d nagios enable
update-rc.d: error: no runlevel symlinks to modify, aborting!

Re: service nagios restart not restarting nagios

Posted: Wed Feb 07, 2018 5:00 pm
by kyang
Could you run an strace for us and give us the output?

You may have to install strace first.

Code: Select all

apt-get install strace
Then run this.

Code: Select all

strace service nagios restart &> /tmp/strace.txt
You will have to use something like Filezilla to get the file to us.

Re: service nagios restart not restarting nagios

Posted: Thu Feb 08, 2018 10:53 am
by t3dus
Here you go.

Re: service nagios restart not restarting nagios

Posted: Thu Feb 08, 2018 1:11 pm
by kyang
It didn't actually go through.

Could you run the command as root or sudo.

Code: Select all

strace sudo service nagios restart &> /tmp/strace.txt