aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [dbus] Add environment variable collectionJake Hunsaker2019-08-251-0/+2
| | | | | | | Adds collection of the DBUS_SESSION_BUS_ADDRESS env var. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [x11] Collect X related environment variablesJake Hunsaker2019-08-251-0/+15
| | | | | | | | Adds collection of XDG environment variables, as well as DISPLAY and DESKTOP_SESSION. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [host] Add collection of environment variablesJake Hunsaker2019-08-251-0/+6
| | | | | | | | Adds collection of common environment variables relevant to support cases surrounding shell issues. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [kubernetes] Collect proxy env varsJake Hunsaker2019-08-251-0/+7
| | | | | | | Adds collection of proxy environment variables. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [podman] Collect proxy env varsJake Hunsaker2019-08-251-0/+7
| | | | | | | Adds collection of proxy environment variables. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [docker] Collect proxy env varsJake Hunsaker2019-08-251-0/+9
| | | | | | | Adds collection of proxy environment variables. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [crio] Capture proxy env varsJake Hunsaker2019-08-251-0/+7
| | | | | | | Adds collection of proxy environment variables. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [sosreport] grab logs since datePavel Moravec2019-08-256-12/+65
| | | | | | | | | | | | Adds a --since switch that takes a date as an argument. This switch will skip the archive files with a mtime older than the date. Also, --since affects journalctl execution for --all. Resolves: #1678 Signed-off-by: David Vallee Delisle <dvd@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [boot] Capture SecureBoot configuration statePavel Moravec2019-08-251-1/+4
| | | | | | | | | | Adds collection of mokutil to show is SecureBoot is enabled on the system or not. Fixes: #1574 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [scsi] call lsscsi with "-i" optionPavel Moravec2019-08-251-4/+2
| | | | | | | | | To get the WWID sd device combination in a single command. Resolves: #1626 Signed-off-by: Nitin U. Yewale <nyewale@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [networking] use automatic pred warning for ss and macsec commandsBryn M. Reeves2019-08-161-18/+6
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [networking] collect commands only when required kernel modules are loadedPavel Moravec2019-08-161-4/+42
| | | | | | | | | | | | - "ip -s macsec show" requires "macsec" kmod loaded - "ss -peaonmi" requires 6 *_diag kernel modules Execute the commands only when the modules are loaded, or when explicitly requested via --allow-system-changes option. Resolves: #1435 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [Plugin] log reason for commands skipped by predicateBryn M. Reeves2019-08-161-8/+11
| | | | | | | | | Automatically log the reason that a command was skipped by predicate, and optionally include a message indicating that it may alter system configuration and that collection can be enabled by specifying --allow-system-changes. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] add generic log_skipped_command() handlerBryn M. Reeves2019-08-161-0/+21
| | | | | | | | | | | | | Add a generic method to Plugin to log the reason that a command was skipped during predicate evaluation. The method accepts bool arguments indicating whether the command relies on kmod or service presence checks, and a 'change' argument that indicates that it may alter system configuration (adn so can be collected if the user supplies --allow-system-changes). Related: #1678 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [SoSPredicate] override kernel module tests if --allow-system-changesBryn M. Reeves2019-08-163-0/+7
| | | | | | | | | | If the --allow-system-changes option is in effect, bypass checking of kernel modules and allow commands to attempt to auto-load any missing modules when run. Related: #1678 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [SoSPredicate] make predicate evaluation members publicBryn M. Reeves2019-08-161-13/+13
| | | | | | | | | | | The predicate values used to evaluate a SoSPredicate are useful to code outside the class and can be safely read and set by plugin code: make these members public to allow details of predicate state to be more easily reported by generic Plugin code. Related: #1678 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosreport] log warning messages to stdout instead of stderrPavel Moravec2019-08-151-1/+6
| | | | | | | warning and lower priority logs should be logged to stdout error or higher logs should be logged to stderr Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [sosreport] add option --allow-system-changesPavel Moravec2019-08-153-11/+19
| | | | | | | | | | | Running some commands can change the system e.g. by loading a kernel modules. That disqualifies the commands from being called by default. Add an option that overrides this default behaviour. Related to: #1435 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [plugins] fix mangled command filenames collisionsPavel Moravec2019-08-151-7/+14
| | | | | | | | | | | | - Command filenames collisions must be tested tested against absolute path, not relative. Otherwise false positive results about no collisions are returned. - If collision happens for long filenames, ensure that appending ".1" or similar does not exceed the max filename length. Resolves: #1684 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [gluster] Add volume, state information and dump glusterd processesJake Hunsaker2019-08-151-37/+30
| | | | | | | | | | | | | | | | | | | | | Adds collection of 'gluster volume get $vol all' output for all volume names as well as the generate dumpfile from 'gluster get-state' when the 'dump' option is used. Note that this file will be under /var/run/gluster in the archive. Adds 'glusterd' to the list of processes sent signal USR1 when the 'dump' option is used. Removed the prep work previously done to redirect where the statedump files are written to, as it has been reported that those attempts do not function as intended. Statedumps are now collected from /var/run/gluster. Finally, some re-organization to ease future maintenance and updating the size-limiting logic to use the implicit limiting in add_copy_spec(). Resolves: #1664 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kdump] Collect vmcore-dmesg.txt files based on path and deviceMikel Olasagasti Uranga2019-08-151-0/+27
| | | | | | | | | | | | | | | kdump allows to configure to which filesystem and what path it will write contents of '/proc/vmcore'. kdump plugin currently only checks against a hardcoded path '/var/crash/*/vmcore-dmesg.txt'. With this change it will check the 'path' variable and also filesystems type ext2, ext3, ext4 or xfs against fstab. This will make the plugin check in the correct path in the system. Resolves: #1546 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [nvme] collect config file everytimePavel Moravec2019-07-301-1/+1
| | | | | | | | Collect /etc/nvme/discovery.conf every time, outside any for-loop block. Resolves: #1740 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [plugins] Stop plugin execution after timeout hitPavel Moravec2019-07-291-0/+11
| | | | | | | | | | | When a plugin timeouts, it must stop collecting further data. Otherwise a race issues with archive.finalize() can happen. So any data collection must be skipped if _timeout_hit is True. Resolves: #1736 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [peripety] collect proper config filePavel Moravec2019-07-291-1/+1
| | | | | | | | The config file is /etc/peripetyd.conf . Resolves: #1737 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [utilities] Fix high CPU usage and slow command collectionKazuhito Hagio2019-07-291-1/+3
| | | | | | | | | | | | | | | | | commit fc6721ac83c2 ("[Plugin] Terminate running commands when a plugin exceeds timeout") introduced a polling method to sos_get_command_output() but it is busy wait, and seems to increase the CPU usage and slow down AsyncReader significantly. As a result, a command that outputs much data like journalctl takes longer time, and the plugin times out. Inserting a sleep is a possible fix for this. Resolves: #1732 Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [openstack] Extract Placement plugin from NovaLee Yarwood2019-07-291-0/+112
| | | | | | | | | | | | | | | | | The OpenStack Placement service is being extracted from Nova [1] duringthe Stein development cycle [2]. This change extracts the required plugin logic from the original Nova plugin into a new Placement plugin ahead of this extraction. [1] https://docs.openstack.org/placement/latest/ [2] https://releases.openstack.org/stein/schedule.html Co-Authored-by: Piotr Kopec <pkopec@redhat.com> Resolves: #1676 Signed-off-by: Lee Yarwood <lyarwood@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [frr] FRR pluginPavel Moravec2019-07-091-0/+25
| | | | | | | | | A plugin for FRR alternative to Quagga. Path to conf is /etc/frr/. Resolves: #1666 Signed-off-by: Filip Krska <fkrska@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [archive] Handle checking container sysroot in _make_leading_pathsPavel Moravec2019-07-093-7/+17
| | | | | | | | | | | | | | | Previously, in _make_leading_paths(), checking host file paths did not account for non / sysroots, for situations where sos is run in a container and the host's / is actually mounted under /host for example. This would lead to copy errors when trying to copy symlinks. This method now will use sysroot if one is set, thus avoiding copy errors. Resolves: #1705 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [archive] convert absolute symlink targets to relativePavel Moravec2019-07-091-0/+5
| | | | | | | | | | Calling _make_leading_paths for a symlink with absolute symlink target must create the symlink relative to the source. This will prevent creating symlinks outside sosreport build dir. Resolves: #1710 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [sar] collect whole sar log dirPavel Moravec2019-07-091-17/+2
| | | | | | | | | | | Currently, sosreport does not collect files in saYYYYMMDD or similar format. Assuming sar log dir contains only sar related data it is safe to collect whole dir (up to size limit, from newest to oldest files). Resolves: #1700 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [policies] redhat policy to use hostname instead of rhn idPavel Moravec2019-07-091-23/+0
| | | | | | | | | As rhn is getting obsoleted and each host has its hostname, even redhat policy should use host name as the local name. Resolves: #1702 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [kubernetes] Write resource outputs to subdirsJake Hunsaker2019-05-211-4/+7
| | | | | | | | | | | | Updates the plugin to write 'kubectl get' and 'kubectl describe' output to a subdir named for each resource we iterate over. Additionally, logs output (when using the podlogs option) will be written to the 'pods' subdir. Resolves: #1628 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [podman] Write command output to relevant subdirJake Hunsaker2019-05-211-4/+7
| | | | | | | Updates the plugin to write command output for specific containers, images, volumes, etc... to a subdir named for that resource. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [buildah] Write command output to relevant subdirsJake Hunsaker2019-05-211-2/+4
| | | | | | | Updates the plugin to write command output for specific containers, images, volumes, etc... to a subdir named for that resource. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [docker] Write command output to relevant subdirJake Hunsaker2019-05-211-4/+7
| | | | | | | Updates the plugin to write command output for specific containers, images, volumes, etc... to a subdir named for that resource. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugin] Allow plugins to write to subdirsJake Hunsaker2019-05-211-7/+11
| | | | | | | | | | Calls to add_cmd_output() now support a 'subdir' parameter which, if set, will save command output in a subdir of the plugin's sos_commands/ directory. Fixes: #1600 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [katello] support both locations of qpid SSL certsPavel Moravec2019-05-171-1/+7
| | | | | | | | | | | | | Newer katello versions deploy certs for qpid to /etc/pki/pulp/qpid/client.crt certs instead of /etc/pki/katello/qpid_client_striped.crt . Sosreport should use either of the location that exists, to successfully run few qpid-stat commands. Resolves: #1680 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [unpackaged|RedHat] Don't exit on failed file list queryJake Hunsaker2019-05-142-8/+1
| | | | | | | | | | | | | | | The unpackaged plugin is the only one currently using a policy's file list as determined by PackageManager.all_files(). As such, we should not fail an entire sosreport run when the package file list query fails. Accordingly, the call to all_files() to populate and store the file list is now moved directly into the unpackaged plugin, rather than at policy initialization. Resolves: #1648 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [buildah] parse container list properly even for scratch onesPavel Moravec2019-05-141-1/+1
| | | | | | | | | Scratch containers dont have id, therefore we shall get container name as the latest string on each line instead of 5th. Resolves: #1647 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [foreman] support external postgres DBPavel Moravec2019-05-141-7/+37
| | | | | | | | | When external postgres DB is configured, we should query mongo commands against that DB instead of localhost. Resolves: #1649 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pulp] support external mongo DBPavel Moravec2019-05-141-2/+31
| | | | | | | | | When external mongo DB is configured, we should query mongo commands against that DB instead of localhost. Related to: #1649 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pulp] collect db and collection sizesPavel Moravec2019-05-141-0/+29
| | | | | | | | Collect basic db stats and also collection sizes of mongo pulp_database Resolves: #1645 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [sosreport] Print header before policy initializationJake Hunsaker2019-05-141-3/+3
| | | | | | | | | | | The version header is now printed before policy initialization as part of the SoSReport() constructor instead of in the execute() message. Fixes: #762 Resolves: #1644 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Allow plugins to capture environment variablesJake Hunsaker2019-05-143-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new 'add_env_var()' method to the Plugin class, which allows plugins to specify which environment variables should be recorded in the sos archive. This functions as a whitelist, as only environment variables requested by plugins will be captured. The new method accepts either a single string, or a list of strings. Collection of environment variables is done _after_ we have run collect() for each plugin, and will be written to the 'environment' file in the archive root. Only environment variables that exist will be written, so if a plugin requests an environment variable be captured and it does not appear in the file the chances are good that the variable is not set on the system. Each environment variable will only be captured once - so multiple plugins may specify the same environment variable without an issue. Additionally, when a plugin uses add_env_var(), the value passed as well as an upper- and lower- cased variant of the value will be added to the list of variables to be collected as well. This is because it is a frequent support issue where end users set an incorrectly-cased variable, and support representatives will want to know when this is the case. Because this functionality works off of a whitelist, environment variable values are not sanitized. Note also that due to the variable name casing functionality mentioned above, this means there is a small chance where sensitive data stored in differently-cased variables of the same name as common variables could be unintentionally captured. Use the --no-env-vars option to prevent capturing any environment variables wholesale. Fixes: #1396 Resolves: #1643 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kubernetes] Allow only capturing logs for certain podsJake Hunsaker2019-05-141-0/+10
| | | | | | | | | | | | | | | The 'podlogs' option was previously an all-or-nothing toggle, which could result in incredibly large amounts of data collection when only a few pod's logs were needed. This change adds a 'podlogs-filter' option that allows users to provide either a specific pod name or a regex to match pod names against, to limit the amount of pod logs we collect. Resolves: #1640 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Replace command tuples with a classJake Hunsaker2019-05-141-44/+42
| | | | | | | | | | | | | | | | | Adds a SoSCommand class to represent any command that will be collected by sos. This replaces the previously used command tuples, which had an ever growing length that made it difficult to quickly identify fields in the logs. The _add_cmd_output() method now passes SoSCommand objects to the collect_cmds list, and _get_command_output_now() will now use the class directly when referencing parameters supported by add_cmd_output(). Fixes: #1275 Resolves: #1639 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [manageiq] add postresql configuration pathDavid Luong2019-05-141-1/+5
| | | | | | | | | | | | | | The most recent version of CloudForms adds postgres configuration files at: /etc/managiq/postgresql.conf.d/ Include these in the set of files collected by the plugin. Resolves: #1637 Signed-off by: David Luong <dluong@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [npm] plugin to requires_rootPavel Moravec2019-05-141-1/+0
| | | | | | | | | Until our utils support commands execution for unpriviledged users, we should disable requires_root = False. Resolves: #1625 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [openstack_instack] add ansible.logEmilien Macchi2019-04-301-1/+2
| | | | | | | | | | | | | | | | | | | | Collect /var/lib/mistral/config-download-latest/ansible.log which is an important log to be able to debug issues with Ansible playbooks. /var/lib/mistral/config-download-latest is a directory that exists anyway on the undercloud and is the place where the ansible logs is stored. Note: we don't want to collect the whole /var/lib/mistral because it contains sensitive informations like username/passwords/endpoints. rhbz#1702806 rhbz#1702802 Resolves: #1661 Signed-off-by: Emilien Macchi <emilien@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosreport] update sos.conf manpages by [general] section descriptionPavel Moravec2019-04-301-4/+34
| | | | | | | | | Since PR #1530, sosreport supports all command line options. Man pages should document the enhancement. Resolves: #1652 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>