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

Proposed by Xav Paice
Status: Merged
Approved by: Jay Kuri
Approved revision: 30e72c8c40e03b4b296f69dfb15cfb4c3637a6c4
Merged at revision: 30e72c8c40e03b4b296f69dfb15cfb4c3637a6c4
Proposed branch: ~xavpaice/charm-nagios:lp1763576
Merge into: ~nagios-charmers/charm-nagios:master
Diff against target: 33 lines (+7/-2)
2 files modified
hooks/templates/nagios-pagerduty-flush-cron.tmpl (+1/-1)
hooks/upgrade-charm (+6/-1)
Reviewer Review Type Date Requested Status
Nagios Charm developers Pending
Review via email: mp+343472@code.launchpad.net

This proposal supersedes a proposal from 2018-04-14.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/hooks/templates/nagios-pagerduty-flush-cron.tmpl b/hooks/templates/nagios-pagerduty-flush-cron.tmpl
index d26d1fb..fe3a048 100644
--- a/hooks/templates/nagios-pagerduty-flush-cron.tmpl
+++ b/hooks/templates/nagios-pagerduty-flush-cron.tmpl
@@ -4,5 +4,5 @@
44
5# Flush the nagios pagerduty alerts every minute as per5# Flush the nagios pagerduty alerts every minute as per
6# http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/6# http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/
7* * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush --queue-dir {{ pagerduty_path }}7* * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush {{ proxy_switch }} --queue-dir {{ pagerduty_path }}
88
diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
index 89044f8..88b6ecb 100755
--- a/hooks/upgrade-charm
+++ b/hooks/upgrade-charm
@@ -114,11 +114,16 @@ def enable_pagerduty_config():
114 hookenv.log("Pagerduty is enabled")114 hookenv.log("Pagerduty is enabled")
115 fetch.apt_update()115 fetch.apt_update()
116 fetch.apt_install('libhttp-parser-perl')116 fetch.apt_install('libhttp-parser-perl')
117 if 'https_proxy' in os.environ:
118 proxy_switch = '--proxy {}'.format(os.environ['https_proxy'])
119 else:
120 proxy_switch = ''
117121
118 # Ship the pagerduty_nagios.cfg file122 # Ship the pagerduty_nagios.cfg file
119 template_values = {'enable_pagerduty': enable_pagerduty,123 template_values = {'enable_pagerduty': enable_pagerduty,
120 'pagerduty_key': pagerduty_key,124 'pagerduty_key': pagerduty_key,
121 'pagerduty_path': pagerduty_path}125 'pagerduty_path': pagerduty_path,
126 'proxy_switch': proxy_switch}
122127
123 with open('hooks/templates/pagerduty_nagios_cfg.tmpl', 'r') as f:128 with open('hooks/templates/pagerduty_nagios_cfg.tmpl', 'r') as f:
124 templateDef = f.read()129 templateDef = f.read()

Subscribers

People subscribed via source and target branches