parent
3dff3c9121
commit
3c57c113cd
|
@ -13,10 +13,11 @@ optional arguments:
|
|||
-H, --healthcheck simply exit with 0 for healthy or 1 when unhealthy
|
||||
|
||||
The following environment variables will override any config or default:
|
||||
* LISTEN_PORT (default: 8080)
|
||||
* GOTIFY_SERVER (default: localhost)
|
||||
* GOTIFY_PORT (default: 80)
|
||||
* DISABLE_RESOLVED (default: False)
|
||||
* GOTIFY_KEY (default: None)
|
||||
* GOTIFY_PORT (default: 80)
|
||||
* GOTIFY_SERVER (default: localhost)
|
||||
* LISTEN_PORT (default: 8080)
|
||||
* VERBOSE (default: False)
|
||||
```
|
||||
|
||||
|
|
11
alertify.py
11
alertify.py
|
@ -15,10 +15,11 @@ from http.server import HTTPServer, SimpleHTTPRequestHandler
|
|||
import yaml
|
||||
|
||||
DEFAULTS = {
|
||||
'listen_port': int(8080),
|
||||
'gotify_server': str('localhost'),
|
||||
'gotify_port': int(80),
|
||||
'disable_resolved': bool(False),
|
||||
'gotify_key': str(),
|
||||
'gotify_port': int(80),
|
||||
'gotify_server': str('localhost'),
|
||||
'listen_port': int(8080),
|
||||
'verbose': bool(False),
|
||||
}
|
||||
|
||||
|
@ -92,6 +93,10 @@ class HTTPHandler(SimpleHTTPRequestHandler):
|
|||
|
||||
try:
|
||||
if alert['status'] == 'resolved':
|
||||
if self.config.get('disable_resolved'):
|
||||
print('Ignoring resolved messages')
|
||||
self._respond(200, 'Ignored. "resolved" messages are disabled')
|
||||
return
|
||||
prefix = 'Resolved'
|
||||
else:
|
||||
prefix = alert['commonLabels'].get(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
# verbose: true
|
||||
gotify_server: gotifyserver.example.net
|
||||
disable_resolved: false
|
||||
gotify_key: sOmEsEcReTkEy1
|
||||
gotify_port: "80"
|
||||
gotify_server: gotifyserver.example.net
|
||||
listen_port: "8080"
|
||||
verbose: true
|
||||
|
|
Loading…
Reference in a new issue