Re: [Nagios-devel] NSCA 2.7 not working in single-process mode (bug)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] NSCA 2.7 not working in single-process mode (bug)

Post by Guest »


--Apple-Mail-76-392480348
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed


On 24 Jan 2007, at 16:36, Rudolf van der Leeden wrote:

> As of NSCA 2.6 up to NSCA CVS the nsca daemon is no longer running
> successfully in single-process mode (--single option).
> I discovered this during my recent upgrade to the Nagios 2.7.
>
> The symptons have been described in earlier postings:
> nsca responds to exactly one client request and stops responding
> (while still running).
> There is no solution execpt avoiding the --single mode and working
> with --inetd or --daemon mode instead, or using NSCA 2.5.
>
> I checked the source nsca.c and found a workaround:
> Enable in the function "accept_connection" the following if statement
> again:
> /* REMOVED 04/03/2006 EG - already done in
> wait_for_connections() */
> /*
> if(mode==SINGLE_PROCESS_DAEMON)
> register_read_handler(sock,accept_connection,NULL);
> */
> The real problem seems to lie in the way pfds.events is maintained.
> handle_events() clears it ( pfds.events&=~POLLIN; ) and
> register_poll() sets it again in NSCA 2.5 because
> register_read_handler is called which in turn calls register_poll().
> NSCA 2.7 does not call register_poll() and hence the fd is removed as
> events=0 (done at the end of handle_events().
>
> Could someone familiar with the code please have a look and check
> the root cause of the problem.
> I would be willing to work on a patch.

Hi Rudolf,

Yes, we've been hit by this too. We only discovered it yesterday, so
thank you for mentioning it!

The patch you suggest does appear to work. We've developed some test
scripts which fail with the current NSCA versions, but pass after
applying your recommended changes.

Our story is here: http://altinity.blogs.com/dotorg/2007/01/
the_importance_.html

Ethan, please consider adding the test scripts into the NSCA
distribution. We'd be happy to help with maintaining it.

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon



--Apple-Mail-76-392480348
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1

On 24 Jan 2007, at =
16:36, Rudolf van der Leeden wrote:As of NSCA 2.6 up to NSCA CVS the nsca daemon is no =
longer running =A0successfully in single-process mode (--single =
option).I discovered this during my =
recent upgrade to the Nagios 2.7.The symptons have been described =
in earlier postings:=A0 =A0 nsca responds to exactly =
one client request and stops responding =A0(while =
still running).There is no solution execpt =
avoiding the --single mode and working =A0with =
--inetd or --daemon mode instead, or using NSCA 2.5.<DIV =
style=3D"margin-top:

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked