Page 1 of 2

Duplicate Entry Issue

Posted: Fri Jul 20, 2012 4:46 am
by mindspring
My monitoring service stopped and I checked the configuration and got this message a few days after installation.

Warning: Duplicate definition found for host 'xi_host_generic' (config file '/usr/local/nagios/etc/hosttemplates.cfg', starting on line 171)
Error: Could not add object property in file '/usr/local/nagios/etc/hosttemplates.cfg' on line 172.
Error processing object config files!


This is my second install. I had similiar duplicate entry issues which I couldn't fix and then re installed.

My question is

1)How do I resolve these duplicate entry issues. I don't even know where to start looking
2) Why are they occurring?
3) Any advice on how to post on the customer forum would be appreciated. I tried using my reseller login details but then it failed, I registered with new details but don't know how to gain post access to the customer forum section.

Thanks

1) CEntos 5.7
2) 32 bit
3) Xen Image
4) Gnome is installed on the system
5) Nagios XI 201 r 1.9

Re: Duplicate Entry Issue

Posted: Fri Jul 20, 2012 1:59 pm
by mguthrie
There is a static config file that we retain for backwards compatibility purposes in /usr/local/nagios/etc/static/xitemplates.cfg, and I would try backing up, then removing that file from that directory and see if that lets you Apply Configuration. The xi_host_generic templates is one of the templates in that files.

Can you send me a PM with your customer information and I'll get you added to the Customer Forum.

Re: Duplicate Entry Issue

Posted: Fri Jul 20, 2012 2:08 pm
by scottwilkerson
The problem is you are using the import feature and importing files that shouldn't be imported.

The file /usr/local/nagios/etc/static/xitemplates.cfg for example should never be imported...

That said, you may be able to fix this this by deleting that file off of the server then going to
Configure -> CCM -> Tools -> Write Config Files
Click the top 3 items, if there are no errors click the restart option, if you get new errors about Duplicate definition do the following then repete the top 3 items in Configure -> CCM -> Tools -> Write Config Files

ONLY ONCE There are no Errors, click the 4th button. If there are errors we need to fix them and then repeat step 3).

Once there are no errors click the 4th Go button, then wait a couple minutes.

Go to Configure -> CCM -> Apply Configuration -> Apply Configuration

Re: Duplicate Entry Issue

Posted: Mon Jul 23, 2012 2:44 am
by mindspring
Thanks,

I removed that file then restarted and that particular message disappeared. I then got a whole new string of errors when trying to write the config file.

Warning: Duplicate definition found for service 'Uptime' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 77)
Warning: Duplicate definition found for service 'Ping' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 62)
Warning: Duplicate definition found for service 'Memory Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 46)
Warning: Duplicate definition found for service 'Drive C: Disk Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 30)
Warning: Duplicate definition found for service 'CPU Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Ping' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/Tungsten.cfg', starting on line 30)
Warning: Duplicate definition found for service 'Drive C: Disk Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/Tungsten.cfg', starting on line 14)
Error: Invalid max_check_attempts value for host 'Cobalt'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/Cobalt.cfg', starting on line 14)
Error processing object config files!

Any idea why there are so many duplicates when all I did last week was a few hosts? how do I get rid of them?

Thanks

Re: Duplicate Entry Issue

Posted: Mon Jul 23, 2012 2:45 am
by mindspring
Hi mguthrie,

The contact button is greyed out when I try to PM you. I think I don't have permissions perhaps.

Could you check for me please? I just added you as a friend so perhaps that helps.

Re: Duplicate Entry Issue

Posted: Mon Jul 23, 2012 7:50 am
by mindspring
Hi Mguthrie and Scott,

Thanks - removing the file got rid of the error I previously had. I now have some more dulpicate errors below.
I'm not sure why these duplicates started occurring.

Mguthrie, I tried PM'ing you but it was greyed out. I tried adding you as a friend so hopefuly that works.



Warning: Duplicate definition found for service 'Uptime' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 77)
Warning: Duplicate definition found for service 'Ping' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 62)
Warning: Duplicate definition found for service 'Memory Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 46)
Warning: Duplicate definition found for service 'Drive C: Disk Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 30)
Warning: Duplicate definition found for service 'CPU Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/192.168.100.252.cfg', starting on line 14)
Warning: Duplicate definition found for service 'Ping' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/Tungsten.cfg', starting on line 30)
Warning: Duplicate definition found for service 'Drive C: Disk Usage' on host 'Tungsten' (config file '/usr/local/nagios/etc/services/Tungsten.cfg', starting on line 14)
Error: Invalid max_check_attempts value for host 'Cobalt'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/Cobalt.cfg', starting on line 14)
Error processing object config files!

Re: Duplicate Entry Issue

Posted: Mon Jul 23, 2012 8:50 am
by scottwilkerson
The duplicates are likely caused by adding a a hostgroup or host to a different service.

That's not the only problem you are having though, the

Go to CCOM -> Hosts -> Cobalt -> Modify -> Check Settings Tab
Set
Max. check attempts = 5

Then
Configure -> CCM -> Tools -> Write Config Files
Click the top 3 items, if there are no errors click the restart option, if you get new errors about Duplicate definition do the following then repete the top 3 items in Configure -> CCM -> Tools -> Write Config Files

ONLY ONCE There are no Errors, click the 4th button. If there are errors we need to fix them and then repeat step 3).

Once there are no errors click the 4th Go button, then wait a couple minutes.

Go to Configure -> CCM -> Apply Configuration -> Apply Configuration

Re: Duplicate Entry Issue

Posted: Tue Jul 24, 2012 5:37 am
by mindspring
Thanks for your help Scott, that got rid of that particular error.

Now I am getting this error:

Error: Could not find any hostgroup matching 'windows-servers' (config file '/usr/local/nagios/etc/hosts/cobalt.sam.cpt.cfg', starting on line 14)
Error processing object config files!

Yet when I check the host Cobalt, none of the hostgroups are selected and there is no such host group called windows-servers, only with description Windows Servers

Re: Duplicate Entry Issue

Posted: Tue Jul 24, 2012 7:51 am
by scottwilkerson
Ok, there likely used to be one.

Go to Configure -> CCM -> hosts -> cobalt.sam.cpt -> modify
Click the notepad by hostgroups
Click save (not abort)
Click Save again

Then
Configure -> CCM -> Tools -> Write Config Files
Click the top 3 items, if there are no errors click the restart option, if you get new errors about Duplicate definition do the following then repete the top 3 items in Configure -> CCM -> Tools -> Write Config Files

ONLY ONCE There are no Errors, click the 4th button. If there are errors we need to fix them and then repeat step 3).

Once there are no errors click the 4th Go button, then wait a couple minutes.

Go to Configure -> CCM -> Apply Configuration -> Apply Configuration

Re: Duplicate Entry Issue

Posted: Wed Jul 25, 2012 8:35 am
by mindspring
Thanks, I tried that and I get exactly the same error

Error: Could not find any hostgroup matching 'windows-servers' (config file '/usr/local/nagios/etc/hosts/cobalt.sam.cpt.cfg', starting on line 14)
Error processing object config files!


Is there any other place this could be lurking?