table of contents
sos-collector(1) | General Commands Manual | sos-collector(1) |
NAME¶
sos-collector - Collect sosreports from multiple (cluster) nodes
USAGE¶
sos-collector
[-a|--all-options]
[-b|--become]
[--batch]
[-c CLUSTER_OPTIONS]
[--chroot CHROOT]
[--case-id CASE_ID]
[--cluster-type CLUSTER_TYPE]
[-e ENABLE_PLUGINS]
[--group GROUP]
[--save-group GROUP]
[--insecure-sudo]
[-k PLUGIN_OPTION]
[--label LABEL]
[-n SKIP_PLUGINS]
[--nodes NODES]
[--no-pkg-check]
[--no-local]
[--master MASTER]
[-o ONLY_PLUGINS]
[-p SSH_PORT]
[--password]
[--password-per-node]
[--preset PRESET]
[-s|--sysroot SYSROOT]
[--ssh-user SSH_USER]
[--sos-cmd SOS_CMD]
[-t|--threads THREADS]
[--timeout TIMEOUT]
[--tmp-dir TMP_DIR]
[-v|--verbose]
[--verify]
[-z|--compression-type COMPRESSION_TYPE]
DESCRIPTION¶
sos-collector is a utility to collect sosreports from multiple nodes and package them in a single useful tar archive.
sos-collector can be run either on a workstation that has SSH key authentication setup for the nodes in a given cluster, or from a "master" node in a cluster that has SSH keys configured for the other nodes.
Some sosreport options are supported by sos-collector and are passed directly to the sosreport command run on each node.
OPTIONS¶
- -a, --alloptions
- Enables all sosreport options.
This does NOT enable all sos-collector options.
- -b, --become
- Become the root user on the remote node when connecting as a non-root user.
- --batch
- Run in non-interactive mode. This will skip prompts for user input, with the exception of a prompt for the SSH password.
- --all-logs
- Sosreport option. Collects all logs regardless of size.
Default: no
- -c CLUSTER_OPTIONS
- Specify options used by cluster profiles. The format is
'profile.option_name=value'.
For example, for the ovirt plugin if you wanted to restrict node enumeration to a specific cluster you would use '-c ovirt.cluster=example_cluster'.
Available cluster options can be listed by running 'sos-collector -l'.
- --chroot CHROOT
- Sosreport option. Set the chroot mode. When --sysroot is used commands default to executing with SYSROOT as the root directory. This can be overridden by setting --chroot to "always" (always chroot) or "never" (always run in the host namespace).
- --case-id CASE_ID
- Sosreport option. Specifies a case number identifier.
- --cluster-type CLUSTER_TYPE
- When run by itself, sos-collector will attempt to identify the type of
cluster at play. This is done by checking package or configuration
information against the localhost, or the master node if
"--master" is supplied.
Setting --cluster-type skips this step and forcibly sets a particular profile.
Using a value of none or jbon (just a bunch of nodes) will effectively disable all cluster-specific checks, and cause sos-collector to only use the nodes specified by the --nodes option. Note that in this scenario, regex string(s) for node names will be ignored.
Example: sos-collector --cluster-type=kubernetes will force the kubernetes profile to be run, and thus set sosreport options and attempt to determine a list of nodes using that profile.
- -e ENABLE_PLUGINS, --enable-plugins ENABLE_PLUGINS
- Sosreport option. Use this to enable a plugin that would otherwise not be
run.
This option supports providing a comma-delimited list of plugins.
- --group GROUP
- Specify an existing host group definition to use.
Host groups are pre-defined settings for the cluster-type, master, and nodes options saved in JSON-formatted files under /var/lib/sos-collector/<GROUP>.
If cluster_type and/or master are set in the group, sos-collector behaves as if these values were specified on the command-line.
If nodes is defined, sos-collector extends the --nodes option, if set, with the nodes or regexes listed in the group.
Note that sos-collector will only write group definitions to /var/lib/sos-collector/ however the GROUP value may be a filename for any group definitions that exist outside of the default location. If you are manually writing these files, use the value null when a python NoneType is expected. Caveat: use string 'none' if setting cluster_type to none.
- --save-group GROUP
- Save the results of this run of sos-collector to a host group definition.
sos-colllector will write a JSON-formatted file with name GROUP to /var/lib/sos-collector/ with the settings for cluster-type, master, and the node list as discovered by cluster enumeration. Note that this means regexes are not directly saved to host groups, but the results of matching against those regexes are.
- --insecure-sudo
- Use this option when connecting as a non-root user that has passwordless
sudo configured.
If this option is omitted and a bogus sudo password is supplied, collection of sosreports may exhibit unexpected behavior and/or fail entirely.
- -k PLUGIN_OPTION, --plugin-option PLUGIN_OPTION
- Sosreport option. Set a plugin option to a particular value. This takes
the form of plugin_name.option_name=value.
Example: To enable the kubernetes "all" option in sosreport use -k kubernetes.all=on.
- --label LABEL
- Specify a label to be added to the archive names. This label will be
applied to both the sos-collector archive and the sosreport archives.
If a cluster sets a default label, the user-provided label will be appended to that cluster default.
- -n SKIP_PLUGINS, --skip-plugins SKIP_PLUGINS
- Sosreport option. Disable (skip) a particular plugin that would otherwise
run. This is useful if a particular plugin is prone to hanging for one
reason or another.
This option supports providing a comma-delimited list of plugins.
- --nodes NODES
- Provide a comma-delimited list of nodes to collect sosreports from, or a
regex string to be used to compare discovered node names against. If using
a regex, only nodes matching the regex will be used - i.e. it can be used
as a whitelist but not a blacklist.
This option can be handed multiple regex strings separated by commas. Additionally, both whole node names/addresses and regex strings may be provided at the same time.
- --no-pkg-check
- Do not perform package checks. Most cluster profiles check against
installed packages to determine if the cluster profile should be applied
or not.
Use this with --cluster-type if there are rpm or apt issues on the master/local node.
- --no-local
- Do not collect a sosreport from the local system.
If --master is not supplied, it is assumed that the host running sosreport is part of the cluster that is to be collected. Use this option to skip collection of a local sosreport.
This option is NOT needed if --master is provided.
- --master MASTER
- Specify a master node for the cluster.
If provided, then sos-collector will check the master node, not localhost, for determining the type of cluster in use.
- -o ONLY_PLUGINS, --only-plugins ONLY_PLUGINS
- Sosreport option. Run ONLY the plugins listed.
Note that a cluster profile will NOT override this option. This may cause the sosreports generated to not contain the relevant output for a given type of cluster.
This option supports providing a comma-delimited list of plugins.
- --password
- Specifying this option will cause sos-collector to prompt the user for an
SSH password that will be used to connect to all nodes.
If you have differing passwords for the same user across cluster nodes, you should ideally deploy SSH keys, but the --password-per-node option is also available.
- --password-per-node
- When using this option, sos-collector will prompt the user for the SSH password for each node that will have an sosreport collected from it individually before attempting to connect to the nodes.
- --preset PRESET
- Specify a sos preset to use, note that this requires sos-3.6 or later to
be installed on the node. The given preset must also exist on the remote
node - local presets are not used.
If --preset is specified and a given node either does not have that preset defined, or has a version of sos prior to 3.6, this option is ignored for that node.
- -p SSH_PORT, --ssh-port SSH_PORT
- Specify SSH port for all nodes. Use this if SSH runs on any port other than 22.
- --ssh-user SSH_USER
- Specify an SSH user for sos-collector to connect to nodes with. Default is
root.
sos-collector will prompt for a sudo password for non-root users.
- -s SYSROOT, --sysroot SYSROOT
- Sosreport option. Specify an alternate root file system path.
- --sos-cmd SOS_CMD
- Define all options that sosreport should be run with on the nodes. This
will override any other commandline options as well as any options
specified by a cluster profile.
The sosreport command will execute as 'sosreport --batch SOS_CMD'. The BATCH option cannot be removed from the sosreport command as it is required to run sosreport non-interactively for sos-collector to function.
- -t THREADS --threads THREADS
- Specify the number of threads to use for concurrent collection of
sosreports.
If the number of nodes enumerated exceeds the number of threads, then sos-collector will start collecting from the first X number of nodes and then continue to iterate through the remaining nodes as sosreport collection finishes.
Defaults to 4.
- --timeout TIMEOUT
- Timeout for sosreport generation on each node, in seconds.
Note that sosreports are collected in parallel, so this can also be considered to be approximately the same as a timeout for the entire collection process.
Default is 180 seconds.
- --tmp-dir TMP_DIR
- Specify a temporary directory to save sos archives to. By default one will
be created in /tmp and then removed after sos-collector has finished
running.
This is NOT the same as specifying a temporary directory for sosreport on the remote nodes.
- -v --verbose
- Print debug information to screen.
- --verfiy
- Sosreport option. Passes the "--verify" option to sosreport on
the nodes which causes sosreport to validate plugin-specific data during
collection.
Note that this option may considerably extend the time it takes sosreport to run on the nodes. Consider increasing --timeout when using this option.
- -z COMPRESSION, --compression-type COMPRESSION
- Sosreport option. Override the default compression type.
SEE ALSO¶
MAINTAINER¶
Jake Hunsaker <jhunsake@redhat.com>
April 2018 |