diff --git a/Makefile b/Makefile index 5a777247..97606ea6 100644 --- a/Makefile +++ b/Makefile @@ -37,4 +37,4 @@ unit_test: .venv functional_test: @echo Starting amulet tests... - @juju test -v -p AMULET_HTTP_PROXY --timeout 900 + @juju test -v -p AMULET_HTTP_PROXY,OS_USERNAME,OS_TENANT_NAME,OS_REGION_NAME,OS_PASSWORD,OS_AUTH_URL --timeout 900 diff --git a/config.yaml b/config.yaml index a464c04b..0f021db8 100644 --- a/config.yaml +++ b/config.yaml @@ -180,3 +180,4 @@ options: in format [, , , ] - ['/', 'queue1', 10, 20] - ['/', 'queue2', 200, 300] + Wildcards '*' are accepted to monitor all vhosts and/or queues diff --git a/hooks/rabbitmq_server_relations.py b/hooks/rabbitmq_server_relations.py index 8e703576..a5e1cd9c 100755 --- a/hooks/rabbitmq_server_relations.py +++ b/hooks/rabbitmq_server_relations.py @@ -51,7 +51,8 @@ from charmhelpers.core.hookenv import ( unit_get, is_relation_made, Hooks, - UnregisteredHookError + UnregisteredHookError, + charm_dir ) from charmhelpers.core.host import ( cmp_pkgrevno, @@ -85,9 +86,8 @@ NAGIOS_PLUGINS = '/usr/local/lib/nagios/plugins' SCRIPTS_DIR = '/usr/local/bin' STATS_CRONFILE = '/etc/cron.d/rabbitmq-stats' STATS_DATAFILE = os.path.join(RABBIT_DIR, 'data', - subprocess.check_output( - ['hostname', '-s']).strip() + - '_queue_stats.dat') + '{}_queue_stats.dat'.format( + socket.gethostname())) @hooks.hook('install') @@ -472,7 +472,7 @@ def update_nrpe_checks(): if config('stats_cron_schedule'): script = os.path.join(SCRIPTS_DIR, 'collect_rabbitmq_stats.sh') cronjob = "{} root {}\n".format(config('stats_cron_schedule'), script) - rsync(os.path.join(os.getenv('CHARM_DIR'), 'scripts', + rsync(os.path.join(charm_dir(), 'scripts', 'collect_rabbitmq_stats.sh'), script) write_file(STATS_CRONFILE, cronjob) elif os.path.isfile(STATS_CRONFILE):