NRPE and include_dir

Mike Chesnut mikec at aggregateknowledge.com
Tue Mar 15 18:23:42 CET 2011


On 03/15/2011 08:56 AM, Andreas Ericsson wrote:
> On 03/15/2011 04:16 PM, Mike Chesnut wrote:
>> On 03/14/2011 07:00 PM, Mike Chesnut wrote:
>>> We're trying to use the include_dir directive in NRPE with an
>>> /etc/nagios/nrpe.d/ directory.  My assumption was that files in this
>>> directory would be loaded in alphanumeric order, but it seems to only
>>> load in alphabetical order, ignoring numerals.
>>
>> To follow up on this, it turns out that in nrpe.c, readdir() is used to
>> load files from the config directory, which is totally non-deterministic
>> in the order the files are read.
>>
>> I believe this to be a bug, as I think it's a reasonable expectation
>> (based on how pretty much every other program that allows you to include
>> a conf.d directory works) for the files to be loaded in alphanumeric order.
>>
>
> This should really only be a problem if you're loading more than one
> command with the same name. If that's the case, you've done something
> pretty severely wrong anyway since NRPE doesn't guarantee that either
> of them will win out and the order could thus change at any time. It's
> a tossup if we should use "first wins" or "last wins", and since it
> isn't documented it can (and possibly will) change.

So my assertion is that it's preferable for things like this to be 
well-defined (and documented), rather than being essentially random.

We have what I consider to be a pretty reasonable situation where this 
would be useful.  I'm happy to share the specifics if anybody's curious, 
but it seems to me that it'd be generally useful to the whole community 
to have things like this spelled out explicitly, one way or another.

>> Is there a reason anybody knows of that this belief is incorrect?  If
>> not, I'll work on a patch.
>>
>
> See above. If you still want to fix it, make sure you also update
> the documentation so that it's obvious what the order of domination
> is wrt commands with the same name.

Will do.  No guarantees I get to it, but hopefully.  If anybody has an 
objection to this change please let me know before I waste my time.

Thanks,
Mike

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list