|
@ -124,7 +124,7 @@ for ns in $ALLNS; do |
|
|
for pv in $usedstr; do |
|
|
for pv in $usedstr; do |
|
|
usedperc=$(echo "$pv" | awk '{print $10}') |
|
|
usedperc=$(echo "$pv" | awk '{print $10}') |
|
|
pvcname=$(echo "$pv" | awk '{print $2}') |
|
|
pvcname=$(echo "$pv" | awk '{print $2}') |
|
|
size=$(echo "$pv" | awk '{print $7}' | numfmt --from=iec-i --to=iec-i --to-unit=Gi --round=up) |
|
|
size=$(kubectl get pvc $pvcname -n $ns -o=jsonpath='{.status.capacity.storage}' | numfmt --from=iec-i --to=iec-i --to-unit=Gi --round=up) |
|
|
if (( $(bc <<< "($usedperc > $FULLTHRESHOLD)") )); then |
|
|
if (( $(bc <<< "($usedperc > $FULLTHRESHOLD)") )); then |
|
|
echo "Volume $pvcname is almost full: ${usedperc}%!" |
|
|
echo "Volume $pvcname is almost full: ${usedperc}%!" |
|
|
if [ $FIX -ne 0 ]; then |
|
|
if [ $FIX -ne 0 ]; then |
|
|