Page 1 of 2
Reset config permissions failed
Posted: Thu Aug 25, 2016 10:36 am
I am running an evaluation of Nagios XI v5.2.9 (RHEL6 64-bit) and running into the following issue.
When attempting to Apply Configuration, validation is failing. Reverting to a Snapshot is not helping. There seems to be a bad host in the database.
/usr/local/Nagios/etc/hosts/EM-Host-Group.cfg has an invalid max_check_attempts. This host has been removed using CCM, but seems to be stuck in the database.
"Show Errors" => Error: Invalid max_check_attempts value for host 'EM-Host-Group'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/EM-Host-Group.cfg', starting on line 16)
Your assistance would be greatly appreciated.
Thanks!
Bill Martin
321-309-7459
Re: Reset config permissions failed
Posted: Thu Aug 25, 2016 2:04 pm
by bwallace
Go to:
Core Config Manager > Hosts > and Select the host in question so the 'Host management' window appears. Click the 'Check Settings' tab and make sure Check / Retry intervals have values as well as 'Max check attempts.' Anything with with a red asterisk next to it cannot be left blank either. Also fill out the notification period under the 'Alert Settings' tab.
Save changes and apply config - this should do away with those errors.
Required fields.jpg
If that doesn't help, check for multiple nagios processes running. Run this cmd on your nagios server:
ps - aef | grep nagios.cfg
* Look for multiple parent (PPID) processes. The Nagios process forks itself to run checks therefore subprocesses are normal. The nagios user should probably be the only owner of the nagios process. If in any doubt post the output here.
If there are multiple Nagios processes running, run these commands to resolve:
Code: Select all
service nagios stop
killall -9 nagios
service nagios start
Re: Reset config permissions failed
Posted: Fri Aug 26, 2016 10:36 am
Thanks for your help. Problem still remains. (1) So, the host that is failing validation/verification has been removed using the UI. The verification step takes a long time. With the host removed, "Apply Configuration" still thinks it is there. Hence, that is why I believe it is stuck in the database??? So, I re-created the host record, same name and provided check & alert settings. Re-ran "Apply Configuration" and same issue. Removed host using UI and same issue. (2) I do have 2 nagios.cfg Services running. I re-start as you suggested. Immediately after starting the service, I check and 2 nagios.cfg are running. Is that an issue? If so, this may point to an install issue, as we had issues installing the "Offline" install of 5.2.9.
Thank you for your assistance.
Bill Martin 321-309-7459
Re: Reset config permissions failed
Posted: Fri Aug 26, 2016 1:52 pm
by rkennedy
There can be multiple nagios.cfg processes running, as long as they are all stemming from the same parent process ID. You may need to killall and reopen it. If you are still running into issues, please post the full output of ps -ef
If they are all one process, try navigating to Configure -> Core Config Manager -> Write Files -> Run in this order, Delete, Write, and lastly Verify. This will re-write your actual configuration files back out from SQL -> flat files, so that Nagios picks up on them. This usually remedies 'ghost' hosts / services.
Re: Reset config permissions failed
Posted: Mon Aug 29, 2016 3:53 pm
Thanks for your help. Still having the same issue so I posted the output from ps -ef. Please see attached file. After restarting, using the CCM tool I Deleted, Created/Write, Verified with No errors. That is a great tool. Without any edits, Show Errors on the Apply Configuration is still pointing to a host file for a host that has been removed. Seems like the ghost host is within SQL. Your help is greatly appreciated.
Re: Reset config permissions failed
Posted: Mon Aug 29, 2016 4:55 pm
by ssax
It could also be getting imported every time as well, do you have any files in /usr/local/nagios/etc/import?
Re: Reset config permissions failed
Posted: Mon Aug 29, 2016 4:55 pm
by ssax
Or in /usr/local/nagios/etc/static?
Re: Reset config permissions failed
Posted: Tue Aug 30, 2016 8:42 am
No files in /usr/local/nagios/etc/import. The only files within /usr/local/nagios/etc/static are xiobjects.cfg, xitemplates.cfg and xitest.cfg.
Re: Reset config permissions failed
Posted: Tue Aug 30, 2016 2:08 pm
by ssax
It may just be picking up an old error, let's try this:
Please go to
Configure > Core Config Manager > Tools > Write Config Files
- Click
Delete (don't worry, it's safe, they get re-written)
- Click
Write
Now run this tail command and let it run for the next step:
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
Then apply configuration and post the full output of the tail command.
Thank you
Re: Reset config permissions failed
Posted: Tue Aug 30, 2016 3:45 pm
Ok, I really think we are getting close! After Deleting the config files and re-writing them, I applied the configuration while watching the cmdsubsys.log file. Here is what happens: (1) On the CCM web interface it times out "waiting for configuration verification.............." this take a long time, approx. 5 minutes, although I did not time it. (2) The output within /usr/local/nagiosxi/var/cmdsubsys.log writes out the following every second "Another reconfigure process is still running, sleeping...". (3) Please see the attachment which has additional info.
Thank you,
Bill Martin