Reset config permissions failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
[email protected]
Posts: 11
Joined: Thu Feb 26, 2015 2:32 pm

Reset config permissions failed

Post by [email protected] »

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
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Reset config permissions failed

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out the Knowledgebase for helpful articles and solutions!
[email protected]
Posts: 11
Joined: Thu Feb 26, 2015 2:32 pm

Re: Reset config permissions failed

Post by [email protected] »

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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Reset config permissions failed

Post 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.
Former Nagios Employee
[email protected]
Posts: 11
Joined: Thu Feb 26, 2015 2:32 pm

Re: Reset config permissions failed

Post by [email protected] »

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.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reset config permissions failed

Post by ssax »

It could also be getting imported every time as well, do you have any files in /usr/local/nagios/etc/import?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reset config permissions failed

Post by ssax »

Or in /usr/local/nagios/etc/static?
[email protected]
Posts: 11
Joined: Thu Feb 26, 2015 2:32 pm

Re: Reset config permissions failed

Post by [email protected] »

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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Reset config permissions failed

Post 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
[email protected]
Posts: 11
Joined: Thu Feb 26, 2015 2:32 pm

Re: Reset config permissions failed

Post by [email protected] »

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
You do not have the required permissions to view the files attached to this post.
Locked