Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Pushnotify Alerter for iOS/Android push notification alerts #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ start analyzing for anomalies!
### Alerts
Skyline can alert you! In your settings.py, add any alerts you want to the ALERTS
list, according to the schema `(metric keyword, strategy, expiration seconds)` where
`strategy` is one of `smtp`, `hipchat`, or `pagerduty`. You can also add your own
`strategy` is one of `smtp`, `hipchat`, `pagerduty` or `pushnotify`. You can also add your own
alerting strategies. For every anomalous metric, Skyline will search for the given
keyword and trigger the corresponding alert(s). To prevent alert fatigue, Skyline
will only alert once every <expiration seconds> for any given metric/strategy
combination. To enable Hipchat integration, uncomment the python-simple-hipchat
line in the requirements.txt file.
line in the requirements.txt file. To enable Pushnotify integration, uncomment the py-pushnotify line.

### How do you actually detect anomalies?
An ensemble of algorithms vote. Majority rules. Batteries __kind of__ included.
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ simplejson==2.0.9
unittest2
mock
#python-simple-hipchat
#py-pushnotify
7 changes: 7 additions & 0 deletions src/analyzer/alerters.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def alert_smtp(alert, metric):
s.quit()


def alert_pushnotify(alert, metric):
import pushnotify
client = pushnotify.get_client(settings.PUSHNOTIFY_OPTS['protocol'], application='skyline')
for x in settings.PUSHNOTIFY_OPTS['keys']:
client.add_key(x)
client.notify("%s (value: %s)" % (metric[1], metric[0]), "Anomalous metric")

def alert_pagerduty(alert, metric):
import pygerduty
pager = pygerduty.PagerDuty(settings.PAGERDUTY_OPTS['subdomain'], settings.PAGERDUTY_OPTS['auth_token'])
Expand Down
6 changes: 6 additions & 0 deletions src/settings.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ PAGERDUTY_OPTS = {
"key": "your_pagerduty_service_api_key",
}

# PushNotify alerts require py-pushnotify
PUSHNOTIFY_OPTS = {
# Your pagerduty subdomain and auth token
"protocol": "prowl",
"keys": ["YOUR-KEY-HERE"]
}

"""
Horizon settings
Expand Down