summaryrefslogtreecommitdiff
path: root/hooks/charmhelpers/contrib/charmsupport/nrpe.py
diff options
context:
space:
mode:
Diffstat (limited to 'hooks/charmhelpers/contrib/charmsupport/nrpe.py')
-rw-r--r--hooks/charmhelpers/contrib/charmsupport/nrpe.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/hooks/charmhelpers/contrib/charmsupport/nrpe.py b/hooks/charmhelpers/contrib/charmsupport/nrpe.py
index 1c55b30..e3d10c1 100644
--- a/hooks/charmhelpers/contrib/charmsupport/nrpe.py
+++ b/hooks/charmhelpers/contrib/charmsupport/nrpe.py
@@ -410,16 +410,21 @@ def add_init_service_checks(nrpe, services, unit_name, immediate_check=True):
410 os.chmod(checkpath, 0o644) 410 os.chmod(checkpath, 0o644)
411 411
412 412
413def copy_nrpe_checks(): 413def copy_nrpe_checks(nrpe_files_dir=None):
414 """ 414 """
415 Copy the nrpe checks into place 415 Copy the nrpe checks into place
416 416
417 """ 417 """
418 NAGIOS_PLUGINS = '/usr/local/lib/nagios/plugins' 418 NAGIOS_PLUGINS = '/usr/local/lib/nagios/plugins'
419 nrpe_files_dir = os.path.join(os.getenv('CHARM_DIR'), 'hooks', 419 default_nrpe_files_dir = os.path.join(
420 'charmhelpers', 'contrib', 'openstack', 420 os.getenv('CHARM_DIR'),
421 'files') 421 'hooks',
422 422 'charmhelpers',
423 'contrib',
424 'openstack',
425 'files')
426 if not nrpe_files_dir:
427 nrpe_files_dir = default_nrpe_files_dir
423 if not os.path.exists(NAGIOS_PLUGINS): 428 if not os.path.exists(NAGIOS_PLUGINS):
424 os.makedirs(NAGIOS_PLUGINS) 429 os.makedirs(NAGIOS_PLUGINS)
425 for fname in glob.glob(os.path.join(nrpe_files_dir, "check_*")): 430 for fname in glob.glob(os.path.join(nrpe_files_dir, "check_*")):