From 83f4d5226071e2e73020b9e73c18b669130798e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 11 Mar 2020 11:25:06 +0100 Subject: [PATCH] Regenerate drivedb's compatible list only if old And add a disk to that list only if not already present. --- xymon/plugins/client/ext/smartoverall | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xymon/plugins/client/ext/smartoverall b/xymon/plugins/client/ext/smartoverall index cbc832d..a72e8fe 100755 --- a/xymon/plugins/client/ext/smartoverall +++ b/xymon/plugins/client/ext/smartoverall @@ -159,7 +159,7 @@ choose_correct_type() { true > "${plugin_result}" true > "${plugin_state}" regenerate_if_too_old "${device_list}" 1440 -true > "${drivedb_list}" +regenerate_if_too_old "${drivedb_list}" 1440 # Get the list of all available devices if the previous list was emptied if test ! -s "${device_list}"; then @@ -215,12 +215,13 @@ https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase" else DSELFTEST_MSG="" ### If the device is also known from smartmontools database - if printf -- '%s' "${DDRIVEDB_MSG}" | grep -q -E -- "green" + ### and not already present in the list of compatible disk + if printf -- '%s' "${DDRIVEDB_MSG}" | grep -q -E -- "green" && + ! grep -q -- "${DISK}" "${drivedb_list}" then echo "${DISK}" >> "${drivedb_list}" fi fi - fi ## Test health status