diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-12-29 22:06:59 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-12-29 22:06:59 +0100 |
commit | 2edbb2d889bd9d1787bc1745a75c1b6969d148ab (patch) | |
tree | a2784aad8833d4a1303e7bd90a2ec1587579ad7a /modules/private/monitoring/plugins | |
parent | b4b5eadc29d2547e181ce60d735a4b943beb2a9a (diff) | |
download | Nix-2edbb2d889bd9d1787bc1745a75c1b6969d148ab.tar.gz Nix-2edbb2d889bd9d1787bc1745a75c1b6969d148ab.tar.zst Nix-2edbb2d889bd9d1787bc1745a75c1b6969d148ab.zip |
Add Eban monitoring
Diffstat (limited to 'modules/private/monitoring/plugins')
-rwxr-xr-x | modules/private/monitoring/plugins/notify_eban_url | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ | |||
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 | ||