When changing or adding services nagios is restarted and generates warnings.
There are warnings about duplicate services for one of our hosts :spozei-odysseus
When checking the services directory i see that somehow we managed to create two config files for this host.
the first one is the regular file named spozei-odysseus.cfg
The second has a trailing space after the filename and before the extension. spozei-odysseus .cfg
I can't find a way to remove the second file. (Tried deleting and renaming)
It returns when the config files are written after changes!.
Can you tell me how to remove this second file (without removing the host)
Thanks in advance
duplicate config file!!!!
Re: duplicate config file!!!!
Do you have a matching entry in the CCM that has the spaces? If so you would need to delete that one.
Former Nagios employee
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: duplicate config file!!!!
To follow on from what tmcdonald said, look at the contents of "spozei-odysseus .cfg" and it will point you to the offending service in CCM.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: duplicate config file!!!!
There is only one host spozei-odysseus in CCM.
The two service files are identical
[root@hosted-rhn01 services]# ll *ody*
-rw-rw-r-- 1 apache nagios 18149 Nov 12 10:54 spozei-odysseus .cfg
-rw-rw-r-- 1 apache nagios 18149 Nov 12 10:54 spozei-odysseus.cfg
[root@hosted-rhn01 services]# diff spozei-odysseus.cfg 'spozei-odysseus .cfg'
[root@hosted-rhn01 services]#
This is a complex host with over 40 services. I'd rather not have to delete it and start over.
The two service files are identical
[root@hosted-rhn01 services]# ll *ody*
-rw-rw-r-- 1 apache nagios 18149 Nov 12 10:54 spozei-odysseus .cfg
-rw-rw-r-- 1 apache nagios 18149 Nov 12 10:54 spozei-odysseus.cfg
[root@hosted-rhn01 services]# diff spozei-odysseus.cfg 'spozei-odysseus .cfg'
[root@hosted-rhn01 services]#
This is a complex host with over 40 services. I'd rather not have to delete it and start over.
Re: duplicate config file!!!!
There are two possible scenarios.
1. You have the duplicate in the CCM (database).
If this is the case, even if you delete the config manually from the CLI, it will be rewritten. Go to CCM->Services, and search for "spozei-odysseus" (type it in the search bar and hit "Enter"). If you find the duplicate, delete it in the CCM. Save and apply configuration.
2. It is a "ghost" service.
In this case, you can remove the config file from "/usr/local/nagios/etc/services", and it *should* disappear from the web UI.
Also, there may be an issue with the database (crashed tables). It doesn't hurt to run the repair on the database just in case.
http://assets.nagios.com/downloads/nagi ... tabase.pdf
If the issue is still not resolved, you can email us at [email protected], and we can move this to a remote session.
1. You have the duplicate in the CCM (database).
If this is the case, even if you delete the config manually from the CLI, it will be rewritten. Go to CCM->Services, and search for "spozei-odysseus" (type it in the search bar and hit "Enter"). If you find the duplicate, delete it in the CCM. Save and apply configuration.
2. It is a "ghost" service.
In this case, you can remove the config file from "/usr/local/nagios/etc/services", and it *should* disappear from the web UI.
Also, there may be an issue with the database (crashed tables). It doesn't hurt to run the repair on the database just in case.
http://assets.nagios.com/downloads/nagi ... tabase.pdf
If the issue is still not resolved, you can email us at [email protected], and we can move this to a remote session.
Be sure to check out our Knowledgebase for helpful articles and solutions!