Discrepancy between command definitions and actual implementation

Andreas Ericsson ae at op5.se
Mon Mar 9 13:32:51 CET 2009


Thomas Guyot-Sionnest wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> The documentation for ACKNOWLEDGE_{SVC,HOST}_PROBLEM commands in Nagios
> 2.x and 3.x says to use 1 for sticky and 0 for non-sticky ack's; however
> the way it's currently implemented is using the following macros for
> non-sticky and sticky ack's respectively:
> 
> include/common.h:#define ACKNOWLEDGEMENT_NORMAL          1
> include/common.h:#define ACKNOWLEDGEMENT_STICKY          2
> 
> Looks like it's always been like that so I think the best would be to
> fix the documentation... At least for the current releases. OTOH this
> will leave broken any home-build script that send the command according
> to the documentation.
> 

Are you sure it's not just a bitshift thing, like so:

   foo->ack_type = 1 << ack_type_from_command;

That's how I'd have done it, and then let ack_type serve doubly as
"has_been_acked" sort of thing.

I haven't checked myself though, so I could be completely wrong (I'm
lazy today, as it's a fine spring day in sweden :-))

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H




More information about the Developers mailing list