Merge lp:~pedronis/charms/trusty/tanuki-spec-manager/nrpe-support into lp:~tanuki/charms/trusty/tanuki-spec-manager/trunk

Proposed by Samuele Pedroni
Status: Merged
Approved by: Samuele Pedroni
Approved revision: 18
Merged at revision: 15
Proposed branch: lp:~pedronis/charms/trusty/tanuki-spec-manager/nrpe-support
Merge into: lp:~tanuki/charms/trusty/tanuki-spec-manager/trunk
Diff against target: 68 lines (+22/-0)
4 files modified
config.yaml (+5/-0)
hooks/actions.py (+13/-0)
hooks/services.py (+1/-0)
metadata.yaml (+3/-0)
To merge this branch: bzr merge lp:~pedronis/charms/trusty/tanuki-spec-manager/nrpe-support
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Celso Providelo (community) Approve
Review via email: mp+266885@code.launchpad.net

Commit message

nagios (nrpe) support

Description of the change

nagios (nrpe) support

followed what the cassandra charm does as an example of service manager charm with nrpe support

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

Samuele,

Very nice!

I presume NRPE() uses config['nagios_context'] internally, correct ?

Thanks for working on this.

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

+1

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-07-16 20:06:47 +0000
3+++ config.yaml 2015-08-04 14:31:44 +0000
4@@ -23,3 +23,8 @@
5 default: "specmgr_app,appserver"
6 description: |
7 comma separated list of roles for the appserver/common DB user
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-20 16:26:03 +0000
16+++ hooks/actions.py 2015-08-04 14:31:44 +0000
17@@ -12,6 +12,7 @@
18 from charmhelpers.core.services import helpers
19 from charmhelpers.payload import (archive, execd)
20
21+from charmhelpers.contrib.charmsupport import nrpe
22
23 REQUIRED_PACKAGES = [
24 'python-virtualenv', 'python3-dev', 'libpq5'
25@@ -202,3 +203,15 @@
26 def _unit_in(self, units):
27 return hookenv.local_unit() in units
28
29+
30+def nrpe_external_master_relation(service_name):
31+ ''' Configure the nrpe-external-master relation '''
32+ nrpe_compat = nrpe.NRPE()
33+
34+ nrpe_compat.add_check(
35+ shortname="check_app_http",
36+ description="Check app http",
37+ check_cmd="/usr/lib/nagios/plugins/check_http -I 127.0.0.1 -p 8000 -e ' 200 OK' -u '/'",
38+ )
39+
40+ nrpe_compat.write()
41
42=== added symlink 'hooks/nrpe-external-master-relation-changed'
43=== target is u'hooks.py'
44=== modified file 'hooks/services.py'
45--- hooks/services.py 2015-07-16 20:06:47 +0000
46+++ hooks/services.py 2015-08-04 14:31:44 +0000
47@@ -29,6 +29,7 @@
48 target='/etc/init/spec-manager.conf'),
49 actions.write_db_config,
50 actions.log_start,
51+ actions.nrpe_external_master_relation,
52 ],
53 },
54 ])
55
56=== modified file 'metadata.yaml'
57--- metadata.yaml 2015-07-16 20:06:47 +0000
58+++ metadata.yaml 2015-08-04 14:31:44 +0000
59@@ -7,6 +7,9 @@
60 website:
61 interface: http
62 optional: true
63+ nrpe-external-master:
64+ interface: nrpe-external-master
65+ scope: container
66
67 requires:
68 db:

Subscribers

People subscribed via source and target branches

to all changes: