]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/monitoring/plugins/notify_eban_url
Add Eban monitoring
[perso/Immae/Config/Nix.git] / modules / private / monitoring / plugins / notify_eban_url
1 #!/usr/bin/env bash
2
3 PASS=$(echo "$PASSWORD" | base64 -d)
4
5 if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then
6 action=downAlert
7 elif [ "$SERVICESTATE" = "OK" -o "$HOSTSTATE" = "UP" ]; then
8 action=upAlert
9 fi
10
11 if [ -n "$action" ]; then
12 curl -X GET -G --data-urlencode "service=$STATUS_NAME" --data-urlencode "mdp=$PASS" https://infra.eban.bzh/$action
13 fi