diff options
Diffstat (limited to 'modules/private/monitoring/plugins/notify_maison_bbc_by_email')
-rwxr-xr-x | modules/private/monitoring/plugins/notify_maison_bbc_by_email | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/modules/private/monitoring/plugins/notify_maison_bbc_by_email b/modules/private/monitoring/plugins/notify_maison_bbc_by_email deleted file mode 100755 index 84958b8..0000000 --- a/modules/private/monitoring/plugins/notify_maison_bbc_by_email +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # $1 = service/host | ||
4 | |||
5 | # $2 = type (PROBLEM RECOVERY ACKNOWLEDGEMENT FLAPPINGSTART FLAPPINGSTOP FLAPPINGDISABLED DOWNTIMESTART DOWNTIMESTOP DOWNTIMECANCELLED) | ||
6 | # http://www.naemon.org/documentation/usersguide/macrolist.html#notificationtype | ||
7 | |||
8 | # $3 = host alias | ||
9 | |||
10 | # $4 = date (YYYY-MM-DDTHH:MM:SS) | ||
11 | |||
12 | # $5 = E-mail | ||
13 | |||
14 | NOTIFICATION_TYPE="$2" | ||
15 | DATE="$4" | ||
16 | CONTACT="$5" | ||
17 | |||
18 | output=$(echo "$SERVICEOUTPUT" | awk '{gsub(" - ", "\n\n", $0); gsub (" (;|:) ", "\n ", $0); gsub(" dates: ", " dates:\n ", $0); gsub("Batteries: ", "Batteries:\n ", $0); print $0}') | ||
19 | if [ "$NOTIFICATION_TYPE" = "RECOVERY" ]; then | ||
20 | subject="Fin d'alerte Maison BBC Zibase" | ||
21 | message=$(printf "%b" "Alerte terminée le $DATE.\nInformations:\n$output") | ||
22 | else | ||
23 | subject="Alerte Maison BBC Zibase" | ||
24 | message=$(printf "%b" "Alerte lancée le $DATE.\nInformations:\n$output") | ||
25 | fi | ||
26 | |||
27 | echo "$message" | MAILRC=/dev/null mail -r "$ADMINEMAIL" -n -s "$subject" "$CONTACT" | ||