Acknoledgement Kommentare in Mail mitsenden

Einfach in der commands.cfg die Zeile für “notify-service-by-email” suchen und z.B. nach dem Parameter “$SERVICEOUTPUT$\n” “\nNotes: $SERVICEACKCOMMENT$” anhängen und Icinga/Nagios reloaden.

Die fertige Definition schaut dann z.B. so aus:

# 'notify-service-by-email' command definition
define command{
 command_name    notify-service-by-email
 command_line    /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\nNotes: $SERVICEACKCOMMENT$" | /usr/bin/sendEmail -s $USER6$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\nNotes: $SERVICEACKCOMMENT$"
 }

Kommentar verfassen

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.