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_last_file_date | 28 ---------------------- 1 file changed, 28 deletions(-) delete mode 100755 modules/private/monitoring/plugins/check_last_file_date (limited to 'modules/private/monitoring/plugins/check_last_file_date') diff --git a/modules/private/monitoring/plugins/check_last_file_date b/modules/private/monitoring/plugins/check_last_file_date deleted file mode 100755 index f51a258..0000000 --- a/modules/private/monitoring/plugins/check_last_file_date +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -STATE_OK=0 -STATE_WARNING=1 -STATE_CRITICAL=2 -STATE_UNKNOWN=3 - -base_path=$1 -hours=$2 - -last_date=$(find $base_path -mindepth 1 -maxdepth 1 -printf "%T@\n" 2>/dev/null | sort | tail -n 1) - -if [ -z "$last_date" ]; then - echo "UNKNOWN: Could not read folder" - exit $STATE_UNKNOWN -else - LC_ALL=C last_date=$(printf "%.*f" 0 $last_date) - LC_ALL=C age=$(( $(date "+%s") - $last_date)) - max_age=$(( $hours * 60 * 60 )) - min_date=$(date -d "$hours hours ago" "+%s") - if [ "$min_date" -lt "$last_date" ]; then - echo "OK: Last file $(date -d @$last_date) | age=${age}s;;$max_age;;" - exit $STATE_OK - else - echo "CRITICAL: Last file $(date -d @$last_date) | age=${age}s;;$max_age;;" - exit $STATE_CRITICAL - fi -fi -- cgit v1.2.3