Rules commonly have the following code that returns a PASS/FAIL to the user and bumps the stats counters:
# Return the final PASS/INFO to the user
if [ "${ERR_STATE}" = true ] ; then
info_msg "One or more PMem modules reported > 0.000 GiB ReservedCapacity"
REPORT_COUNT_INFO=$((REPORT_COUNT_INFO+1))
else
echo "${STR_PASSED} ${FUNCNAME[0]} : No PMem modules have ReservedCapacity configured"
REPORT_COUNT_PASSED=$((REPORT_COUNT_PASSED+1))
fi
It would be more efficient (Don't Repeat Yourself) to call functions that:
Print the message with the appropriate message type (Info, Warn, Crit, Pass, Fail, Skipped)
Bump the stats counter for the result type (Info, Warn, Crit, Pass, Fail, Skipped)
Rules commonly have the following code that returns a PASS/FAIL to the user and bumps the stats counters:
It would be more efficient (Don't Repeat Yourself) to call functions that: