Merge lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk-add-nagios into lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk

Proposed by Thomi Richards
Status: Merged
Approved by: Celso Providelo
Approved revision: 11
Merged at revision: 11
Proposed branch: lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk-add-nagios
Merge into: lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk
Diff against target: 71 lines (+24/-0)
4 files modified
config.yaml (+5/-0)
hooks/actions.py (+15/-0)
hooks/services.py (+1/-0)
metadata.yaml (+3/-0)
To merge this branch: bzr merge lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk-add-nagios
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+266992@code.launchpad.net

Commit message

Add nagios checks.

Description of the change

Add nagios checks.

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

Thanks, Thomi.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-06-17 03:38:06 +0000
3+++ config.yaml 2015-08-05 04:04:49 +0000
4@@ -8,3 +8,8 @@
5 type: string
6 description: |
7 base64 encoded string with the config file for adt-cloud-worker
8+ nagios_context:
9+ type: string
10+ default: ""
11+ description: |
12+ Used by the nrpe subordinate charms.
13
14=== modified file 'hooks/actions.py'
15--- hooks/actions.py 2015-07-23 16:59:33 +0000
16+++ hooks/actions.py 2015-08-05 04:04:49 +0000
17@@ -11,6 +11,8 @@
18 from charmhelpers.core.services import helpers
19 from charmhelpers.payload import (archive, execd)
20
21+from charmhelpers.contrib.charmsupport import nrpe
22+
23
24 REQUIRED_PACKAGES = [
25 'python-virtualenv', 'python3-dev', 'python3-jinja2'
26@@ -124,3 +126,16 @@
27 data = super(WebsiteRelation, self).provide_data()
28 data['port'] = 8000
29 return data
30+
31+
32+def nrpe_external_master_relation(service_name):
33+ ''' Configure the nrpe-external-master relation '''
34+ nrpe_compat = nrpe.NRPE()
35+
36+ nrpe_compat.add_check(
37+ shortname="check_app_http",
38+ description="Check app http",
39+ check_cmd="/usr/lib/nagios/plugins/check_http -I 127.0.0.1 -p 8000 -e ' 200 OK' -u '/'",
40+ )
41+
42+ nrpe_compat.write()
43
44=== added symlink 'hooks/nrpe-external-master-relation-changed'
45=== target is u'hooks.py'
46=== modified file 'hooks/services.py'
47--- hooks/services.py 2015-07-23 00:17:23 +0000
48+++ hooks/services.py 2015-08-05 04:04:49 +0000
49@@ -33,6 +33,7 @@
50 target='/etc/init/result-enum-api.conf'),
51 actions.publish_website_relation_data,
52 actions.log_start,
53+ actions.nrpe_external_master_relation,
54 ],
55 },
56 ])
57
58=== modified file 'metadata.yaml'
59--- metadata.yaml 2015-07-21 00:36:40 +0000
60+++ metadata.yaml 2015-08-05 04:04:49 +0000
61@@ -7,6 +7,9 @@
62 website:
63 interface: http
64 optional: true
65+ nrpe-external-master:
66+ interface: nrpe-external-master
67+ scope: container
68 requires:
69 mongodb:
70 interface: mongodb
71\ No newline at end of file

Subscribers

People subscribed via source and target branches

to all changes: