diff --git a/xymon/plugins/client/ext/smartoverall b/xymon/plugins/client/ext/smartoverall index a72e8fe..f1c6866 100755 --- a/xymon/plugins/client/ext/smartoverall +++ b/xymon/plugins/client/ext/smartoverall @@ -97,11 +97,13 @@ is_disk_support_smart() { [ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : is_disk_support_smart func − check if SMART is supported on : ${_disk}." - ## Create or empty previous file - true > "${_smarctl_support_result}" + ## Create or empty previous file only if older than 24h (1440 minutes) + regenerate_if_too_old "${_smarctl_support_result}" 1440 - ## Grep only "support" lines from disk's informations - smartctl -d "${_type}" -i -- "${_disk}" | grep -E "^SMART support is:" -- >> "${_smarctl_support_result}" + ## Grep only "support" lines from disk's informations only if the file was emptied + if test ! -s "${_smarctl_support_result}"; then + smartctl -d "${_type}" -i -- "${_disk}" | grep -E "^SMART support is:" -- >> "${_smarctl_support_result}" + fi ## If the file is not empty if test -s "${_smarctl_support_result}"; then