Re: [Nagios-devel] Debug Mode Fix for NRPE

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] Debug Mode Fix for NRPE

Post by Guest »

Stephen Kuenzli wrote:
> Good morning,
> I am doing some work with NRPE and I ran across a
> problem with DEBUG mode (the #define DEBUG, not the
> debug configuration directive in nrpe.cfg).
>
> If you #define DEBUG 1 and compile you will get a
> compile error for an undeclared variable:
> nrpe.c: In function `handle_connection':
> nrpe.c:788: error: `fp' undeclared (first use in this
> function)
> nrpe.c:788: error: (Each undeclared identifier is
> reported only once
> nrpe.c:788: error: for each function it appears in.)
>
> I have fixed this error, and hopefully made the
> program more useful by:
> 1. Declaring FILE pointers for both sending and
> receiving NRPE packets
> 2. Writing the sent and received NRPE packets for both
> nrpe and check_nrpe to the filesystem as:
> * /tmp/packet-check_nrpe-send
> * /tmp/packet-check_nrpe-receive
> * /tmp/packet-nrpe-receive
> * /tmp/packet-nrpe-send
>
> These files are very useful for helping implement
> applications that interoprate with nrpe and
> check_nrpe.
>
> Note that the #define DEBUG is not present in any
> header files currently, and I did not add it. I have
> been testing with #define DEBUG 1 in common.h, though
> this is not included in the patch. Perhaps #define
> DEBUG 0 should be set in common.h by default.
>
> The attached patch is in unified diff format. This is
> my first time preparing a patch with diff (I usually
> work within the happy confines of CVS'
> tag/branch/merge structure), so if I have left
> something out please let me know. You should be able
> to apply the patch with:
> patch -p 1 -i nrpe_debug.patch
>
> when you are in the root of an nrpe source
> distribution/module.
>

Thanks. I'll merge it with current development of nrpe (gotta get those
sources to public CVS soon).

--
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]
Locked