From ac0d619cd7cf27975d5197a1349522dbc73ebe7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 4 Mar 2020 10:56:36 +0100 Subject: [PATCH] Build a list of device known from smartmontools DB And compatible with selftest logging. This file can next be used by an advanced script. --- xymon/plugins/client/ext/smartoverall | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xymon/plugins/client/ext/smartoverall b/xymon/plugins/client/ext/smartoverall index ea121fe..cc4ab74 100755 --- a/xymon/plugins/client/ext/smartoverall +++ b/xymon/plugins/client/ext/smartoverall @@ -35,6 +35,9 @@ plugin_name=$(basename "${0}") plugin_result="${XYMONTMP}/${MACHINEDOTS}.smartoverall.plugin_result" plugin_state="${XYMONTMP}/${MACHINEDOTS}.smartoverall.plugin_state" device_list="${XYMONTMP}/${MACHINEDOTS}.smartoverall.dscan" +## List of devices known from the smartmontools base and compatible with test logging +## This file might be used by a more advanced script such as skazi0's one +drivedb_list="${XYMONTMP}/${MACHINEDOTS}.smart.drivedb.list" # ]]] @@ -112,6 +115,7 @@ choose_correct_type() { true > "${plugin_result}" true > "${plugin_state}" true > "${device_list}" +true > "${drivedb_list}" # Get the list of all available devices smartctl --scan >> "${device_list}" @@ -164,6 +168,11 @@ https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase" DSELFTEST_MSG="&clear Test logging are not supported:" else DSELFTEST_MSG="" + ### If the device is also known from smartmontools database + if printf -- '%s' "${DDRIVEDB_MSG}" | grep -q -E -- "green" + then + echo "${DISK}" >> "${drivedb_list}" + fi fi fi