Fix Billy Olsen's suggestions
This commit is contained in:
parent
8c87320586
commit
dc0bfbc00d
2
Makefile
2
Makefile
|
@ -37,4 +37,4 @@ unit_test: .venv
|
||||||
|
|
||||||
functional_test:
|
functional_test:
|
||||||
@echo Starting amulet tests...
|
@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
|
||||||
|
|
|
@ -180,3 +180,4 @@ options:
|
||||||
in format [<vhost>, <queue>, <warn>, <crit>]
|
in format [<vhost>, <queue>, <warn>, <crit>]
|
||||||
- ['/', 'queue1', 10, 20]
|
- ['/', 'queue1', 10, 20]
|
||||||
- ['/', 'queue2', 200, 300]
|
- ['/', 'queue2', 200, 300]
|
||||||
|
Wildcards '*' are accepted to monitor all vhosts and/or queues
|
||||||
|
|
|
@ -51,7 +51,8 @@ from charmhelpers.core.hookenv import (
|
||||||
unit_get,
|
unit_get,
|
||||||
is_relation_made,
|
is_relation_made,
|
||||||
Hooks,
|
Hooks,
|
||||||
UnregisteredHookError
|
UnregisteredHookError,
|
||||||
|
charm_dir
|
||||||
)
|
)
|
||||||
from charmhelpers.core.host import (
|
from charmhelpers.core.host import (
|
||||||
cmp_pkgrevno,
|
cmp_pkgrevno,
|
||||||
|
@ -85,9 +86,8 @@ NAGIOS_PLUGINS = '/usr/local/lib/nagios/plugins'
|
||||||
SCRIPTS_DIR = '/usr/local/bin'
|
SCRIPTS_DIR = '/usr/local/bin'
|
||||||
STATS_CRONFILE = '/etc/cron.d/rabbitmq-stats'
|
STATS_CRONFILE = '/etc/cron.d/rabbitmq-stats'
|
||||||
STATS_DATAFILE = os.path.join(RABBIT_DIR, 'data',
|
STATS_DATAFILE = os.path.join(RABBIT_DIR, 'data',
|
||||||
subprocess.check_output(
|
'{}_queue_stats.dat'.format(
|
||||||
['hostname', '-s']).strip() +
|
socket.gethostname()))
|
||||||
'_queue_stats.dat')
|
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('install')
|
@hooks.hook('install')
|
||||||
|
@ -472,7 +472,7 @@ def update_nrpe_checks():
|
||||||
if config('stats_cron_schedule'):
|
if config('stats_cron_schedule'):
|
||||||
script = os.path.join(SCRIPTS_DIR, 'collect_rabbitmq_stats.sh')
|
script = os.path.join(SCRIPTS_DIR, 'collect_rabbitmq_stats.sh')
|
||||||
cronjob = "{} root {}\n".format(config('stats_cron_schedule'), script)
|
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)
|
'collect_rabbitmq_stats.sh'), script)
|
||||||
write_file(STATS_CRONFILE, cronjob)
|
write_file(STATS_CRONFILE, cronjob)
|
||||||
elif os.path.isfile(STATS_CRONFILE):
|
elif os.path.isfile(STATS_CRONFILE):
|
||||||
|
|
Loading…
Reference in New Issue