From 1a64deeb894dc95e2645a75771732c6cc53a79ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 4 Oct 2023 01:35:06 +0200 Subject: Squash changes containing private information There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository --- .../monitoring/plugins/check_redis_replication | 38 ---------------------- 1 file changed, 38 deletions(-) delete mode 100755 modules/private/monitoring/plugins/check_redis_replication (limited to 'modules/private/monitoring/plugins/check_redis_replication') diff --git a/modules/private/monitoring/plugins/check_redis_replication b/modules/private/monitoring/plugins/check_redis_replication deleted file mode 100755 index 6dbe4c4..0000000 --- a/modules/private/monitoring/plugins/check_redis_replication +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -STATE_OK=0 -STATE_WARNING=1 -STATE_CRITICAL=2 -STATE_UNKNOWN=3 - -socket=$1 - -info=$(redis-cli -s $socket info replication) -lag=$(echo "$info" | grep master_last_io_seconds_ago | cut -d":" -f2 | sed -e "s/\s//g") -slave_offset=$(echo "$info" | grep slave_repl_offset | cut -d":" -f2 | sed -e "s/\s//g") -master_offset=$(echo "$info" | grep master_repl_offset | cut -d":" -f2 | sed -e "s/\s//g") -offset=$(($master_offset - $slave_offset)) - -exit_code=$? - -if [[ $exit_code -ne 0 ]]; then - echo "UNKNOWN - Impossible to run redis command" - exit $STATE_UNKNOWN -elif [[ -z "$lag" ]]; then - echo "UNKNOWN - No replication found" - exit $STATE_UNKNOWN -else - output="Replication lag for redis is ${lag}s and offset is ${offset}" - LC_ALL=C lag=$(printf "%.*f" 0 $lag) - - if [[ $lag -lt 5 && $offset -lt 5 ]]; then - echo "OK - $output | time=${lag}s;5;10;0; offset=${offset};5;10;0;" - exit $STATE_OK - elif [[ $lag -lt 10 && $offset -lt 10 ]]; then - echo "WARNING - $output | time=${lag}s;5;10;0; offset=${offset};5;10;0;" - exit $STATE_WARNING - else - echo "CRITICAL - $output | time=${lag}s;5;10;0; offset=${offset};5;10;0;" - exit $STATE_CRITICAL - fi -fi -- cgit v1.2.3