Merge ~xavpaice/charm-nagios:pagerduty into ~nagios-charmers/charm-nagios:master

Proposed by Xav Paice
Status: Merged
Approved by: Barry Price
Approved revision: 7f69a734f50cc6f9e21e4936369c522210b126ff
Merged at revision: b128abd5648c4f8958e6e5a2dcd3fb9fb88ecd69
Proposed branch: ~xavpaice/charm-nagios:pagerduty
Merge into: ~nagios-charmers/charm-nagios:master
Diff against target: 50 lines (+11/-2)
3 files modified
config.yaml (+7/-0)
hooks/templates/pagerduty_nagios_cfg.tmpl (+1/-1)
hooks/upgrade-charm (+3/-1)
Reviewer Review Type Date Requested Status
Barry Price Approve
Review via email: mp+352052@code.launchpad.net

Commit message

new config option to change pagerduty alert levels

To post a comment you must log in.
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Barry Price (barryprice) wrote :

LGTM +1

review: Approve
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

Change successfully merged at revision b128abd5648c4f8958e6e5a2dcd3fb9fb88ecd69

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/config.yaml b/config.yaml
index 8dd857f..eca8add 100644
--- a/config.yaml
+++ b/config.yaml
@@ -170,3 +170,10 @@ options:
170 A string to pass to the Nagios load monitoring command. Default is170 A string to pass to the Nagios load monitoring command. Default is
171 to report warning at 5.0, 4.0 and 3.0 averages, critical at 10.0, 171 to report warning at 5.0, 4.0 and 3.0 averages, critical at 10.0,
172 6.0 and 4.0.172 6.0 and 4.0.
173 pagerduty_notification_levels:
174 default: w,u,c,r
175 type: string
176 description: |
177 A string to use for the service_notification_options in the
178 pagerduty contact configuration. Remove w to avoid paging for
179 warning events.
diff --git a/hooks/templates/pagerduty_nagios_cfg.tmpl b/hooks/templates/pagerduty_nagios_cfg.tmpl
index 155aae3..e5c8751 100644
--- a/hooks/templates/pagerduty_nagios_cfg.tmpl
+++ b/hooks/templates/pagerduty_nagios_cfg.tmpl
@@ -7,7 +7,7 @@ define contact {
7 alias PagerDuty Pseudo-Contact7 alias PagerDuty Pseudo-Contact
8 service_notification_period 24x78 service_notification_period 24x7
9 host_notification_period 24x79 host_notification_period 24x7
10 service_notification_options w,u,c,r10 service_notification_options {{ notification_levels }}
11 host_notification_options d,r11 host_notification_options d,r
12 service_notification_commands notify-service-by-pagerduty12 service_notification_commands notify-service-by-pagerduty
13 host_notification_commands notify-host-by-pagerduty13 host_notification_commands notify-host-by-pagerduty
diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
index 88b6ecb..8349c36 100755
--- a/hooks/upgrade-charm
+++ b/hooks/upgrade-charm
@@ -26,6 +26,7 @@ livestatus_path = hookenv.config('livestatus_path')
26enable_pagerduty = hookenv.config('enable_pagerduty')26enable_pagerduty = hookenv.config('enable_pagerduty')
27pagerduty_key = hookenv.config('pagerduty_key')27pagerduty_key = hookenv.config('pagerduty_key')
28pagerduty_path = hookenv.config('pagerduty_path')28pagerduty_path = hookenv.config('pagerduty_path')
29notification_levels = hookenv.config('pagerduty_notification_levels')
29nagios_user = hookenv.config('nagios_user')30nagios_user = hookenv.config('nagios_user')
30nagios_group = hookenv.config('nagios_group')31nagios_group = hookenv.config('nagios_group')
31ssl_config = hookenv.config('ssl')32ssl_config = hookenv.config('ssl')
@@ -123,7 +124,8 @@ def enable_pagerduty_config():
123 template_values = {'enable_pagerduty': enable_pagerduty,124 template_values = {'enable_pagerduty': enable_pagerduty,
124 'pagerduty_key': pagerduty_key,125 'pagerduty_key': pagerduty_key,
125 'pagerduty_path': pagerduty_path,126 'pagerduty_path': pagerduty_path,
126 'proxy_switch': proxy_switch}127 'proxy_switch': proxy_switch,
128 'notification_levels': notification_levels}
127129
128 with open('hooks/templates/pagerduty_nagios_cfg.tmpl', 'r') as f:130 with open('hooks/templates/pagerduty_nagios_cfg.tmpl', 'r') as f:
129 templateDef = f.read()131 templateDef = f.read()

Subscribers

People subscribed via source and target branches