NRPE and include_dir

Mike Chesnut mikec at aggregateknowledge.com
Sat Apr 9 01:32:52 CEST 2011


On 03/15/2011 10:23 AM, Mike Chesnut wrote:
> 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.

I have this patch completed, and we've been running it in production for 
a couple of weeks now with no problems.

Should I submit the patch officially somewhere?  (Is it wanted?)  I'm 
not finding any information on how to submit an NRPE patch.  Ditto for 
the documentation, which seems to only exist in .odt form.

Any pointers/opinions would be greatly appreciated.

Thanks,
Mike

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
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