Page 1 of 1

Configuration Files Not Updating

Posted: Thu Feb 17, 2022 11:05 am
by wneville
Hello,

We are running nagios 5.8.7 on RHEL 8. In the last 48 hours, our services.cfg and hosts.cfg files have stopped updating from changes made in the UI. Is this an issue you all have run into before?

We looked at this article and it was not relevant: https://support.nagios.com/kb/article/n ... ce-39.html

Please let me know what information you need to help us troubleshoot this.


Thanks in advance for your time!

Re: Configuration Files Not Updating

Posted: Thu Feb 17, 2022 12:06 pm
by wneville
To be more specific, we can add and remove hosts and services, but we cannot edit options within them.

For example, when editing a mssql query to change the --result flag.
- edited in UI
- Apply Config is successful
- check the service.cfg file and no changes have taken place
- strangely enough, the change is present if you navigate back to the service in the UI

This is happening for hosts as well

Re: Configuration Files Not Updating

Posted: Fri Feb 18, 2022 10:16 am
by ssax
Usually when I see this it's because there is a duplicate service that is overriding the one you're changing.

Please PM me a copy of your profile.zip, you can download it from Admin > System Profile by clicking the Download Profile button.

PM me the host/service name that you're modifying as well.

Additionally, please send the output of these commands:
- NOTE: You may need to adjust the -h 127.0.0.1, the -uroot, and -pnagiosxi in the first command if your DB is offloaded to another server and/or you've changed the root mysql password

Code: Select all

echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --table

Re: Configuration Files Not Updating

Posted: Mon Feb 21, 2022 10:15 am
by wneville
Hello,

Profile.zip from the getprofile.sh script PM'd

Command output attached in .txt file

In the PM to you, I have included the host name and service name

We definitely have services with identical Display names, but not config names. Is that an issue?

Re: Configuration Files Not Updating

Posted: Tue Feb 22, 2022 10:08 am
by wneville
Hello,

I identified the issue and you were correct - there were 2 services with identical config names but only one entry in the services.cfg file. i changed one of the names, applied config and restarted httpd & nagios services and the services/hosts are acting normal again.

I believe we used a config wizard on this, is that something that will be patched? just curious, not a huge deal to change one of the service names during set-up.

Thanks so much!

Re: Configuration Files Not Updating

Posted: Tue Feb 22, 2022 12:01 pm
by ssax
It's not actually an issue, you had multiple services with the same service description defined in different locations assigned to the same host which is allowed but only one of them will win out. What I mean by that is nagios will only use one of the services on the host, it matches by the hostname/servicename case-sensitively so if you have two SSH services assigned to the same host you would still only end up with one active SSH service check when nagios is running.

It's a common thing that happens when you initially start assigning services per host (one service per host) and then start using templates or hostgroups to assign them you'll get those duplicate definition messages. You can also see those duplicate definition messages by going to Configure > Core Config Manager > Tools > Config File Management > Verify or via this command from the CLI:

Code: Select all

/usr/local/nagios/bin/nagios -vv /usr/local/nagios/etc/nagios.cfg
They don't really cause problems outside of confusion/settings not taking effect if the other service is the one that is picked up but the path to fix them is a manual process because we don't know which one you actually want. So going through them every now and then is a good idea. You could also setup a check to look for them as well.

Re: Configuration Files Not Updating

Posted: Wed Feb 23, 2022 2:59 pm
by wneville
Understood - thanks so much for the help and thoughtful explanation!!

Re: Configuration Files Not Updating

Posted: Thu Feb 24, 2022 5:14 pm
by ssax
No problem, let us know if you have any related questions or when we're okay to lock this up and mark it as resolved.

Thank you!

Re: Configuration Files Not Updating

Posted: Thu Mar 03, 2022 12:13 pm
by wneville
you may lock - thanks again