Debug Mode Fix for NRPE
Andreas Ericsson
ae at op5.se
Sat Feb 12 20:18:06 CET 2005
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 andreas.ericsson at op5.se
OP5 AB www.op5.se
Lead Developer
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
More information about the Developers
mailing list