What is the purpose of this function? This is just weird.
what this does, is to force the user to add all files to one of the directories in search_path.
If the file does not exist, check_cmd will be empty, nrpe will restart and break nrpe on this unit.
you cannot for example use 'sudo /usr/lib/nagios/plugins/check_something' as check_cmd, since sudo is not in the correct path. a workaround for this, is to create a wrapper which only function is to call 'sudo /usr/lib/nagios/plugins/check_something'
if one still need to micromanage the user, maybe extend the search_path to os.environ['PATH']
and if the command is not found, dont create the file with an empty check_cmd, which breaks nrpe. and be sure to log this action
https://github.com/juju/charm-helpers/blob/v0.18.2/charmhelpers/contrib/charmsupport/nrpe.py#L164-L177
What is the purpose of this function? This is just weird.
what this does, is to force the user to add all files to one of the directories in search_path. If the file does not exist, check_cmd will be empty, nrpe will restart and break nrpe on this unit.
you cannot for example use 'sudo /usr/lib/nagios/plugins/check_something' as check_cmd, since sudo is not in the correct path. a workaround for this, is to create a wrapper which only function is to call 'sudo /usr/lib/nagios/plugins/check_something'
if one still need to micromanage the user, maybe extend the search_path to os.environ['PATH'] and if the command is not found, dont create the file with an empty check_cmd, which breaks nrpe. and be sure to log this action