1
0
Fork 0

nagios: file-age: drop stderr from find command

This commit is contained in:
Chl 2022-04-30 13:40:06 +02:00
parent b4c974309a
commit 1fdd934e30

View file

@ -128,8 +128,8 @@ while getopts hw:c:W:C:s:b:f: f; do
# un buffer et de le traiter ensuite
FIND_NAME_REGEXP="$OPTARG"
FILES_NUMBER_AT_WARN_AGE="$( find "$FIND_BASEDIR" -name "$FIND_NAME_REGEXP" -type f \( -size "$MIN_SIZE" -or -size "+$MIN_SIZE" \) -mtime "-$RANGE_WARNING_AGE" -printf "a\n" | wc -l )"
FILES_NUMBER_AT_CRIT_AGE="$( find "$FIND_BASEDIR" -name "$FIND_NAME_REGEXP" -type f \( -size "$MIN_SIZE" -or -size "+$MIN_SIZE" \) -mtime "-$RANGE_CRITICAL_AGE" -printf "a\n" | wc -l )"
FILES_NUMBER_AT_WARN_AGE="$( find "$FIND_BASEDIR" -name "$FIND_NAME_REGEXP" -type f \( -size "$MIN_SIZE" -or -size "+$MIN_SIZE" \) -mtime "-$RANGE_WARNING_AGE" -printf "a\n" 2>/dev/null | wc -l )"
FILES_NUMBER_AT_CRIT_AGE="$( find "$FIND_BASEDIR" -name "$FIND_NAME_REGEXP" -type f \( -size "$MIN_SIZE" -or -size "+$MIN_SIZE" \) -mtime "-$RANGE_CRITICAL_AGE" -printf "a\n" 2>/dev/null | wc -l )"
# mémo : 'label'=value[UOM];[warn];[crit];[min];[max]
OUTPUT_PERFDATA=$( printf "%s'warn%s'=%d;%s;;0;" \