Fix haproxy nrpe checks

From stable/18.02 onwards, charmhelpers symlink has been removed from
  the hooks directory. On fresh deploys, this caused check_haproxy*
  scripts not to be copied to /usr/local/lib/nagios/plugins.

  This change uses new copy_nrpe_checks arg available to choose a
  different location than the default.

Change-Id: Ia0a78dd2ace60dd77e81382b8018c04bbc0e2ebf
Closes-Bug: 1796830
Signed-off-by: Alvaro Uria <alvaro.uria@canonical.com>
This commit is contained in:
Alvaro Uria 2018-10-09 12:18:38 +02:00 committed by Ryan Beisner
parent 1fff65bd5b
commit 65c90e7c27
1 changed files with 7 additions and 1 deletions

View File

@ -730,7 +730,13 @@ def update_nrpe_config():
hostname = nrpe.get_nagios_hostname()
current_unit = nrpe.get_nagios_unit_name()
nrpe_setup = nrpe.NRPE(hostname=hostname)
nrpe.copy_nrpe_checks()
nrpe_files_dir = os.path.join(
os.getenv('CHARM_DIR'),
'charmhelpers',
'contrib',
'openstack',
'files')
nrpe.copy_nrpe_checks(nrpe_files_dir)
nrpe.add_init_service_checks(nrpe_setup, services(), current_unit)
nrpe.add_haproxy_checks(nrpe_setup, current_unit)
api_port = determine_api_port(config('bind-port'),