X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fnotify_eban_url;fp=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fnotify_eban_url;h=431e32010a7ff1ae6ad4f4f456e4ff671f3b6dfe;hp=0000000000000000000000000000000000000000;hb=2edbb2d889bd9d1787bc1745a75c1b6969d148ab;hpb=b4b5eadc29d2547e181ce60d735a4b943beb2a9a diff --git a/modules/private/monitoring/plugins/notify_eban_url b/modules/private/monitoring/plugins/notify_eban_url new file mode 100755 index 0000000..431e320 --- /dev/null +++ b/modules/private/monitoring/plugins/notify_eban_url @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +PASS=$(echo "$PASSWORD" | base64 -d) + +if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then + action=downAlert +elif [ "$SERVICESTATE" = "OK" -o "$HOSTSTATE" = "UP" ]; then + action=upAlert +fi + +if [ -n "$action" ]; then + curl -X GET -G --data-urlencode "service=$STATUS_NAME" --data-urlencode "mdp=$PASS" https://infra.eban.bzh/$action +fi