Merge lp:~timkuhlman/charms/trusty/postgresql/nagios-fix into lp:charms/trusty/postgresql

Proposed by Tim Kuhlman
Status: Merged
Merged at revision: 138
Proposed branch: lp:~timkuhlman/charms/trusty/postgresql/nagios-fix
Merge into: lp:charms/trusty/postgresql
Diff against target: 26 lines (+4/-1)
2 files modified
hooks/nagios.py (+1/-0)
hooks/service.py (+3/-1)
To merge this branch: bzr merge lp:~timkuhlman/charms/trusty/postgresql/nagios-fix
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
Stuart Bishop (community) Approve
Review via email: mp+281247@code.launchpad.net

Description of the change

The nagios check is setup but it is unable to access the postgres database. It was missing both its .pgpass file and the a correct entry in pg_hba.conf

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Almost. On a fresh install, the nagios user may not yet exist (it gets created by the subordinate), and update_nagios_pgpass() fails.

I'll see about a quick fix and land this.

Revision history for this message
Stuart Bishop (stub) :
review: Approve
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/1920/

review: Needs Fixing (automated testing)
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-aws/1900/

review: Needs Fixing (automated testing)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nagios.py'
2--- hooks/nagios.py 2015-08-10 17:04:02 +0000
3+++ hooks/nagios.py 2015-12-22 19:08:40 +0000
4@@ -61,6 +61,7 @@
5
6 @data_ready_action
7 def update_nrpe_config():
8+ update_nagios_pgpass()
9 nrpe = NRPE()
10
11 user = nagios_username()
12
13=== modified file 'hooks/service.py'
14--- hooks/service.py 2015-11-27 07:56:46 +0000
15+++ hooks/service.py 2015-12-22 19:08:40 +0000
16@@ -357,7 +357,9 @@
17 add('local', 'all', 'postgres', 'peer', 'map=juju_charm')
18
19 # The local unit needs access to its own database. Let every local
20- # user connect to their matching PostgreSQL user, if it exists.
21+ # user connect to their matching PostgreSQL user, if it exists and nagios
22+ # with a password.
23+ add('local', 'all', '_juju_nagios', 'password')
24 add('local', 'all', 'all', 'peer')
25
26 # Peers need replication access as the charm replication user.

Subscribers

People subscribed via source and target branches

to all changes: