diff --git a/check_graylog.py b/check_graylog.py index 16079ea..9b772ad 100755 --- a/check_graylog.py +++ b/check_graylog.py @@ -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'There are {notifications["total"]} notifications.' + else: + notif_str = f'There are {notifications["total"]} notifications.' else: notif_str = 'No notifications'