Re: [Nagios-db-devel] retention.dat
Status: Beta
Brought to you by:
bench23
From: Matthew K. <mk...@ma...> - 2005-01-04 18:43:30
|
On Tue, 2005-01-04 at 18:06, Ben wrote: > Well, what I understand sounds like a good solution. Let's see if I > understand it right.... > > 1. On NEB init, start up a database connection and register for > processStart. > > 2. On processStart, parse all the hosts. If they aren't in the database > yet, add them. Refresh all the hostgroups. Register for status events. > > 3. Steadystate remains unchanged. > > Right? > Yeah that sounds right. Hope that works. Sorry I can't test first to confirm, got a few other things to do this afternoon. - Matt > Actually, we're already parsing all the hosts in order to mark the ones > that are currently configured, so this shouldn't be so bad. > > On Tue, 4 Jan 2005, Matthew Kent wrote: > > > On Tue, 2005-01-04 at 17:14, Ben wrote: > > > Ahhhhh..... I understand now. I *knew* I should have checked for insert > > > status. > > > > > > Now, as for the two solutions you proposed, they seem the same, except > > > that the latter includes modifying nagios to not send updates when parsing > > > retention.dat data. Correct? > > > > > > > Almost, my idea was to either solve it only the module in a hackish way > > or just patch nagios directly. > > > > I do have a better idea though. If I recall from my testing processStart > > got triggered after all the data from the retention file was loaded > > (triggering that big wad of updates). So if the neb register callbacks > > for host and status data were moved to the end of processStart, you > > could simply walk the host and service list and the beginning of the > > function and pass the data to processStatus to register. Basically > > ignore the first round of data from nagios loading the retention file > > and do it ourselves. > > > > - Matt > > > > > On Tue, 4 Jan 2005, Matthew Kent wrote: > > > > > > > On Tue, 2005-01-04 at 15:34, Ben wrote: > > > > > Before I can speak to the solutions, I don't understand the problem. > > > > > > > > > > 1. Why would retention.dat be missing? > > > > > > > > On a new install, server move or after wiping cached data in var/. > > > > > > > > > 2. Hostgroup membership is determined by walking the hostgroup config > > > > > object in memory. > > > > > 3. It's true that if nagios is told to re-read its config, it might not > > > > > re-initialize the NEB, which might be a problem for us. On the other > > > > > hand, it might not, because we re-read the config stuff after > > > > > initialization but before steady state. > > > > > > > > Sorry for the confusion here, I mean if you add a new host or service to > > > > the config and restart nagios the corresponding hostgroup_membership > > > > insert will fail for this new host or service as it will not be > > > > registered in the host/service tables until the first check is made. Of > > > > course you could wait x minutes until the retention file is saved and > > > > restart nagios again so the config data will be right, but that's not > > > > much of a solution. > > > > > > > > > 4. Every time I restart Nagios, I get an imperial boatload of updates. > > > > > Then again, I probably have a retention.dat file. > > > > > > > > > > > > > Yeah wipe the retention file and try it to see what I mean :) > > > > > > > > - Matt > > > > > > > > > On Jan 3, 2005, at 9:40 PM, Matthew Kent wrote: > > > > > > > > > > > I've been working on the last bits of my MySQL neb module have just > > > > > > noticed a rather basic issue for both modules that hasn't cropped up > > > > > > till now. > > > > > > > > > > > > It seems that without the retention.dat file nagios doesn't feed the > > > > > > big > > > > > > lump of host/service data into the module on startup. Now logically > > > > > > this > > > > > > makes sense but causes a bit of a problem when there's hostgroup > > > > > > memberships to insert into the db that depend on those entries getting > > > > > > loaded at startup. This also messes up adding a host to nagios and > > > > > > restarting it as again the host won't be in the db until its first > > > > > > checks are finished breaking the hostgroup data. > > > > > > > > > > > > As for possible solutions, looping through the lists of hosts and > > > > > > services in processStart and registering them in the db is a > > > > > > possibility. But if the retention file already exists your doing twice > > > > > > the work since nagios will still send all the broker calls, and I'm not > > > > > > sure of a way to detect this in processStatus to skip those entries. > > > > > > > > > > > > Another (and I think better) option would be to submit a patch request > > > > > > to Ethan to have Nagios stop sending event broker updates when reading > > > > > > retention.dat and simply have it loop through both host and service > > > > > > lists after reading it (whether it exists or not) and send all the data > > > > > > at every startup. > > > > > > > > > > > > Thoughts? Am I missing something obvious... > > > > > > -- > > > > > > Matthew Kent <mk...@ma...> > > > > > > http://magoazul.com > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > > The SF.Net email is sponsored by: Beat the post-holiday blues > > > > > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > > > > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > > > > > _______________________________________________ > > > > > > Nagios-db-devel mailing list > > > > > > Nag...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > > The SF.Net email is sponsored by: Beat the post-holiday blues > > > > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > > > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > > > > _______________________________________________ > > > > > Nagios-db-devel mailing list > > > > > Nag...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > The SF.Net email is sponsored by: Beat the post-holiday blues > > > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > > > _______________________________________________ > > > > Nagios-db-devel mailing list > > > > Nag...@li... > > > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > The SF.Net email is sponsored by: Beat the post-holiday blues > > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > > _______________________________________________ > > > Nagios-db-devel mailing list > > > Nag...@li... > > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > Nagios-db-devel mailing list > > Nag...@li... > > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel > > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Nagios-db-devel mailing list > Nag...@li... > https://lists.sourceforge.net/lists/listinfo/nagios-db-devel |