Xav Paice has proposed merging ~xavpaice/nagios-charm:lp1763576 into 
nagios-charm:master.

Requested reviews:
  Nagios Charm developers (nagios-charmers)

For more details, see:
https://code.launchpad.net/~xavpaice/nagios-charm/+git/nagios-charm/+merge/343254
-- 
Your team Nagios Charm developers is requested to review the proposed merge of 
~xavpaice/nagios-charm:lp1763576 into nagios-charm:master.
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 @@
 
 # Flush the nagios pagerduty alerts every minute as per
 # http://www.pagerduty.com/docs/guides/nagios-perl-integration-guide/
-* * * * *   nagios  /usr/local/bin/pagerduty_nagios.pl flush --queue-dir {{ pagerduty_path }}
+* * * * *   nagios  /usr/local/bin/pagerduty_nagios.pl flush {{ proxy_switch }} --queue-dir {{ pagerduty_path }}
 
diff --git a/hooks/upgrade-charm b/hooks/upgrade-charm
index 89044f8..6fbfd16 100755
--- a/hooks/upgrade-charm
+++ b/hooks/upgrade-charm
@@ -114,11 +114,16 @@ def enable_pagerduty_config():
         hookenv.log("Pagerduty is enabled")
         fetch.apt_update()
         fetch.apt_install('libhttp-parser-perl')
+        https_proxy = os.environ.get('https_proxy')
+        proxy_switch = ''
+        if https_proxy is not None:
+            proxy_switch = '--proxy {}'.format(https_proxy)
 
         # Ship the pagerduty_nagios.cfg file
         template_values = {'enable_pagerduty': enable_pagerduty,
                            'pagerduty_key': pagerduty_key,
-                           'pagerduty_path': pagerduty_path}
+                           'pagerduty_path': pagerduty_path,
+                           'proxy_switch': proxy_switch}
 
         with open('hooks/templates/pagerduty_nagios_cfg.tmpl', 'r') as f:
             templateDef = f.read()
-- 
Mailing list: https://launchpad.net/~nagios-charmers
Post to     : nagios-charmers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~nagios-charmers
More help   : https://help.launchpad.net/ListHelp

Reply via email to