Merge lp:~deej/charms/xenial/errors/nrpe-relation-data into lp:~daisy-pluckers/charms/xenial/errors/trunk

Proposed by David Lawson
Status: Merged
Merged at revision: 111
Proposed branch: lp:~deej/charms/xenial/errors/nrpe-relation-data
Merge into: lp:~daisy-pluckers/charms/xenial/errors/trunk
Diff against target: 23 lines (+9/-2)
1 file modified
hooks/nrpe-external-master-relation-changed (+9/-2)
To merge this branch: bzr merge lp:~deej/charms/xenial/errors/nrpe-relation-data
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+354285@code.launchpad.net

Commit message

[deej] Use nrpe relation data to set hostname and default service group

Description of the change

[deej] Use nrpe relation data to set hostname and default service group

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/nrpe-external-master-relation-changed'
--- hooks/nrpe-external-master-relation-changed 2015-01-20 18:14:09 +0000
+++ hooks/nrpe-external-master-relation-changed 2018-09-05 03:07:27 +0000
@@ -1,10 +1,17 @@
1#!/bin/bash1#!/bin/bash
2set -eux2set -eux
3. hooks/common3. hooks/common
4export NAGIOS_HOSTNAME="ue-${REGION}-et-${JUJU_UNIT_NAME//\//-}"4relation_id=$(relation-ids nrpe-external-master)
5if [ -z "$relation_id" ]; then
6 echo "No nrpe-external-master relation yet. Skipping nrpe setup"
7 return 0
8fi
9relation_unit=$(relation-list -r $relation_id)
10nagios_host_context=$(relation-get -r $relation_id nagios_host_context $relation_unit)
11export NAGIOS_HOSTNAME=$(relation-get -r $relation_id nagios_hostname $relation_unit)
512
6export INSTANCE_TYPE13export INSTANCE_TYPE
7export NAGIOS_SERVICEGROUP="ue-${REGION}-et"14export NAGIOS_SERVICEGROUP=$nagios_host_context
8export PROJECT="UE"15export PROJECT="UE"
916
10export SERVICE_DESCRIPTION="Error tracker app server"17export SERVICE_DESCRIPTION="Error tracker app server"

Subscribers

People subscribed via source and target branches

to all changes: