Merge lp:~thedac/capomastro/charm-configurable-nagios-context into lp:~ubuntuone-hackers/capomastro/charm
Proposed by
David Ames
Status: | Merged |
---|---|
Merged at revision: | 59 |
Proposed branch: | lp:~thedac/capomastro/charm-configurable-nagios-context |
Merge into: | lp:~ubuntuone-hackers/capomastro/charm |
Diff against target: |
66 lines (+20/-7) 3 files modified
config.yaml (+10/-0) hooks/nrpe-external-master-relation-changed (+9/-6) templates/nrpe_service_file.tmpl (+1/-1) |
To merge this branch: | bzr merge lp:~thedac/capomastro/charm-configurable-nagios-context |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Manrique (community) | Approve | ||
Review via email: mp+250242@code.launchpad.net |
Description of the change
Make nagios_context configurable rather than hardcoded so staging and production use different service/hostgroups
Fix bug missing celery description for the celery check
This does not have to be the solution but something very much like this is required.
To post a comment you must log in.
Thanks for contributing this to our charm :)
TL;DR We can merge this if you think the issues I comment on below are not going to affect your use case, though we should fix them down the line (and that's work that we can tackle later, no need to trouble you with this).
Now for the gory details.
I noticed one thing while testing this (which I did by running the spec, while forgetting to set the proper nagios_context). nagios_context is only used in the nrpe-external- master- relation- changed hook; so:
1) If the nagios_context is changed via a juju set, the .cfg file won't be updated.
2) If the nagios_context is changed and *then* the relation is destroyed/readded, then a .cfg file is created with the new nagios_context *but* the old one is not deleted.
I'm talking about the files in /etc/nagios/nrpe.d; I notice (and checked) that you nuke /var/lib/ nagios/ export/ service_ * in the hook, so that part is covered.
I don't know enough about nagios to tell if this is important; I also imagine that for deployment purposes you won't make the same rookie mistake I made by not setting nagios_context correctly from the getgo. I'm OK with this addition to our charm if it serves your purposes within the constraints I just mentioned, but (pending your input on whether it's needed), I'd like to later fix the hook so it does the right thing with files in /etc/ (unless you tell me they're not really needed), and so that they also get updated upon changing the option in question.