From 9cace7dace1bd7061151ec1358790fb2f812f4de Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 22 Nov 2020 11:09:44 +0100 Subject: [PATCH] bundles/icinga2: only include service_name in sms if it actually is a service --- bundles/icinga2/files/scripts/icinga_notification_wrapper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundles/icinga2/files/scripts/icinga_notification_wrapper b/bundles/icinga2/files/scripts/icinga_notification_wrapper index e3e6b5e..5709c70 100644 --- a/bundles/icinga2/files/scripts/icinga_notification_wrapper +++ b/bundles/icinga2/files/scripts/icinga_notification_wrapper @@ -60,9 +60,9 @@ def log_to_syslog(message): def notify_per_sms(): message = { - 'message': 'ICINGA: {host}/{service} is {state}: {output}'.format( + 'message': 'ICINGA: {host}{service} is {state}: {output}'.format( host=args.host_name, - service=args.service_name, + service=('/'+args.service_name if args.service_name else ''), state=args.state.upper(), output=args.output ),