Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
just go ahead and send to pagerduty methods if it's in the OK state, …
Browse files Browse the repository at this point in the history
…in case the ACK didn't happen.

The PD lib will not re-send the ACK if the incident key isn't present anyway.
  • Loading branch information
manos committed Sep 27, 2013
1 parent f35cdab commit 0878589
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions monitorlib/collectd.py
Expand Up @@ -313,8 +313,11 @@ def dispatch_alert(self, severity, message, page, email, url, riemann):
with open(self.state_file, 'w') as fh:
fh.write(json.dumps(message))

# if paging was requested, do it, unless the state is the same as last time
if page and 'transitioned' in state and not self.no_alerts:
# if paging was requested, do it, unless the state is the same as last time,
# except, if we're in OK, send that to PD because the lib won't do it unless
# there is an incident key. This is to make sure ACKs happen.. sometimes they
# get lost.
if page and not self.no_alerts and ('ok' in message['severity'] or 'transitioned' in state):
if not self.pagerduty_key:
logging.error("must call set_pagerduty_key(), first")
else:
Expand Down

0 comments on commit 0878589

Please sign in to comment.