bundles/icinga2: add notification support via ntfy
This commit is contained in:
parent
25aabad865
commit
b3e490720e
5 changed files with 81 additions and 36 deletions
|
@ -1,16 +1,17 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from json import load
|
||||
from sys import exit
|
||||
|
||||
from requests import get
|
||||
|
||||
SIPGATE_USER = '${node.metadata['icinga2']['sipgate_user']}'
|
||||
SIPGATE_PASS = '${node.metadata['icinga2']['sipgate_pass']}'
|
||||
with open('/etc/icinga2/notification_config.json') as f:
|
||||
CONFIG = load(f)
|
||||
|
||||
try:
|
||||
r = get(
|
||||
'https://api.sipgate.com/v2/balance',
|
||||
auth=(SIPGATE_USER, SIPGATE_PASS),
|
||||
auth=(CONFIG['sipgate']['user'], CONFIG['sipgate']['password']),
|
||||
headers={'Accept': 'application/json'},
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue