Re: [Nagios-devel] CVS nrpe_check 'result' fix

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] CVS nrpe_check 'result' fix

Post by Guest »

Thanks for the report. This will be in CVS shortly.

On 5 Mar 2003 at 11:25, Erik Kruus wrote:

> It was bugging me that nrpe_check.c was not picking up the
> correct result code, giving me "GREEN" when load was
> WARNING or CRITICAL on nrpe machines.
>
> Debug log showed nrpe plugin was sending out a correct
> result code. However running nrpe_check from the command
> line to the same host and looking [echo $?] at the return
> status showed that nrpe_check was not getting the correct
> result.
>
> Comparing nrpe and nrpe_check CVS sources from a day or two
> ago shows that the nrpe.d does [correctly] htons to get the
> int16_t packet_struct::result value.
>
> But nrpe.c was using ntohl... oops! (at least for the
> endianness on my i686 box) ... it got truncated to zero!
>
> (The essential fix is a one-liner, so no diff just change the line)
>
> nrpe-2.0a1/src/check_nrpe.c
>
> /* get the return code from the remote plugin */
> /* result=(int16_t)ntohl(receive_packet.result_code); orig */
>
> result=(int16_t)ntohs(receive_packet.result_code); /*[ejk]*/
>
> /* [ejk] should also check ..packet.packet_version
> * and ..packet.packet_type for correctness/paranoia ?? */
>
> -----------
> Now check_nrpe shows yellow for WARNINGS, at least for me.
> Please CC me directly if this seems acceptable as I'm not on the lists
>
>
> Erik ([email protected])
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
> for complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Nagios-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/lis ... gios-devel
>



Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org






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