Ensure nagios is enabled when enabling cluster status checks

Move the installation of the cluster status checking into
the conditional that checked with the NRPE directory exists.

This ensures that the managment plugin can be installed without
the charm being related to Nagios.

Change-Id: I998ba7c4b70207bb38f9898046f4e47bcb5723a4
Closes-Bug: 1781582
This commit is contained in:
James Page 2018-07-16 11:55:51 -04:00
parent 3bb84b61fc
commit 4d4c998072
1 changed files with 5 additions and 0 deletions

View File

@ -605,6 +605,11 @@ def update_nrpe_checks():
rsync(os.path.join(charm_dir(), 'scripts',
'check_rabbitmq_queues.py'),
os.path.join(NAGIOS_PLUGINS, 'check_rabbitmq_queues.py'))
if config('management_plugin'):
rsync(os.path.join(charm_dir(), 'scripts',
'check_rabbitmq_cluster.py'),
os.path.join(NAGIOS_PLUGINS, 'check_rabbitmq_cluster.py'))
if config('stats_cron_schedule'):
script = os.path.join(SCRIPTS_DIR, 'collect_rabbitmq_stats.sh')
cronjob = CRONJOB_CMD.format(schedule=config('stats_cron_schedule'),