From 3f02f05cacbf18965bd741289ccbd3cacd2e5c7b Mon Sep 17 00:00:00 2001 From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Sun, 5 Jul 2009 17:52:46 +0000 Subject: [PATCH] smartctl: Add option '-x, --xall' to print all info. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2820 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/CHANGELOG | 5 ++++- sm5/smartctl.8.in | 20 ++++++++++++++++---- sm5/smartctl.cpp | 23 +++++++++++++++++++++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG index 6f71441d7..b76f0e6e4 100644 --- a/sm5/CHANGELOG +++ b/sm5/CHANGELOG @@ -1,6 +1,6 @@ CHANGELOG for smartmontools -$Id: CHANGELOG,v 1.816 2009/07/05 17:16:38 chrfranke Exp $ +$Id: CHANGELOG,v 1.817 2009/07/05 17:52:46 chrfranke Exp $ The most recent version of this file is: http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup @@ -41,6 +41,9 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] smartctl: Add option '-x, --xall' to print all info including + extended SMART logs and non-SMART info. + [CF] smartctl: Add '-l xerror,error' and '-l xselftest,selftest' to print the old logs if the extended logs are not supported. diff --git a/sm5/smartctl.8.in b/sm5/smartctl.8.in index 984f8b31e..a49f0467e 100644 --- a/sm5/smartctl.8.in +++ b/sm5/smartctl.8.in @@ -1,7 +1,7 @@ .ig Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net> - $Id: smartctl.8.in,v 1.132 2009/07/05 17:16:38 chrfranke Exp $ + $Id: smartctl.8.in,v 1.133 2009/07/05 17:52:46 chrfranke Exp $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -181,8 +181,20 @@ and for SCSI, this is equivalent to .nf \'\-H \-i \-A \-l error \-l selftest\'. .fi -Note that for ATA disks this does \fBnot\fP enable the \'\-l -directory\' option. +Note that for ATA disks this does \fBnot\fP enable the non-SMART options +and the SMART options which require support for 48-bit ATA commands. +.TP +.B \-x, \-\-xall +Prints all SMART and non-SMART information about the device. For ATA +devices this is equivalent to +.nf +\'\-H \-i \-c \-A \-l xerror,error \-l xselftest,selftest \-l selective +\-l directory \-l scttemp \-l sataphy\'. +.fi +and for SCSI, this is equivalent to +.nf +\'\-H \-i \-A \-l error \-l selftest \-l background \-l sasphy\'. +.fi .TP .B RUN\-TIME BEHAVIOR OPTIONS: @@ -1753,7 +1765,7 @@ these documents may be found in the References section of the .SH CVS ID OF THIS PAGE: -$Id: smartctl.8.in,v 1.132 2009/07/05 17:16:38 chrfranke Exp $ +$Id: smartctl.8.in,v 1.133 2009/07/05 17:52:46 chrfranke Exp $ .\" Local Variables: .\" mode: nroff .\" End: diff --git a/sm5/smartctl.cpp b/sm5/smartctl.cpp index 62952c057..5a2ebe9bb 100644 --- a/sm5/smartctl.cpp +++ b/sm5/smartctl.cpp @@ -63,7 +63,7 @@ extern const char *os_solaris_ata_s_cvsid; extern const char *cciss_c_cvsid; #endif extern const char *atacmdnames_c_cvsid, *atacmds_c_cvsid, *ataprint_c_cvsid, *knowndrives_c_cvsid, *os_XXXX_c_cvsid, *scsicmds_c_cvsid, *scsiprint_c_cvsid, *utility_c_cvsid; -const char* smartctl_c_cvsid="$Id: smartctl.cpp,v 1.201 2009/07/05 17:16:44 chrfranke Exp $" +const char* smartctl_c_cvsid="$Id: smartctl.cpp,v 1.202 2009/07/05 17:52:46 chrfranke Exp $" ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SCSICMDS_H_CVSID SCSIPRINT_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; // This is a block containing all the "control variables". We declare @@ -132,6 +132,8 @@ void Usage (void){ " Show identity information for device\n\n" " -a, --all \n" " Show all SMART information for device\n\n" +" -x, --xall\n" +" Show all information for device\n\n" ); printf( "================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS =====\n\n" @@ -273,7 +275,7 @@ const char * parse_options(int argc, char** argv, scsi_print_options & scsiopts) { // Please update getvalidarglist() if you edit shortopts - const char *shortopts = "h?Vq:d:T:b:r:s:o:S:HcAl:iav:P:t:CXF:n:B:"; + const char *shortopts = "h?Vq:d:T:b:r:s:o:S:HcAl:iaxv:P:t:CXF:n:B:"; // Please update getvalidarglist() if you edit longopts struct option longopts[] = { { "help", no_argument, 0, 'h' }, @@ -295,6 +297,7 @@ const char * parse_options(int argc, char** argv, { "log", required_argument, 0, 'l' }, { "info", no_argument, 0, 'i' }, { "all", no_argument, 0, 'a' }, + { "xall", no_argument, 0, 'x' }, { "vendorattribute", required_argument, 0, 'v' }, { "presets", required_argument, 0, 'P' }, { "test", required_argument, 0, 't' }, @@ -559,6 +562,22 @@ const char * parse_options(int argc, char** argv, ataopts.smart_selective_selftest_log = true; /* scsiopts.smart_background_log = true; */ break; + case 'x': + ataopts.drive_info = scsiopts.drive_info = true; + ataopts.smart_check_status = scsiopts.smart_check_status = true; + ataopts.smart_general_values = true; + ataopts.smart_vendor_attrib = scsiopts.smart_vendor_attrib = true; + ataopts.smart_ext_error_log = scsiopts.smart_error_log = true; + ataopts.retry_error_log = true; + ataopts.smart_ext_selftest_log = scsiopts.smart_selftest_log = true; + ataopts.retry_selftest_log = true; + ataopts.smart_selective_selftest_log = true; + ataopts.smart_logdir = ataopts.gp_logdir = true; + ataopts.sct_temp_sts = ataopts.sct_temp_hist = true; + ataopts.sataphy = true; + scsiopts.smart_background_log = true; + scsiopts.sasphy = true; + break; case 'v': // parse vendor-specific definitions of attributes if (!strcmp(optarg,"help")) { -- GitLab