NSCA patches

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
SoulA
Posts: 19
Joined: Mon Oct 10, 2011 9:47 am

NSCA patches

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NSCA patches

Post 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.
SoulA
Posts: 19
Joined: Mon Oct 10, 2011 9:47 am

Re: NSCA patches

Post by SoulA »

I was under the impression those were shut down in favor of these forums.

http://sourceforge.net/mailarchive/foru ... gios-devel
SoulA
Posts: 19
Joined: Mon Oct 10, 2011 9:47 am

Re: NSCA patches

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NSCA patches

Post by slansing »

Excellent, I'm actually going to move this thread to the Plugin Development section, I believe it will gain more traction there.
SoulA
Posts: 19
Joined: Mon Oct 10, 2011 9:47 am

Re: NSCA patches

Post by SoulA »

Here is another patch that fixes packet age comparison:

https://github.com/awiddersheim/nsca-aw ... 95ec092592
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NSCA patches

Post by slansing »

Ah, excellent! Thank you for posting this.
Locked