From 27cb71fff898742967f571159e03e42ee3d98e9e Mon Sep 17 00:00:00 2001 From: Cyberes Date: Fri, 21 Apr 2023 23:54:18 -0600 Subject: [PATCH] check_iowait.sh avg over interval --- check_iowait.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/check_iowait.sh b/check_iowait.sh index c9f6fa5..51b0a50 100755 --- a/check_iowait.sh +++ b/check_iowait.sh @@ -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