check_graylog: fix notifications
This commit is contained in:
parent
61ec9a8580
commit
de29530a47
|
@ -228,9 +228,10 @@ def main():
|
||||||
notifications = fetch_with_retry(f'{base_url}/api/system/notifications', headers=headers,
|
notifications = fetch_with_retry(f'{base_url}/api/system/notifications', headers=headers,
|
||||||
auth=(args.token, 'token'), verify=args.insecure).json()
|
auth=(args.token, 'token'), verify=args.insecure).json()
|
||||||
if notifications['total'] > 0:
|
if notifications['total'] > 0:
|
||||||
notif_str = 'Notifications:'
|
if args.html:
|
||||||
for notification in notifications['notifications']:
|
notif_str = f'<a href="{base_url}/system/overview" target="_blank">There are {notifications["total"]} notifications.</a>'
|
||||||
notif_str = notif_str + f'\n{notification["type"]}: {notification["description"]}'
|
else:
|
||||||
|
notif_str = f'There are {notifications["total"]} notifications.'
|
||||||
else:
|
else:
|
||||||
notif_str = 'No notifications'
|
notif_str = 'No notifications'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue