Apply Config will not restart

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Apply Config will not restart

Post by mguthrie »

The write config tool does a direct write to the nagios.cmd pipe, but the Apply Configuration process uses the command described above. The Apply Configuration is a better alternative because it will roll back and keep the monitoring engine running if there's a bad config being applied. However, for debugging a config error, the Write Config Tool is probably the easiest way.
qbdrift
Posts: 18
Joined: Thu Aug 02, 2012 2:52 am

Re: Apply Config will not restart

Post by qbdrift »

Ok,

so is there anything I can do to it without changing the Linux OS?

Thanks for another reply!

Best regards,

Heiko
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Apply Config will not restart

Post by mguthrie »

My guess is the systemctl is highjacking the following command:

Code: Select all

/etc/init.d/nagios restart
And the above command is specified as an allowed command in the /etc/sudoers file for the Nagios user. My guess is that you'll have to add the systemctl command to that file as well. It would probably be something like:

Code: Select all

systemctl nagios restart
but you'll have to test and see if that's it. We don't have a Fedora test box to confirm on, and as of Fedora 16, XI won't install on it at all. Right now the root user can run the Nagios restart, but the Nagios user can't because it's being denied permission.
qbdrift
Posts: 18
Joined: Thu Aug 02, 2012 2:52 am

Re: Apply Config will not restart

Post by qbdrift »

Hi,

thanks for the reply. But again I am sorry this didn't worked out.

I also gave the nagios and the apache user access for everything via the sudoers files.

I would really appreciate some more advices from your side.

Thanks!

Best regards,

Heiko
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Apply Config will not restart

Post by mguthrie »

Here's a few useful snippets I found about systemctl.
service operates on the files in /etc/init.d and was used in conjunction with the old init system. systemctl operates on the files in /lib/systemd . If there is a file for your service in /lib/systemd it will use that first and if not it will fall back to the file in /etc/init.d
Not sure if this will work, but I saw for another service this worked to prevent the permission denied error. (Run as root).

Code: Select all

systemctl enable nagios
How long have you had this install running on Fedora? If it's a fairly new install I would consider migrating it to a RHEL or CentOS box.
qbdrift
Posts: 18
Joined: Thu Aug 02, 2012 2:52 am

Re: Apply Config will not restart

Post by qbdrift »

Thank you very much for your effort.

I checkd this too, but it did not work.

We are using nagios xi about 1,5 years now on this machine.
qbdrift
Posts: 18
Joined: Thu Aug 02, 2012 2:52 am

Re: Apply Config will not restart

Post by qbdrift »

All right.

We managed with a little hacking.

We added a sudo command for the restart here: restart_nagios_with_export.sh

Now it is working.

Thanks for your support and time!
Locked