X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fnotify_by_email;fp=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fnotify_by_email;h=0000000000000000000000000000000000000000;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hp=959db267b5d2412369a5af634a9723991e87e1f1;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/monitoring/plugins/notify_by_email b/modules/private/monitoring/plugins/notify_by_email deleted file mode 100755 index 959db26..0000000 --- a/modules/private/monitoring/plugins/notify_by_email +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# $1 = service/host - -# $2 = type (PROBLEM RECOVERY ACKNOWLEDGEMENT FLAPPINGSTART FLAPPINGSTOP FLAPPINGDISABLED DOWNTIMESTART DOWNTIMESTOP DOWNTIMECANCELLED) -# http://www.naemon.org/documentation/usersguide/macrolist.html#notificationtype - -# $3 = host alias - -# $4 = date (YYYY-MM-DDTHH:MM:SS) - -# $5 = E-mail - -NOTIFICATION_TYPE="$2" -HOST_ALIAS="$3" -DATE="$4" -CONTACT="$5" - -message="" - -if [ "$1" = "host" ]; then - message=$(printf "%b" "***** Naemon *****\n\nNotification Type: $NOTIFICATION_TYPE\n\nHost: $HOST_ALIAS\nState: $HOSTSTATE\nInfo: $HOSTOUTPUT\n\nDate/Time: $DATE\n") - subject="** $NOTIFICATION_TYPE Host Alert: $HOST_ALIAS is $HOSTSTATE **" -else - message=$(printf "%b" "***** Naemon *****\n\nNotification Type: $NOTIFICATION_TYPE\n\nService: $SERVICEDESC\nHost: $HOST_ALIAS\nState: $SERVICESTATE\n\nDate/Time: $DATE\n\nAdditional Info:\n\n$SERVICEOUTPUT\n") - subject="** $NOTIFICATION_TYPE Service Alert: $HOST_ALIAS/$SERVICEDESC is $SERVICESTATE **" -fi - -echo "$message" | MAILRC=/dev/null mail -r "$ADMINEMAIL" -n -s "$subject" "$CONTACT"