need assistance with configuration error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

need assistance with configuration error

Post by teh0015 »

This instance of XI has been up for a few years. 318 hosts 1226 services.

Occasionally after adding/changing something we'll get an error on applying configuration.
Usually I look at the error and and figure out what the issue is or worst case roll back to a previous config and start over.

Today I added a host and when I went to apply I get
Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/services_WINDOWS_DWS_OITVDC-VDI-04.cfg', starting on line 77)

That file didn't actually exist so I looked in CCM/Services for services_WINDOWS_DWS_OITVDC-VDI-04
There were some services under that config name but they were all marked not active.
We didn't need them anymore so I deleted them then went to reapply.
Same error.

I tried to roll back to an earlier configuration snapshot - same error.
I went to an earlier snapshot - same error.
Restarted the nagios service (this is on RHEL 6.10 ) - same thing.
I removed the host I'd been trying to add and then ran apply - same thing.

I went to Config File Mangement and deleted then rewrote configs.
Verified files and got:
...
Total Warnings: 28
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
...
(The warnings are hosts/services with no contacts and services that are duplicated - we always have these and it's never prevented an apply)
Tried to run apply and got the same error.

I can force checks so it looks like everything is still monitoring - I just can't add or change anything until I get past this.
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

Re: need assistance with configuration error

Post by teh0015 »

ok ... this is weird
I ran /usr/local//nagiosxi/scripts/reconfigure_nagios.sh to see if I'd get something more and ... it gave me the same "warnings:28 erros:0 Things look OK" and looked like it went fine.

So I went back into the web interface and there was a new successful snapshot and 'Apply' was no longer red.
I clicked apply anyways - got the same error.
Went back to cli and reran the config - and got a new successful snapshot.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: need assistance with configuration error

Post by lmiltchev »

Do you have by chance any files that are "left over" in the "/usr/local/nagios/etc/import/" directory? If you had "bad" confgis in the import directory, the apply configuration process would fail. You would need to delete them, then apply configuration.
Be sure to check out our Knowledgebase for helpful articles and solutions!
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

Re: need assistance with configuration error

Post by teh0015 »

lmiltchev wrote:Do you have by chance any files that are "left over" in the "/usr/local/nagios/etc/import/" directory? If you had "bad" confgis in the import directory, the apply configuration process would fail. You would need to delete them, then apply configuration.

There are no files in the ./etc/import directory.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: need assistance with configuration error

Post by lmiltchev »

So, when you are using the config file management, you are not getting any errors, and you can apply configuration - can you confirm?

Core Config Manager > Tools > Config File Management > Delete Files > Write Configs > Verify Files > Apply Configuration

Can you PM me your latest profile?

Admin > System Config > System Profile > Download Profile
Be sure to check out our Knowledgebase for helpful articles and solutions!
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

Re: need assistance with configuration error

Post by teh0015 »

lmiltchev wrote:So, when you are using the config file management, you are not getting any errors, and you can apply configuration - can you confirm?

Core Config Manager > Tools > Config File Management > Delete Files > Write Configs > Verify Files > Apply Configuration

Can you PM me your latest profile?

Admin > System Config > System Profile > Download Profile

If I go to Core Config Manager > Tools > Config File Management > and delete then write config files I can then Verify Files and I get:

---
Total Warnings: 28
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
---

If I then click the red Apply Configuration and then the Apply button I get the error.



I just went to Admin > System Config> System Profile > Download Profile and I get this:
---
PROFILE BUILD FAILED
Array
(
)
CODE: 1
---
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: need assistance with configuration error

Post by lmiltchev »

Try troubleshooting the profile issue by following the steps, outlined in this article:

https://support.nagios.com/kb/article/n ... d-533.html

Note: It is possible that fixing the sudoers will also fix the apply config issue. Try these steps again (after fixing sudoers):

Core Config Manager > Tools > Config File Management > Delete Files > Write Configs > Verify Files > Apply Configuration

If issue is still not resolved, PM me the profile, and we will go from there.
Be sure to check out our Knowledgebase for helpful articles and solutions!
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

Re: need assistance with configuration error

Post by teh0015 »

lmiltchev wrote:Try troubleshooting the profile issue by following the steps, outlined in this article:

https://support.nagios.com/kb/article/n ... d-533.html

Note: It is possible that fixing the sudoers will also fix the apply config issue. Try these steps again (after fixing sudoers):

Core Config Manager > Tools > Config File Management > Delete Files > Write Configs > Verify Files > Apply Configuration

If issue is still not resolved, PM me the profile, and we will go from there.
That did it!
A policy change had shoved a new sudoers at this machine.
After fixing sudoers everything is working now.

TNX!!!
Locked