]> granicus.if.org Git - icinga2/commitdiff
Notification scripts: More readable & redundancy cleanup 5468/head
authorChristian Gut <christian.gut@trendswm.de>
Mon, 7 Aug 2017 13:55:17 +0000 (15:55 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 14 Aug 2017 15:27:39 +0000 (17:27 +0200)
etc/icinga2/scripts/mail-host-notification.sh
etc/icinga2/scripts/mail-service-notification.sh

index 1f5db94db049df4a1cd992a4b3fa4a5016a7fc7d..38520febfbdbeff42ba06214bd40b3d99829f837 100755 (executable)
@@ -93,14 +93,14 @@ SUBJECT="[$NOTIFICATIONTYPE] Host $HOSTDISPLAYNAME is $HOSTSTATE!"
 
 ## Build the notification message
 NOTIFICATION_MESSAGE=`cat << EOF
-***** Icinga 2 Host Monitoring on $HOSTNAME *****
+***** Host Monitoring on $HOSTNAME *****
 
-==> $HOSTDISPLAYNAME ($HOSTNAME) is $HOSTSTATE! <==
+$HOSTDISPLAYNAME is $HOSTSTATE!
 
 Info:    $HOSTOUTPUT
 
 When:    $LONGDATETIME
-Host:    $HOSTNAME (Display Name: "$HOSTDISPLAYNAME")
+Host:    $HOSTNAME
 EOF
 `
 
@@ -128,8 +128,7 @@ fi
 if [ -n "$ICINGAWEB2URL" ] ; then
   NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
 
-URL:
-  $ICINGAWEB2URL/monitoring/host/show?host=$HOSTNAME"
+$ICINGAWEB2URL/monitoring/host/show?host=$HOSTNAME"
 fi
 
 ## Check whether verbose mode was enabled and log to syslog.
index f99e3ed184020edf0714404d742351162795c7d7..7fc1b2630ac6c400decf90e9e146ce104974e6d9 100755 (executable)
@@ -98,15 +98,15 @@ SUBJECT="[$NOTIFICATIONTYPE] $SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICE
 
 ## Build the notification message
 NOTIFICATION_MESSAGE=`cat << EOF
-***** Icinga 2 Service Monitoring on $HOSTNAME *****
+***** Service Monitoring on $HOSTNAME *****
 
-==> $SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICESTATE! <==
+$SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICESTATE!
 
 Info:    $SERVICEOUTPUT
 
 When:    $LONGDATETIME
-Service: $SERVICENAME (Display Name: "$SERVICEDISPLAYNAME")
-Host:    $HOSTNAME (Display Name: "$HOSTDISPLAYNAME")
+Service: $SERVICENAME
+Host:    $HOSTNAME
 EOF
 `
 
@@ -134,8 +134,7 @@ fi
 if [ -n "$ICINGAWEB2URL" ] ; then
   NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
 
-URL:
-  $ICINGAWEB2URL/monitoring/service/show?host=$HOSTNAME&service=$SERVICENAME"
+$ICINGAWEB2URL/monitoring/service/show?host=$HOSTNAME&service=$SERVICENAME"
 fi
 
 ## Check whether verbose mode was enabled and log to syslog.