Notification scripts: More readable & redundancy cleanup

This commit is contained in:
Christian Gut 2017-08-07 15:55:17 +02:00 committed by Michael Friedrich
parent b4b3509818
commit 0f0b6f1df9
2 changed files with 9 additions and 11 deletions

View File

@ -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.

View File

@ -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.