NRPE and include_dir

Andreas Ericsson ae at op5.se
Tue Mar 15 16:56:17 CET 2011


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.

> 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.

-- 
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.

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