diff options
author | Adam Stokes <hackr@cypherbook.com> | 2013-03-25 17:32:09 -0400 |
---|---|---|
committer | Adam Stokes <hackr@cypherbook.com> | 2013-03-25 17:32:09 -0400 |
commit | 6ad35c90a6467355d4feb51d3e3357e7fddd3c43 (patch) | |
tree | a35efbb84adb821a31252a0eebb9f93fd00af86a | |
parent | f4bb0bbe954562d01d834c3220e743855ce1cd30 (diff) | |
parent | 03194f76076932120557b591664f5402b59232e0 (diff) | |
download | sos-6ad35c90a6467355d4feb51d3e3357e7fddd3c43.tar.gz |
Merge git://github.com/sosreport/sosreport into patch-1
-rw-r--r-- | man/en/sosreport.1 | 93 | ||||
-rw-r--r-- | sos/policies/__init__.py | 10 | ||||
-rw-r--r-- | sos/sosreport.py | 34 |
3 files changed, 89 insertions, 48 deletions
diff --git a/man/en/sosreport.1 b/man/en/sosreport.1 index e28e7581..b5a56974 100644 --- a/man/en/sosreport.1 +++ b/man/en/sosreport.1 @@ -1,6 +1,6 @@ .TH SOSREPORT 1 "Tue Apr 08 2010" .SH NAME -sosreport \- Generate debugging information for this system +sosreport \- Collect and package diagnostic and support data .SH SYNOPSIS .B sosreport [-l|--list-plugins]\fR @@ -13,71 +13,112 @@ sosreport \- Generate debugging information for this system [--debug] [--upload] [--tmp-dir directory]\fR [--profile] [--help]\fR .SH DESCRIPTION -\fBsosreport\fR generates a compressed tarball of debugging information -for the system it is run on that can be sent to technical support -reps that will give them a more complete view of the overall system -status. +\fBsosreport\fR generates a compressed tar archive of diagnostic +information from the running system. The archive may be stored +locally or centrally for recording or tracking purposes or may +be sent to technical support representatives, developers or +system administrators to assist with technical fault-finding and +debugging. +.LP +Sos is modular in design and is able to collect data from a wide +range of subsystems and packages that may be installed. An +XML or HTML report summarizing the collected information is +optionally generated and stored within the archive. .SH OPTIONS .TP .B \-l, \--list-plugins -This will list all available plugins showing which ones will be enabled by the current configuration. It will also show all plugin options which can be -modified using the -k option (see below). +List all available plugins and their options. Plug-ins that would +not be enabled by the current configuration are listed separately. .TP .B \-n, --skip-plugins PLUGNAME[,PLUGNAME] -Do not load specified plugin(s). To specify multiple plugins, separate them with a comma. +Disable the specified plugin(s). Multiple plug-ins may be specified +by repeating the option or as a comma-separated list. .TP .B \-e, --enable-plugins PLUGNAME[,PLUGNAME] -Enable the specified plugin(s). To specify multiple plugins, separate them with a comma. +Enable the specified plugin(s). Multiple plug-ins may be specified +by repeating the option or as a comma-separated list. .TP .B \-o, --only-plugins PLUGNAME[,PLUGNAME] -Enable the specified plugin(s) only (all other plugins should be disabled). To specify multiple plugins, separate them with a comma. +Enable the specified plugin(s) only (all other plugins should be +disabled). Multiple plugins may be specified by repeating the option +or as a comma-separated list. .TP .B \-k PLUGNAME.PLUGOPT[=VALUE] -This is used to specify options for plugins. A list of available plugin options can be obtained from the output of --list-plugins. -If no value is specified and the option is a boolean (on/off), it will be set to "on". +Specify plug-in options. The option PLUGOPT is enabled, or set to the +specified value in the plug-in PLUGNAME. .TP .B \-a, \--alloptions -Enable all (boolean) options for all loaded plugins. +Set all boolean options to True for all enabled plug-ins. .TP .B \--upload FTP_SERVER -Upload the report to Red Hat (use exclusively if advised from a Red Hat support representative). +Upload the report to the configured destination. .TP .B \-v, \--verbose -Increase the verbosity of the output as sosreport is running. Multiple -v mean more verbosity. +Increase logging verbosity. May be specified multiple times to enable +additional debugging messages. +.TP +.B \-q, \--quiet +Only log fatal errors to stderr. .TP .B \--report -Enable html/xml report writing +Enable HTML/XML report writing. .TP .B \--config-file CONFIG -Specify alternate configuration file +Specify alternate configuration file. .TP .B \--tmp-dir DIRECTORY -Specify alternate temporary directory to copy data as well as the compressed report. +Specify alternate temporary directory to copy data as well as the +compressed report. .TP .B \--batch -Perform data gathering unattended +Generate archive without prompting for interactive input. .TP .B \--name NAME -Define a unique name for archive +Specify a name to be used for the archive. .TP .B \--ticket-number NUMBER -Define a unique number for archive +Specify a ticket number to be used for archive .TP .B \--build -Do not archive copied data, leave directory tree untouched for further modification +Do not archive copied data. Causes sosreport to leave an uncompressed +archive as a temporary file or directory tree. .TP .B \--debug -Give opportunity to debug python exceptions through the python debugger. +Enable interactive debugging using the python debugger. Exceptions in +sos or plug-in code will cause a trap to the pdb shell. .TP .B \--profile -Turn on profiling for cmds run +Enable profiler logging. .TP .B \--help -Display sosreport help system. +Display usage message. .SH MAINTAINER .nf -Adam Stokes <astokes@fedoraproject.org> +Bryn M. Reeves <bmr@redhat.com> .fi +.SH AUTHORS & CONTRIBUTORS + +Adam Stokes, +Ben Turner, +Bryn M. Reeves, +Eugene Teo, +Gary Kotton, +Jesse Jaggars, +Joey Boggs, +John Berninger, +Justin Payne, +Keith Kearnan, +Kent Lamb, +Marc Sauton, +Navid Sheikhol-Eslami, +Pierre Amadio , +Pierre Carrier, +Ranjith Rajaram, +Sadique Puthen, +Shijoe George, +Steve Conklin, +Tomas Smetana +.nf .SH TRANSLATIONS .nf Translations are handled by transifex (https://fedorahosted.org/transifex/) diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 2ec0970a..224abdd8 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -339,8 +339,8 @@ No changes will be made to system configuration. def _print(self, msg=None): """A wrapper around print that only prints if we are not running in - silent mode""" - if not self.commons['cmdlineopts'].silent: + quiet mode""" + if not self.commons['cmdlineopts'].quiet: if msg: print msg else: @@ -352,14 +352,14 @@ No changes will be made to system configuration. the user in non-batch mode. If your policy sets self.distro that text will be substituted accordingly. You can also override this method to do something more complicated.""" - width = 60 + width = 58 _msg = self.msg % {'distro': self.distro, 'vendor': self.vendor, 'vendor_url': self.vendor_url, 'vendor_text': self.vendor_text, 'tmpdir': self.commons['tmpdir']} _fmt = "" for line in _msg.splitlines(): - _fmt = _fmt + fill(line, width, replace_whitespace = False) + '\n' + _fmt = _fmt + fill(" " + line, width, replace_whitespace = False) + '\n' return _fmt @@ -430,7 +430,7 @@ class LinuxPolicy(Policy): localname = self.getLocalName() - if not self.commons['cmdlineopts'].batch and not self.commons['cmdlineopts'].silent: + if not self.commons['cmdlineopts'].batch and not self.commons['cmdlineopts'].quiet: try: self.reportName = raw_input(_("Please enter your first initial and last name [%s]: ") % localname) diff --git a/sos/sosreport.py b/sos/sosreport.py index ef49a09c..b5691c05 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -198,7 +198,7 @@ class XmlReport(object): class SoSReport(object): - def __init__(self, opts): + def __init__(self, args): self.loaded_plugins = deque() self.skipped_plugins = deque() self.all_options = deque() @@ -212,7 +212,7 @@ class SoSReport(object): pass # not available in java, but we don't care - self.opts, self.args = self.parse_options(opts) + self.opts = self.parse_options(args)[0] self.tempfile_util = TempFileUtil(tmp_dir=self.opts.tmp_dir) self._set_debug() self._read_config() @@ -322,7 +322,7 @@ class SoSReport(object): flog.setLevel(logging.INFO) self.soslog.addHandler(flog) - if not self.opts.silent: + if not self.opts.quiet: console = logging.StreamHandler(sys.stderr) console.setFormatter(logging.Formatter('%(message)s')) if self.opts.verbosity > 1: @@ -344,7 +344,7 @@ class SoSReport(object): self.ui_log.addHandler(ui_fhandler) - if not self.opts.silent: + if not self.opts.quiet: ui_console = logging.StreamHandler(sys.stdout) ui_console.setFormatter(logging.Formatter('%(message)s')) ui_console.setLevel(logging.INFO) @@ -641,7 +641,7 @@ class SoSReport(object): for i in izip(self.loaded_plugins): plugruncount += 1 plugname, plug = i[0] - if not self.opts.silent: + if not self.opts.quiet: sys.stdout.write("\r Running %d/%d: %s... " % (plugruncount, len(self.loaded_plugins), plugname)) sys.stdout.flush() try: @@ -791,7 +791,7 @@ class SoSReport(object): self.soslog.error(_("no valid plugins were enabled")) self._exit(1) - def parse_options(self, opts): + def parse_options(self, args): """ Parse command line options """ self.parser = parser = OptionParserExtended(option_class=SosOption) @@ -800,14 +800,14 @@ class SoSReport(object): help="list plugins and available plugin options") parser.add_option("-n", "--skip-plugins", action="extend", dest="noplugins", type="string", - help="skip these plugins", default = deque()) + help="disable these plugins", default = deque()) parser.add_option("-e", "--enable-plugins", action="extend", dest="enableplugins", type="string", help="enable these plugins", default = deque()) parser.add_option("-o", "--only-plugins", action="extend", dest="onlyplugins", type="string", help="enable these plugins only", default = deque()) - parser.add_option("-k", action="append", + parser.add_option("-k", "--plugin-option", action="append", dest="plugopts", type="string", help="plugin options in plugname.option=value format (see -l)") parser.add_option("-a", "--alloptions", action="store_true", @@ -818,22 +818,22 @@ class SoSReport(object): help="upload the report to an ftp server") parser.add_option("--batch", action="store_true", dest="batch", default=False, - help="do not ask any question (batch mode)") + help="batch mode - do not prompt interactively") parser.add_option("-v", "--verbose", action="count", dest="verbosity", help="increase verbosity") - parser.add_option("", "--silent", action="store_true", - dest="silent", default=False, - help="Only display FATAL errors on stdout") + parser.add_option("", "--quiet", action="store_true", + dest="quiet", default=False, + help="only print fatal errors") parser.add_option("--debug", action="count", dest="debug", - help="enabling debugging through python debugger") + help="enable interactive debugging using the python debugger") parser.add_option("--ticket-number", action="store", dest="ticketNumber", - help="set ticket number") + help="specify ticket number") parser.add_option("--name", action="store", dest="customerName", - help="define customer name") + help="specify report name") parser.add_option("--config-file", action="store", dest="config_file", help="specify alternate configuration file") @@ -842,7 +842,7 @@ class SoSReport(object): help="specify alternate temporary directory", default=tempfile.gettempdir()) parser.add_option("--report", action="store_true", dest="report", - help="Enable html/xml reporting", default=False) + help="Enable HTML/XML reporting", default=False) parser.add_option("--profile", action="store_true", dest="profiler", help="turn on profiling", default=False) @@ -850,7 +850,7 @@ class SoSReport(object): help="compression technology to use [auto, zip, gzip, bzip2, xz] (default=auto)", default="auto") - return parser.parse_args(opts) + return parser.parse_args(args) def set_option(self, name, value=None): """Allows setting of 'command line options' without passing in a |