← Back to team overview

nagios-charmers team mailing list archive

[Merge] ~xavpaice/nagios-charm:lp1763576 into nagios-charm:master

 

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/343472
-- 
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..88b6ecb 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')
+        if 'https_proxy' in os.environ:
+            proxy_switch = '--proxy {}'.format(os.environ['https_proxy'])
+        else:
+            proxy_switch = ''
 
         # 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()

Follow ups