From faba9270a0fd0319356bc8a003db64b349f6740f Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Tue, 29 Aug 2017 13:41:38 +0000 Subject: [PATCH] Use --format=brief attribute format by default. Removed "Updated" column from attributes; advanced users can look at flags to get that information. --- gsmartcontrol/src/applib/smartctl_parser.cpp | 4 ++-- gsmartcontrol/src/applib/storage_device.cpp | 4 ++-- gsmartcontrol/src/gsc_info_window.cpp | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/gsmartcontrol/src/applib/smartctl_parser.cpp b/gsmartcontrol/src/applib/smartctl_parser.cpp index 7e377b1..8296a50 100644 --- a/gsmartcontrol/src/applib/smartctl_parser.cpp +++ b/gsmartcontrol/src/applib/smartctl_parser.cpp @@ -1352,8 +1352,8 @@ bool SmartctlParser::parse_section_data_subsection_error_log(const std::string& // Error log version { - // SMART Error Log Version: 1 - // SMART Extended Comprehensive Error Log Version: 1 (1 sectors) + // "SMART Error Log Version: 1" + // "SMART Extended Comprehensive Error Log Version: 1 (1 sectors)" pcrecpp::RE re = app_pcre_re("/^(SMART (Extended Comprehensive )?Error Log Version): ([0-9]+).*?$/mi"); std::string name, value; diff --git a/gsmartcontrol/src/applib/storage_device.cpp b/gsmartcontrol/src/applib/storage_device.cpp index 80833e5..2f3eeeb 100644 --- a/gsmartcontrol/src/applib/storage_device.cpp +++ b/gsmartcontrol/src/applib/storage_device.cpp @@ -324,10 +324,10 @@ std::string StorageDevice::fetch_data_and_parse(hz::intrusive_ptr sma if (this->get_type_argument() == "scsi") { // not sure about correctness... FIXME probably fails with RAID/scsi // This doesn't do much yet, but just in case... // SCSI equivalent of -a --get=all: - error_msg = execute_device_smartctl("--health --info --get=all --attributes --log=xerror,50,error --log=xselftest,50,selftest", smartctl_ex, output); + error_msg = execute_device_smartctl("--health --info --get=all --attributes --format=brief --log=xerror,50,error --log=xselftest,50,selftest", smartctl_ex, output); } else { // ATA equivalent of -a --get=all: - error_msg = execute_device_smartctl("--health --info --get=all --capabilities --attributes --log=xerror,50,error --log=xselftest,50,selftest --log=selective", + error_msg = execute_device_smartctl("--health --info --get=all --capabilities --attributes --format=brief --log=xerror,50,error --log=xselftest,50,selftest --log=selective", smartctl_ex, output, true); // set type to invalid if needed } // See notes above (in fetch_basic_data_and_parse()). diff --git a/gsmartcontrol/src/gsc_info_window.cpp b/gsmartcontrol/src/gsc_info_window.cpp index 1c535f7..61f3813 100644 --- a/gsmartcontrol/src/gsc_info_window.cpp +++ b/gsmartcontrol/src/gsc_info_window.cpp @@ -645,18 +645,19 @@ void GscInfoWindow::fill_ui_with_info(bool scan, bool clear_ui, bool clear_tests num_tree_cols = app_gtkmm_create_tree_view_column(col_type, *treeview, "Type", "Alarm condition is reached when if normalized value becomes less than or equal to threshold. Type indicates whether it's a signal of drive's pre-failure time or just an old age.", false, true); - Gtk::TreeModelColumn col_updated; - model_columns.add(col_updated); - num_tree_cols = app_gtkmm_create_tree_view_column(col_updated, *treeview, - "Updated", "The attribute is usually updated continuously, or during Offline Data Collection only. This column indicates that.", true); + // Doesn't carry that much info. Advanced users can look at the flags. +// Gtk::TreeModelColumn col_updated; +// model_columns.add(col_updated); +// num_tree_cols = app_gtkmm_create_tree_view_column(col_updated, *treeview, +// "Updated", "The attribute is usually updated continuously, or during Offline Data Collection only. This column indicates that.", true); Gtk::TreeModelColumn col_flag_value; model_columns.add(col_flag_value); num_tree_cols = app_gtkmm_create_tree_view_column(col_flag_value, *treeview, "Flag", "Flag value\n\n" "If given in POSRCK+ format, the presence of each letter indicates that the flag is on.\n" - "P: pre-failure warning\n" - "O: updated continuously\n" + "P: pre-failure attribute (if the attribute failed, the drive is failing)\n" + "O: updated continuously (as opposed to updated on offline data collection)\n" "S: speed / performance attribute\n" "R: error rate\n" "C: event count\n" @@ -720,7 +721,7 @@ void GscInfoWindow::fill_ui_with_info(bool scan, bool clear_ui, bool clear_tests row[col_threshold] = (iter->value_attribute.threshold.defined() ? hz::number_to_string(iter->value_attribute.threshold.value()) : "-"); row[col_raw] = iter->value_attribute.format_raw_value(); row[col_type] = attr_type; - row[col_updated] = StorageAttribute::get_update_type_name(iter->value_attribute.update_type); +// row[col_updated] = StorageAttribute::get_update_type_name(iter->value_attribute.update_type); row[col_failed] = fail_time; row[col_tooltip] = iter->get_description(); row[col_storage] = &(*iter);