Login

Home Forum
Welcome, Guest
Please Login or Register.    Lost Password?

[solved] Duplicate definition in Nagios with domai
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: [solved] Duplicate definition in Nagios with domai
#879
[solved] Duplicate definition in Nagios with domai 1 Year, 3 Months ago Karma: 0
Hi,

My question is related to bug 231. I'm having the same problem as described but using the latest 3.0.2 version of NagiosQL.

www.nagiosql.org/_mantis/view.php?id=231

Basically, when you have more then one domain, services are exported cross-domain. Example:

I have Domain1 with Service1 and Service2
I have Domain2 with Service1 and Service2

When I export Domain1 configuration I get the following services in the files: Service1, Service1, Service2 and Service2. Shouldn't I only have one Service1 and one Service2?

Same thing for Domain2, I get all 4 services...

This cause the following error in Nagios, as you can see with the "CPU usage" service.

[1240882148] Warning: Duplicate definition found for service 'CPU usage' on host 'nagios' (config file '/opt/nagios/etc/services/NRPE.cfg', starting on line 30)
[1240882148] Warning: Duplicate definition found for service 'CPU usage' on host 'nagios' (config file '/opt/nagios/etc/services/NRPE.cfg', starting on line 14)

Can someone let me know if it is normal behavior? If not, is there plan to fix this in 3.0.3 or can you provide a patch?

I am using:

NagiosQL 3.0.2
Nagios 3.0.6 (compiled for i386)
CentOS 5.3 x86_64
PHP 5.1.6 (standard RPM from CentOS)
Apache 2.2.3 (standard RPM from CentOS)
MySQL 5.0.45 (standard RPM from CentOS)

Thank you very much,

Jean-Philippe
jhoude
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2009/10/27 12:56 By martin.
The topic has been locked.
 
#880
Re:Duplicate definition in Nagios with domains 1 Year, 2 Months ago Karma: 4
I will attach the actual class file to this thread this evening - so you can check if this is solvend in 3.0.3 or not
martin
NagiosQL Founder
Posts: 303
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#881
Re:Duplicate definition in Nagios with domains 1 Year, 2 Months ago Karma: 0
Thanks, that would be really appreciated as it is the only thing that cause us problem at the moment.

Jean-Philippe
jhoude
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#882
Re:Duplicate definition in Nagios with domains 1 Year, 2 Months ago Karma: 4
Here is the file - I hope that's all
This attachment is hidden for guests. Please login or register to see it.
martin
NagiosQL Founder
Posts: 303
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#883
Re:Duplicate definition in Nagios with domains 1 Year, 2 Months ago Karma: 0
Hi Martin,

Sorry but I think it didn't solve the problem. I will make sure by cleaning the VM and testing again.

Using diff I saw the changes you made, but I see nothing about tbl_service. But don't worry about that, maybe it's me which doesn't understand it well

I'll let you know about the 2nd test soon.

Thanks,

Jean-Philippe
jhoude
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#884
Re:Duplicate definition in Nagios with domains 1 Year, 2 Months ago Karma: 0
Hi,

I tested again and unfortunately the bug was still there. However, I was able to figure out what was the problem.

It is located on line 983 of config_class.php:


Original (3.0.3):
$strSQLData = "SELECT * FROM `".$strTableName."` WHERE `config_name`='$strConfigName' ORDER BY `service_description`";


Modified:
$strSQLData = "SELECT * FROM `".$strTableName."` WHERE `config_name`='$strConfigName' AND `config_id`=".$this->intDomainId." ORDER BY `service_description`";


So as I said in the bugport (#231), there was a missing "WHERE config_id = x".

Thank you very much Martin for helping me on that one, maybe you can apply that patch to 3.0.3

Thanks,

J-P
jhoude
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
Go to topPage: 12