diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-03-28 18:38:04 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2021-03-28 18:38:04 +0200 |
commit | c41d0de83b1841097c6be8d8baeed557b065657b (patch) | |
tree | 3b188758640fcb97ba0927948d4bbc0b9f04c579 /modules/private/monitoring/plugins | |
parent | ef909e2435194af725f4338a13e4732328ef7361 (diff) | |
download | Nix-c41d0de83b1841097c6be8d8baeed557b065657b.tar.gz Nix-c41d0de83b1841097c6be8d8baeed557b065657b.tar.zst Nix-c41d0de83b1841097c6be8d8baeed557b065657b.zip |
Adjustments for monitoring
Diffstat (limited to 'modules/private/monitoring/plugins')
-rwxr-xr-x | modules/private/monitoring/plugins/notify_eban_url | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/modules/private/monitoring/plugins/notify_eban_url b/modules/private/monitoring/plugins/notify_eban_url index 431e320..107b5de 100755 --- a/modules/private/monitoring/plugins/notify_eban_url +++ b/modules/private/monitoring/plugins/notify_eban_url | |||
@@ -1,13 +1,6 @@ | |||
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | PASS=$(echo "$PASSWORD" | base64 -d) | ||
4 | |||
5 | if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then | 3 | if [ "$SERVICESTATE" = "CRITICAL" -o "$SERVICESTATE" = "UNKNOWN" -o "$HOSTSTATE" = "DOWN" -o "$HOSTSTATE" = "UNREACHABLE" ]; then |
6 | action=downAlert | 4 | MESSAGE="$STATUS_NAME seems down!" |
7 | elif [ "$SERVICESTATE" = "OK" -o "$HOSTSTATE" = "UP" ]; then | 5 | curl -X GET -G --data-urlencode "user=$USER" --data-urlencode "pass=$PASSWORD" --data-urlencode "msg=$MESSAGE" https://smsapi.free-mobile.fr/sendmsg |
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 | 6 | fi |