Merge ~cjwatson/turnip:fix-celery-nagios-2 into turnip:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 754ab056010df646e900c6d2f7111d5f06e33334
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/turnip:fix-celery-nagios-2
Merge into: turnip:master
Diff against target: 18 lines (+5/-2)
1 file modified
charm/turnip-celery/reactive/turnip-celery.py (+5/-2)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Thiago F. Pappacena (community) Approve
Review via email: mp+392461@code.launchpad.net

Commit message

charm: Cope with different celery command names

Description of the change

The command name for the running celery process can apparently be either "celery" or "python2" depending on exact details of process lifecycle. Adjust our Nagios checks to cope with this.

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/turnip-celery/reactive/turnip-celery.py b/charm/turnip-celery/reactive/turnip-celery.py
2index fd1b6f6..ea49f2c 100644
3--- a/charm/turnip-celery/reactive/turnip-celery.py
4+++ b/charm/turnip-celery/reactive/turnip-celery.py
5@@ -84,8 +84,11 @@ def nrpe_available():
6 ['/usr/lib/nagios/plugins/check_procs', '-c', '1:128',
7 # We need some double-quoting here because
8 # NrpeExternalMasterProvides.add_check just joins the argument list
9- # with spaces rather than doing appropriate shell quoting.
10- '-C', 'celery', '-a', "'-A turnip.tasks worker'"],
11+ # with spaces rather than doing appropriate shell quoting. Also
12+ # note that ['-C', 'celery'] would be unsafe because the command
13+ # name seems to be either celery or python2 depending on exact
14+ # details of the process lifecycle.
15+ '--ereg-argument-array', "'celery.*-A turnip.tasks worker'"],
16 name='check_celery',
17 description='Git celery check',
18 context=config['nagios_context'])

Subscribers

People subscribed via source and target branches