NagiosEnterprises / nrpe

NRPE Agent
GNU General Public License v2.0
263 stars 134 forks source link

Referring to one property within another inside the Nagios NRPE config file (nrpe.cfg) #141

Closed mskadu closed 7 years ago

mskadu commented 7 years ago

Hello there. To begin with, thank you for the excellent work. In continuation with this thread on Stackoverflow, if I can please make a feature request.

Within the NRPE config file (nrpe.cfg) and similar ones within Nagios fold, please make it possible to refer one property from another. For example, today what looks like the follows

..
server_address=10.68.10.2
..
allowed_hosts=127.0.0.1,100.0.254,10.68.10.2
..

should be re-writable on the following lines

..
server_address=10.68.10.2
..
allowed_hosts=127.0.0.1,100.0.254,$server_address
..

Benefits should be obvious - hopefully?

hedenface commented 7 years ago

We will discuss it internally. Thanks!

hedenface commented 7 years ago

Are there any other parts in the nrpe.cfg file you think this may make sense? I can see the benefits in say an application like postfix - which is why they're there in the first place - but in nrpe's configuration I can't see any other use-case other than the server_address being re-usable. I think this would almost make sense just to force the server_address to be appended to the allowed_hosts (via a configuration option).

What are your thoughts?

mskadu commented 7 years ago

Actually server_address was just an example. I meant to say pretty much any property should be referrals in another. Obviously if the wrong combination is used, it will invalidate the config.

hedenface commented 7 years ago

No, I definitely understood that you were only using that one as an example - what I'm asking is are there any other spots in the configuration file that ever be re-used other than that one?

For example, are you ever going to use:

allow_bash_command_substition=$command_prefix

or

command_timeout=$connection_timeout

I can't actually think of a use-case where the work to do this would be justified. I do like the idea of adding the server address automatically to allowed hosts.

mskadu commented 7 years ago

Apologies for the delay in response. I was away on holiday.

Coming to think of it, I cannot think of any other example. I guess my need was down to being able to add server address to the allowed hosts' list.

I would like very much to say that I'd like to (like in code) define, $connection_timeout at the top and use it elsewhere in the config file. But, in reality, I don't see that happening.

Hope this helps.

hedenface commented 7 years ago

We've decided against implementing this feature. Although it is a great (and very useful) feature in some projects - the first and best that comes to mind is postfix - it doesn't seem to bring the same value here.

We carefully analyzed the use case for NRPE, and couldn't see it being used for more than just that one possibility.

Thank you for the suggestion, though.