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,
|
||||
auth=(args.token, 'token'), verify=args.insecure).json()
|
||||
if notifications['total'] > 0:
|
||||
notif_str = 'Notifications:'
|
||||
for notification in notifications['notifications']:
|
||||
notif_str = notif_str + f'\n{notification["type"]}: {notification["description"]}'
|
||||
if args.html:
|
||||
notif_str = f'<a href="{base_url}/system/overview" target="_blank">There are {notifications["total"]} notifications.</a>'
|
||||
else:
|
||||
notif_str = f'There are {notifications["total"]} notifications.'
|
||||
else:
|
||||
notif_str = 'No notifications'
|
||||
|
||||
|
|
Loading…
Reference in New Issue