Re: [Nagios-devel] event broker modules and threads
Posted: Thu Sep 16, 2004 2:11 pm
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 [email protected]
OP5 AB www.op5.se
Lead Developer
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
> 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 [email protected]
OP5 AB www.op5.se
Lead Developer
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]