Page 1 of 3
Problem with renaming
Posted: Wed May 25, 2011 9:00 am
by srrhd
Hi,
I had to rename few hosts and consequently the config name of their services. After applying the configuration, on the "Service Detail" page, all the services appears duplicated, one with the old name and one with the new one.
I tryed to restart the monitoring engine, the performance grapher and the database backend, but nothing helped.
When looking in the configuration part, Hosts and Services only appears with once.
Do you have an idea on what might be the problem and how to fix it ?
Re: Problem with renaming
Posted: Wed May 25, 2011 9:16 am
by mguthrie
Changing the "Config Name" directive doesn't necessarily change the host membership, I think it's more of a reference for organization in the config files. Can you access the Core Config Manager->Services, then modify one of the services and double check the Host memberships. You can assign a single service to multiple hosts, and I'm wondering if that's what happened here.
Re: Problem with renaming
Posted: Wed May 25, 2011 11:48 pm
by srrhd
As i have rename the Hosts first, the host membership for the services were automatically modified. When checking the Service page in the Core Config Manager, they appears to be assign only to one Host.
I looked into the /usr/local/nagios/etc/services/ and i found that the duplicated config files generated by NagiosQL. Can't it be the NagiosQL database that needs a clean up ?
Re: Problem with renaming
Posted: Thu May 26, 2011 11:42 am
by admin
I tried to replicate this by renaming a host, but it appeared to work fine (e.g. the old host didn't appear anywhere). What version of Nagios XI are you running?
Also, when you rename a host, you don't need to rename anything on the services. They are still associated with the same database entry for the host, so the name of the host they're associated with will also get updated.
Re: Problem with renaming
Posted: Fri May 27, 2011 12:06 am
by srrhd
We use Nagios XI 2011R1.2, manually installed on newly installed 32bits CentOS 5 with nothing extra, no gnome, no proxy, no SSL.
I have rename the services' config name, to help us finding the services in case of any post configuration action.
The problem seems to come from the renaming of the services as they appears twice in the /usr/local/nagios/etc/services/ one with the new config name, one with the old one.
I tryied to removed those Config_Name.cfg and execute /usr/local/nagiosxi/scripts/reconfigure_nagios.sh, but it didn't fix anything. The services still appears duplicated on the "service details" page. One interesting thing is that now when i click "Reconfigure this service" under the Config Tab, the Config and the Performance Graph tabs disappears and i am bringing back to Monitoring Tab. Which seems logic as the config file doesn't exist anymore.
More over if i click on old Host Name and try to see it in Nagios Core i got this message:
It appears as though you do not have permission to view information for this host...
So i tryed to fix permissions files in the admin section, and to restart evrything but nothing helped...

Re: Problem with renaming
Posted: Fri May 27, 2011 1:05 am
by srrhd
I have just upgrade to NagiosXI 2011R1.3, the problem is still going on.
Re: Problem with renaming
Posted: Fri May 27, 2011 1:10 am
by srrhd
I tryied to add a new host with an old name and i got these message:
Error while inserting the data into the database:
Duplicate entry 'Syslog-1' for key 2
Re: Problem with renaming
Posted: Fri May 27, 2011 10:43 am
by nscott
srrhd,
Do any red flags pop up when you check under Admin > Monitoring Config > Check File Permissions?
Also under the same Monitoring Config > Unconfigured Objects, does that show the items you tried to delete?
Re: Problem with renaming
Posted: Mon May 30, 2011 12:05 am
by srrhd
Hi Nicholas,
No for both:
- * When checking files permissions, no red flags poping-up. Everything appears to be OK.
* On Unconfigured Objects page, anything is listed.
As there was in the /usr/local/nagios/etc/services/ directory, duplicated config files with new and old service's ConfigName, can't it be a problem with a database ? If i have a good understanding of how it works, the configuration files are used to implement the NagiosQl database no ?
Is there a way, to delete those services using a script or a shell command ?
Hoping it will help you understand what's hapening, i attache a screenshot showing the Service Details page.
Thanks,
Aurélien.
Re: Problem with renaming
Posted: Tue May 31, 2011 6:55 am
by srrhd
Hi,
Trying to find clues, i run the following command from /usr/local/:
It appears that /usr/local/nagios/var/retention.dat got many parts of those old configuration (but nothing of the new). Can it be the problem's cause ? What is the purpose of retention.dat ?
- [root@localhost local]# grep -r Syslog *
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:display_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog
nagios/var/retention.dat:host_name=Syslog