Merge lp:~brad-marshall/charms/trusty/nagios/fix-pagerduty-cron into lp:charms/trusty/nagios

Proposed by Brad Marshall
Status: Merged
Merged at revision: 34
Proposed branch: lp:~brad-marshall/charms/trusty/nagios/fix-pagerduty-cron
Merge into: lp:charms/trusty/nagios
Diff against target: 29 lines (+8/-3)
2 files modified
hooks/templates/nagios-pagerduty-flush-cron.tmpl (+2/-1)
hooks/upgrade-charm (+6/-2)
To merge this branch: bzr merge lp:~brad-marshall/charms/trusty/nagios/fix-pagerduty-cron
Reviewer Review Type Date Requested Status
Stuart Bishop (community) Approve
Review via email: mp+274094@code.launchpad.net

Description of the change

Added passing of the pagerduty queue dir to the cronjob.

To post a comment you must log in.
Revision history for this message
Stuart Bishop (stub) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed file 'files/nagios-pagerduty-flush-cron' => 'hooks/templates/nagios-pagerduty-flush-cron.tmpl'
--- files/nagios-pagerduty-flush-cron 2015-07-22 03:31:36 +0000
+++ hooks/templates/nagios-pagerduty-flush-cron.tmpl 2015-10-12 00:58:21 +0000
@@ -4,4 +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 flush7* * * * * nagios /usr/local/bin/pagerduty_nagios.pl flush --queue-dir {{ pagerduty_path }}
8
89
=== modified file 'hooks/upgrade-charm'
--- hooks/upgrade-charm 2015-10-08 18:40:52 +0000
+++ hooks/upgrade-charm 2015-10-12 00:58:21 +0000
@@ -123,8 +123,12 @@
123 with open(pagerduty_cfg, 'w') as f:123 with open(pagerduty_cfg, 'w') as f:
124 f.write(t.render(template_values))124 f.write(t.render(template_values))
125125
126 # Ship the cron file126 with open('hooks/templates/nagios-pagerduty-flush-cron.tmpl', 'r') as f2:
127 shutil.copyfile('files/nagios-pagerduty-flush-cron', pagerduty_cron)127 templateDef = f2.read()
128
129 t2 = Template(templateDef)
130 with open(pagerduty_cron, 'w') as f2:
131 f2.write(t2.render(template_values))
128132
129 # Ship the pagerduty_nagios.pl script133 # Ship the pagerduty_nagios.pl script
130 shutil.copyfile('files/pagerduty_nagios.pl', '/usr/local/bin/pagerduty_nagios.pl')134 shutil.copyfile('files/pagerduty_nagios.pl', '/usr/local/bin/pagerduty_nagios.pl')

Subscribers

People subscribed via source and target branches

to all changes: