In fact the wy of the clean/insert is very easy, and there is no threads or
others things like that in this ndo module :
* when a broker reach a new scheduler, it ask this one to get a "full brok
data". In all of this, it begins with a broks name
"clean_all_my_instance_id" with the id of the scheduler (each one get one,
it's like the standard instance_id).
* the broker get all the broks. The frist one is the clean all order, then
we got all "new element" broks data.
* the module get the broks in this order, so the ndo start with getting the
"clean all" brok with the id of the instance_id, so it clean a lot of tables
with old data of previous runs
* when the clean is done (one brok by one brok) it pass to the others broks,
got a "new host" so it insert an host, then another one, then a service,
then groups, etc etc. All in serial.
It's very simple, with a big clean at the begining (if a broker lost the
scheduler connexion or the scheduler is restarted, the broker ask for a full
brok data, we clean all, and insert all again).
But some data are common to different schedulers, and some tables do not
have the instance_id, so we will have "duplicate broks", one for each
instance that this broker manage. That where duplicate can/will happened,
and it's the same data, so it's a mere notice instead of a warning in fact.
It's simple, but not "so slow" (not so quick neither) with some caches that
make some select skip hopefully to bypass a lot of select on the
nagios_objects table :)
Jean
On Tue, Jan 18, 2011 at 6:40 PM, Michael Friedrich <
michael.friedr...@univie.ac.at> wrote:
> On 17.01.2011 16:39, nap wrote:
>
> Duplicate on nagios_hosts? That seems very very strange, there is a clean
> all before all inserts. I don't see how it can happened. If you can, launch
> the broker in debug mode and send us this log when it occurs again.
>
>
> without having looked at the code - how is this 'clean all' being done? is
> it threadsafe - meaning there's a lock somewhere to provent asynchronous
> inserts then?
>
> maybe you can draw a small picture, without python, only sql's and such ;-)
>
> kind regards,
> Michael
>
>
>
> Jean
>
> On Mon, Jan 17, 2011 at 4:11 PM, Tanguy von Stebut <
> tanguy.von.ste...@gmail.com> wrote:
>
>> Hello again,
>>
>> I've been working further on my centreon + shinken prototype, and I
>> encountered some real problems due to integrity violation in tables
>> nagios_hosts and nagios-hostgroups (duplicates again), but I didn't keep the
>> log, sorry !!
>> I had to reload my VM template to recover a nice configuration. As I'm in
>> prototyping phase, this doesn't matter, but I doubt (:-D) this could be in
>> production (:/)...
>>
>> So the (wrong) behavior was that I couldn't add a targetted host to
>> monitoring, huh... well I think that's critical.That would be such a shame
>> in production, don't yall think so ?
>>
>> Hope I'll get some more support here, as I'm starting desperating
>> myself....
>>
>> Best regards,
>>
>> Tanguy
>>
>>
>>
>>
>> 2011/1/17 Tanguy von Stebut <tanguy.von.ste...@gmail.com>
>>
>>
>>>
>>> 2011/1/17 nap <napar...@gmail.com>
>>>
>>> [...]
>
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel