check_iowait.sh avg over interval

This commit is contained in:
Cyberes 2023-04-21 23:54:18 -06:00
parent 50e85bcd2c
commit 27cb71fff8
1 changed files with 3 additions and 3 deletions

View File

@ -48,16 +48,16 @@ PROCESSES=$(ps -A --no-headers | wc -l)
# Check if iowait percentage is above critical threshold
if (($(echo "$IOWAIT > $CRITICAL_THRESHOLD" | bc -l))); then
echo "CRITICAL - iowait percentage is $IOWAIT% | iowait=$IOWAIT%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;100 processes=$PROCESSES"
echo "CRITICAL - iowait percentage is $IOWAIT% | iowait=$IOWAIT%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;100"
exit 2
fi
# Check if iowait percentage is above warning threshold
if (($(echo "$IOWAIT > $WARNING_THRESHOLD" | bc -l))); then
echo "WARNING - iowait percentage is $IOWAIT% | iowait=$IOWAIT%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;100 processes=$PROCESSES"
echo "WARNING - iowait percentage is $IOWAIT% | iowait=$IOWAIT%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;100"
exit 1
fi
# If iowait percentage is below warning threshold, exit with OK status
echo "OK - iowait percentage is $IOWAIT% | iowait=$IOWAIT%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;100 processes=$PROCESSES"
echo "OK - iowait percentage is $IOWAIT% | iowait=$IOWAIT%;$WARNING_THRESHOLD;$CRITICAL_THRESHOLD;0;100"
exit 0