Page 1 of 1

NSCA patches

Posted: Fri Jan 24, 2014 3:32 pm
by SoulA
I have a few patches that I made for the NSCA daemon to fix a few bugs I found. I also have a recompiled version of the following that fixes an issue there:

http://exchange.nagios.org/directory/Ad ... nt/details

Where might I be able to contribute those? I know NSCA has fallen out of favor but unfortunately I'm still stuck with it for the time being. I'm not really a fan of just throwing them up on the tracker. Is there a github or something like that?

Re: NSCA patches

Posted: Fri Jan 24, 2014 3:49 pm
by slansing
NSCA, and especially NSCA win are tough ones. Specifically, NSCA win is not actively maintained anymore as far as I know, because most users grab NSClient and use the already included NSCA module. I would get in touch with the sourceforge mailing list /devel forums on that one.

Re: NSCA patches

Posted: Sat Feb 08, 2014 9:25 am
by SoulA
I was under the impression those were shut down in favor of these forums.

http://sourceforge.net/mailarchive/foru ... gios-devel

Re: NSCA patches

Posted: Sun Feb 09, 2014 1:09 pm
by SoulA
For what is worth I put my "fork" here:

https://github.com/awiddersheim/nsca-aw

I started this project after the NSCA daemon (running in single mode) hung in our production environment. This started my bug hunt and it turns out there are a few nasty bugs especially when running in single mode which I believe is now the default but I could be misremembering.

I changed a lot of stuff and I'm not sure that all of it works yet. Most of my changes were to just get the code readable and the logging better. In an effort to hopefully save someone's time I'll hit on the more major bugs that I found.

This commit hopefully fixes the bug that originally started me down this path. An incorrect call to fcntl() has the potential to not put sockets into non-blocking mode when running the NSCA daemon in "single" mode. This can result in the daemon hanging forever. There is no error checking around these calls so you would never really know that. I have a commit somewhere that adds error checking to this system call among many others.
https://github.com/awiddersheim/nsca-aw ... 76c2d91a63

Memory leak fixes:
https://github.com/awiddersheim/nsca-aw ... 0a8e79a655
https://github.com/awiddersheim/nsca-aw ... e91a890d7e
https://github.com/awiddersheim/nsca-aw ... daf7d4218d

For the windows client that was posted the major change I made was to bring the code up to date with the latest release of NSCA which adds some additional features. Also, the author removed the alarm() timeouts to get things to work in Windows but never replaced with anything. This can result in the send_nsca program getting stuck running forever. I added in some additional code that replicates what alarm() does for NIX.

Re: NSCA patches

Posted: Mon Feb 10, 2014 11:20 am
by slansing
Excellent, I'm actually going to move this thread to the Plugin Development section, I believe it will gain more traction there.

Re: NSCA patches

Posted: Thu Mar 13, 2014 12:03 pm
by SoulA
Here is another patch that fixes packet age comparison:

https://github.com/awiddersheim/nsca-aw ... 95ec092592

Re: NSCA patches

Posted: Thu Mar 13, 2014 12:12 pm
by slansing
Ah, excellent! Thank you for posting this.