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
1diff --git a/hooks/templates/nagios-pagerduty-flush-cron.tmpl b/hooks/templates/nagios-pagerduty-flush-cron.tmpl
2index d26d1fb..fe3a048 100644
3--- a/hooks/templates/nagios-pagerduty-flush-cron.tmpl
4+++ b/hooks/templates/nagios-pagerduty-flush-cron.tmpl
5@@ -4,5 +4,5 @@
6
7 # Flush the nagios pagerduty alerts every minute as per
8 # http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/
9-* * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush --queue-dir {{ pagerduty_path }}
10+* * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush {{ proxy_switch }} --queue-dir {{ pagerduty_path }}
11
12diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
13index 89044f8..88b6ecb 100755
14--- a/hooks/upgrade-charm
15+++ b/hooks/upgrade-charm
16@@ -114,11 +114,16 @@ def enable_pagerduty_config():
17 hookenv.log("Pagerduty is enabled")
18 fetch.apt_update()
19 fetch.apt_install('libhttp-parser-perl')
20+ if 'https_proxy' in os.environ:
21+ proxy_switch = '--proxy {}'.format(os.environ['https_proxy'])
22+ else:
23+ proxy_switch = ''
24
25 # Ship the pagerduty_nagios.cfg file
26 template_values = {'enable_pagerduty': enable_pagerduty,
27 'pagerduty_key': pagerduty_key,
28- 'pagerduty_path': pagerduty_path}
29+ 'pagerduty_path': pagerduty_path,
30+ 'proxy_switch': proxy_switch}
31
32 with open('hooks/templates/pagerduty_nagios_cfg.tmpl', 'r') as f:
33 templateDef = f.read()

Subscribers

People subscribed via source and target branches