From 5c8a9f9bb59912e350c8f7952a8bba58fb934c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 11 Mar 2020 11:20:26 +0100 Subject: [PATCH] Regenerate list of SMART disk only if too old --- xymon/plugins/client/ext/smartoverall | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xymon/plugins/client/ext/smartoverall b/xymon/plugins/client/ext/smartoverall index 7c3e00a..cbc832d 100755 --- a/xymon/plugins/client/ext/smartoverall +++ b/xymon/plugins/client/ext/smartoverall @@ -158,11 +158,13 @@ choose_correct_type() { # Create or empty previous files true > "${plugin_result}" true > "${plugin_state}" -true > "${device_list}" +regenerate_if_too_old "${device_list}" 1440 true > "${drivedb_list}" -# Get the list of all available devices -smartctl --scan >> "${device_list}" +# Get the list of all available devices if the previous list was emptied +if test ! -s "${device_list}"; then + smartctl --scan >> "${device_list}" +fi # If the file is not empty if test -s "${device_list}"; then