event broker modules and threads

Andreas Ericsson ae at op5.se
Fri Sep 17 00:11:25 CEST 2004


Ben wrote:
> So I'm looking at using nagios' event broker to reintroduce postgres to
> nagios. After looking over the code for all of an hour, it appears that
> all eventbroker callbacks are made from the same thread. Is that correct?
> 

Umm... just off the top of my head... aren't there callbacks being made 
for every check as soon as the check is done? I know there's something 
about it in checks.c

> This is important to me, because if multiple threads will be calling my
> neb module, I'm going to have to pool my database connections. While I
> have code that does just that, it depends heavily on glib, and it seems 
> that nagios shuns glib.
> 

Make it a dual piece. The eventbroker logs to a socket and another 
program listens in and (optionally) parses it a bit before shoving it 
into DB. It's much more generic that way, and it'll be easy to plug in a 
variety of DB-supporting modules in the listening end.

> (On a side note, why doesn't nagios use glib? Yes, I know that's another
> dependancy, but in my experience the benefits are more than worth it.)
> 

glib is a fairly large library to install, and I don't think it's 
available for all too many platforms (since it fiddles a lot with the 
lower level stuff, like threads and memory management). Nagios is fairly 
portable, and I think Ethan is reluctant to make it depend on libs that 
makes it less so.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php




More information about the Developers mailing list