unable to apply configuration or restart from gui

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
swackle
Posts: 16
Joined: Thu Aug 20, 2020 5:43 am

unable to apply configuration or restart from gui

Post by swackle »

Hi,

Having a problem that I can not figure out why happens.
I am unable to apply configurations, restart monitoring engine and so on from the gui because it states that Nagios not allowed to run sudo:
CMDLINE=sudo /usr/local/nagiosxi/scripts/manage_services.sh restart nagios
nagios is not allowed to run sudo on pfanpnag01. This incident will be reported.


Have been through this one and still stuck with same problem: https://support.nagios.com/kb/article/n ... es-34.html

So nagios user is in sudoers and I am able to run the scripts as nagios user on the server?
It have been working like a charm but all of the suddent this issues have occurs, any ideas where to go next?

regards
Claus
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: unable to apply configuration or restart from gui

Post by jbrunkow »

Hello @swackle!

Welcome to the forum. :D

It looks like you have located the right KB for the issue. Which steps from that article have you tried? Did any of the commands return more error messages?

Can you please log in to your XI system as root, then run the following commands? Then let us know what that yields.

Code: Select all

su - nagios
sudo /usr/local/nagiosxi/scripts/manage_services.sh restart nagios
*hint= it is important to include the dash in the first command

It never hurts to send ( PM ) us a profile either! We can find lots of information about your system in there. You can download the profile by navigating to System Profile under System Config on the left pane > and clicking the Download Profile button on that page.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
swackle
Posts: 16
Joined: Thu Aug 20, 2020 5:43 am

Re: unable to apply configuration or restart from gui

Post by swackle »

What .ini file is it I can locate the password --- prompting for a password and have been away from this installation for almost two years :?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: unable to apply configuration or restart from gui

Post by benjaminsmith »

Hi,

Since you are getting a sudo error, can you upload the /etc/sudoers file to the thread for us to review?

Also, if you're able to download a system profile, that would be really helpful to troubleshoot this error. Thanks, Benjamin

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share in a private message or upload it to the post/ticket, and then reply to this post to bring it up in the queue.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
swackle
Posts: 16
Joined: Thu Aug 20, 2020 5:43 am

Re: unable to apply configuration or restart from gui

Post by swackle »

Im unable to download the system profile due to the same issue, telling me nagios user not allowed to do sudo.
Uploaded the system info that is unfortunately the best I can do.

I can not upload the sudoers file since it is a general files for all linux and unix servers that the company that hosts our linux servers use.
They inform me that everything looks ok regarding sudoers file and nagios user.
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: unable to apply configuration or restart from gui

Post by benjaminsmith »

Hi @swackle,

Please follow the instructions in the kb article below to restore the sudoers file to the default, and then PM the profile if you're able to.

Nagios XI - Profile Build Failed

If that doesn't work, you can run the following the generate a profile from the command line. The profile (profile.zip) will be in the /usr/local/nagiosxi/var/components/ directory. Thanks, Benjamin

Code: Select all

### GET SYSTEM PROFILE BY COMMMAND LINE
rm -rf /usr/local/nagiosxi/var/components/profile*​​
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
swackle
Posts: 16
Joined: Thu Aug 20, 2020 5:43 am

Re: unable to apply configuration or restart from gui

Post by swackle »

Hi,

Worked as it should and have attached the system profile.

As mentioned earlier I tried to restart nagios as nagios user and that worked fine: /usr/local/nagiosxi/scripts/manage_services.sh restart nagios



Moderator's Note: The profile has been shared with the support team but has been removed from the public forum.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: unable to apply configuration or restart from gui

Post by benjaminsmith »

Hi @swackle,

What version of Nagios XI are you using and what operating system? For some reason, the profile was missing logs data along with the profile.txt doc.

Please run through the following re-start to make sure all the services are running correctly. If you're not able to send a command via the gui, it's possible that cron is not running. The following commands are for Cent 6, and may need to be adjusted for your distribution.

Code: Select all

service crond stop
service npcd stop
service nagios stop
service ndo2db stop
pkill -9 -u nagios
for i in $(ipcs -q | grep nagios |awk '{print $2}'); do ipcrm -q $i; done
rm -rf /usr/local/nagiosxi/var/dbmaint.lock
rm -rf /usr/local/nagiosxi/var/event_handler.lock
rm -rf /usr/local/nagiosxi/scripts/reconfigure_nagios.lock
service mysqld restart
service ndo2db start
service nagios start
service npcd start
service crond start
Next run the following tail command and then try to Apply Configuration in the GUI, and post the full output to the thread.

Code: Select all

tail -Fn0 /var/log/httpd/error_log /var/log/httpd/ssl_error_log /usr/local/nagiosxi/var/cmdsubsys.log /usr/local/nagiosxi/var/eventman.log
Lastly, can you post the database log as well. Thanks, Benjamin

Code: Select all

tail -n 100 /var/log/mysqld.log
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
swackle
Posts: 16
Joined: Thu Aug 20, 2020 5:43 am

Re: unable to apply configuration or restart from gui

Post by swackle »

Hi again,

OS is = Red Hat Enterprise Linux Server release 6.10 (Santiago)
Nagios XI = Nagios XI 5.4.13

Tried what mentioned in the last post, apply config still fails but have attached the logs and mysql log.

/Claus
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: unable to apply configuration or restart from gui

Post by scottwilkerson »

The log shows the following

Code: Select all

nagios is not allowed to run sudo on pfanpnag01.  This incident will be reported.
sodo for certain commands is required, did someone change/remove the sudoers entries?

What is the output of the following?

Code: Select all

grep nag /etc/sudoers
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked