Merge lp:~verterok/charms/trusty/tanuki-result-enum-worker/negate-nrpe-check-when-disabled into lp:~tanuki/charms/trusty/tanuki-result-enum-worker/trunk

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 41
Merged at revision: 41
Proposed branch: lp:~verterok/charms/trusty/tanuki-result-enum-worker/negate-nrpe-check-when-disabled
Merge into: lp:~tanuki/charms/trusty/tanuki-result-enum-worker/trunk
Diff against target: 20 lines (+6/-2)
1 file modified
hooks/actions.py (+6/-2)
To merge this branch: bzr merge lp:~verterok/charms/trusty/tanuki-result-enum-worker/negate-nrpe-check-when-disabled
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+270326@code.launchpad.net

Commit message

Negate file_age check when the worker is disabled as a workaround until we get a better/different way of checking worker health.

Description of the change

Negate file_age check when the worker is disabled.

This is a temporary fix/workaround until we get a better/different way of checking worker health.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote :

Guillermo,

Actually, nagios `negate` plugin is not bad for deactivated services, while they exist it kind of make sense to check they are usable (load, memory, disk, etc) and are indeed not running. So, not bad at all.

I suspect you would have to refer to the negate complete path in config, "/usr/lib/nagios/plugins/negate", but fell free to ignore me if you have already checked it works in out instances.

[]

review: Approve
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

> Guillermo,
>
> Actually, nagios `negate` plugin is not bad for deactivated services, while
> they exist it kind of make sense to check they are usable (load, memory, disk,
> etc) and are indeed not running. So, not bad at all.
>
> I suspect you would have to refer to the negate complete path in config,
> "/usr/lib/nagios/plugins/negate", but fell free to ignore me if you have
> already checked it works in out instances.
The nrpe helper fills the full path for negate, so there is no need to specify the full path.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2015-09-01 04:57:02 +0000
3+++ hooks/actions.py 2015-09-07 18:53:42 +0000
4@@ -124,11 +124,15 @@
5 def nrpe_external_master_relation(service_name):
6 """Configure the nrpe-external-master relation."""
7 nrpe_compat = nrpe.NRPE()
8-
9+ config = hookenv.config()
10+ check_cmd = ('/usr/lib/nagios/plugins/check_file_age -c 60 '
11+ '{}'.format(NAGIOS_CONTROL_FILEPATH))
12+ if not config.get('active'):
13+ check_cmd = 'negate {}'.format(check_cmd)
14 nrpe_compat.add_check(
15 shortname='result_worker_status',
16 description='Worker app or worker rabbitmq check.',
17- check_cmd='check_file_age -c 60 %s' % NAGIOS_CONTROL_FILEPATH
18+ check_cmd=check_cmd
19 )
20 nrpe_compat.write()
21

Subscribers

People subscribed via source and target branches