check_iowait.sh avg over interval
This commit is contained in:
parent
50e85bcd2c
commit
27cb71fff8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue