Merge lp://qastaging/~chad.smith/charms/trusty/nrpe/trunk into lp://qastaging/charms/trusty/nrpe

Proposed by Chad Smith
Status: Merged
Merged at revision: 39
Proposed branch: lp://qastaging/~chad.smith/charms/trusty/nrpe/trunk
Merge into: lp://qastaging/charms/trusty/nrpe
Diff against target: 231 lines (+107/-12)
7 files modified
hooks/nrpe_helpers.py (+7/-0)
hooks/nrpe_utils.py (+13/-0)
hooks/services.py (+1/-0)
tests/10-tests (+8/-8)
tests/11-monitors-configurations (+2/-2)
tests/13-monitors-config (+2/-2)
tests/14-basic-nrpe-external-master (+74/-0)
To merge this branch: bzr merge lp://qastaging/~chad.smith/charms/trusty/nrpe/trunk
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
Chad Smith (community) Abstain
Stuart Bishop (community) Approve
Review via email: mp+284986@code.qastaging.launchpad.net

Description of the change

This fixes lp:1532281.

When setting nagions_host_type = "host" on nrpe, all related principals need to write the proper hostname in their service files.

Principals related via nrpe-external-master already look in the nrpe-external-master relation for nagios_hostname and nagios_host_context before writing services__ files via calls to charmhelpers/contrib/charmsupport/nrpe:get_nagios_hostname and get_nagios_context.

This branch publishes these two values: nagios_hostname and nagios_host_context as expected by charmhelpers utility functions.

Principals calling get_nagios_hostname will properly write a the host_name in their nagios service__ files matching the host_name definition created by nrpe. This way principals and subordinate nrpe stay synchronized.

to test:
juju deploy local
./tests/14-basic-nrpe-external-master

To post a comment you must log in.
45. By Chad Smith

add comment referencing charmhelpers

Revision history for this message
Stuart Bishop (stub) wrote :

All looks good to me, and tests are fine. Thanks for fixing the unrelated tests too (for Juju 1.25 compatibility).

review: Approve
Revision history for this message
Stuart Bishop (stub) wrote :

There is still a test failing, unless run against a freshly bootstrapped environment, due to a hard coded unit number. This is still landable, as *all* the tests currently fail on trunk unless run against a freshly bootstrapped environment.

$ tests/10-tests
2016-02-04 11:20:37 Starting deployment of local
2016-02-04 11:20:37 Deploying services...
2016-02-04 11:20:37 Deploying service mysql using cs:trusty/mysql-33
2016-02-04 11:20:40 Deploying service nrpe using /tmp/charmqWiN9t/trusty/trunk
2016-02-04 11:21:48 Config specifies num units for subordinate: nrpe
2016-02-04 11:22:14 Adding relations...
2016-02-04 11:22:14 Adding relation nrpe:monitors <-> nagios:monitors
2016-02-04 11:22:14 Adding relation nrpe:local-monitors <-> mysql:local-monitors
2016-02-04 11:23:19 Exposing service 'nagios'
2016-02-04 11:23:19 Deployment complete in 162.00 seconds
.............E..
======================================================================
ERROR: test_nagios_host_context (__main__.TestDeployment)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/10-tests", line 227, in test_nagios_host_context
    self.check_nrpe_setting(**test_config)
  File "tests/10-tests", line 42, in check_nrpe_setting
    nrpe_contents = self.nrpe_sentry.file_contents(filename)
  File "/usr/lib/python2.7/dist-packages/amulet/sentry.py", line 92, in file_contents
    raise IOError(output)
IOError: cat: /var/lib/nagios/export/host__bob-mysql-0.cfg: No such file or directory

----------------------------------------------------------------------
Ran 16 tests in 755.998s

Revision history for this message
Chad Smith (chad.smith) :
review: Abstain
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/2451/

review: Needs Fixing (automated testing)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: