aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [build] Bump version to sos-4.44.4Jake Hunsaker2022-08-153-4/+10
| | | | | | This commit marks the release of sos-4.4. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [snap] Further fixes in snapcraft.yaml for build and runArif Ali2022-08-151-3/+5
| | | | | | | | * Previous commit for dist was wrong, and required site-packages instead * sos report was unablt to run in bionic, and required python3-magic as dependancy Signed-off-by: Arif Ali <arif.ali@canonical.com>
* Update hpssm.py to work on all enumerated controllers. Including new ↵scality-trevorbenson2022-08-151-10/+45
| | | | | | | docstring and style adjustments. Signed-off-by: Trevor Benson <trevor.benson@scality.com> Signed-off-by: scality-trevorbenson <trevor.benson@scality.com>
* [ceph_mgr] Add orchestrator CLI commandsJose Castillo2022-08-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the following commands to the Ceph Manager plugin: - To list hosts: ceph orch host ls - To list devices on a host: ceph orch device ls - To check the curent specification file/List services known to orchestrator: ceph orch ls --export - To list daemons known to orchestrator: ceph orch ps - To check the configured backend and its status: ceph orch status --detail - To check service versions vs available and target containers: ceph orch upgrade status - To see the recent activities/log from cephadm: ceph log last cephadm Resolves: RHBZ#2116602 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [stratis] Update plugin commands for 3.xBryn M. Reeves2022-08-111-1/+3
| | | | | | | | | Update the stratis plugin commands to unclude stopped pools, the stopped pools and managed object reports, and remove the collection of the daemon redundancy command which is no longer supported. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [teamd,tests] Add a test for teamd plugin and device enumerationJake Hunsaker2022-08-102-5/+61
| | | | | | | | | | | | | Adds a new test case for the `teamd` plugin that also inherently acts to test team device enumeration. Included with this test case is an addition to the base test classes that allows for tests to define a `post_test_tear_down()` method that will be run at the end of each test execution to allow for manual cleanup - in this case deleting a 'fake' team device created for the test. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] ensure Policy.dist_version returns int and not strPavel Moravec2022-08-092-3/+3
| | | | | | | | | Int is more intuitive and already used in some plugins (foreman, python). Resolves: #2997 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [snap] Update snapcraft.yaml to fix PYTHONPATHArif Ali2022-08-081-3/+3
| | | | | Closes: #2994 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [nvme]: Update nvme plugin to collect nvme logsmamatha2022-08-041-1/+1
| | | | | | | | This patch is to update nvme plugin to collect /dev/nvme data Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Tested-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com>
* [auditd] Capture log files when configured to a non default locationJose Castillo2022-08-021-2/+16
| | | | | | | | | | The location of the audit.log files can be changed in the configuration file /etc/audit/audit.conf. This change ensures that we capture the log files when the user specifies a different location via log_file. Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [Plugin] Don't log content of captured stringsJake Hunsaker2022-08-011-15/+4
| | | | | | | | | Stop logging the contents of strings added via `add_string_as_file()`. This can ultimately be used via sizelimiting mechanisms, which means we effectively are writing the entire sizelimited content twice, which can make the logs needlessly bloated and harder to quickly navigate. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [flake8] Fix new style alertsJake Hunsaker2022-08-012-2/+2
| | | | | | | Fix two new alerts from `flake8` that appear to have gone unnoticed until a recent update. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collect] Standardize use of `exit()`Jake Hunsaker2022-07-291-46/+65
| | | | | | | | | | | | | | | | | | There were multiple exit paths and behaviors within sos collect, that were not the easiest to logically follow. Fix this by standardizing on leveraging `self.exit()` to exit in all situations. If a message is provided to this call, it is regarded as an error message and logged as such. This method will still set the exit code according to the `error` parameter, however that has been changed to default to 0 to signify a "clean" end of execution. Finally, there is a new `force` parameter which is meant to be used when exiting from within a child thread when the entire process needs to exit (and thus needs to leverage the lower-level `os._exit()` instead). Closes: #2882 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [python] Update version-dependent command for installed versionJake Hunsaker2022-07-281-3/+17
| | | | | | | | | | Updates the python plugin to use `python3` for Ubuntu and Debian distributions, and locks the use of `platform-python` to RHEL 8 as RHEL 9 does not continue to use of this interpreter executable. Closes: #2502 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redhat] Simplify `dist_version()` logicJake Hunsaker2022-07-281-10/+4
| | | | | | | | | | | | | | Simplifies the logic in `dist_version()` to just return the major version of the `redhat-release` package. This will not only remove a requirement to update this check for new major version releases, but also makes the call meaningful on RH-family distros aside from RHEL, such as Fedora. Note that this may fail on RHEL 5, but that is not a valid concern as RHEL 5 does not support python3 and thus should never be in a situation where sos-4.x+ is installed on such a system. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack] Ensure memcache_secret_key is maskedTakashi Kajinami2022-07-279-7/+22
| | | | | | | | The memcache_secret_key parameter from the keystonemiddleware library takes the secret key used to encrypt data stored in memcache, so it is considered as sensitive information. Signed-off-by: Takashi Kajinami <tkajinam@redhat.com>
* [tests] Update networking test in suiteJake Hunsaker2022-07-251-0/+7
| | | | | Adds a new test to the networking plugin test to ensure we iterate correctly over network devices.
* [NetworkManager] Update plugin to use add_device_cmd()Jake Hunsaker2022-07-251-9/+3
| | | | | | | Updates the plugin to use `add_device_cmd()` for the iteration of `nmcli dev` commands, rather than enumerating them directly within the plugin. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [teamd] Update teamd plugin to use add_device_cmd()Jake Hunsaker2022-07-251-20/+8
| | | | | | | | | Updates the plugin to use `add_device_cmd()`, leveraging the list of team devices discovered during intialization, rather than discovering them in the plugin (which seemed to be outdated/broken for at least a few newer versions of Fedora). Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] Update plugin to use `add_device_cmd()` for device iterationJake Hunsaker2022-07-251-42/+29
| | | | | | | | | Updates the `networking` plugin to leverage `add_device_cmd()` for various command collections, like ethtool, against discovered ethernet devices so that the plugin does not have to directly discover/validate these devices. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Allow add_device_cmd() to handle `subdir` parameterJake Hunsaker2022-07-251-4/+9
| | | | | | | | | Previously, `add_device_cmd()` did not support the `subdir` parameter which is used to place command output into a subdir within the calling plugin's own directory. Fix this by allowing this parameter to be passed on to the eventual `add_cmd_output()` call. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] Add network device enumerationJake Hunsaker2022-07-251-8/+137
| | | | | | | | | | | | | | | | | | | Adds network device enumeration to the generated `devices` dict that gets handed to plugins, and used for iteration by `add_device_cmd()`. For the moment, this enumeration is limited to ethernet and bridge devices, though this is expected to be expanded on later. These devices are added to the top-level `network` element within the `devices` dict, so both can be referenced at once using that key. Additionally, namespaced network interfaces are added under a `namespaced_network` key, which contains sub-dicts for each namespace which in turn contain ethernet device lists. Note that these namespaced device lists must be referenced specifically rather than via their key strings, and this is done to avoid overlapping namespaced devices with non-namespaced devices. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_aodh] Mask more sensitive valuesTakashi Kajinami2022-07-251-18/+21
| | | | | | | This change ensures a few more sensitive values are masked when gathering the config file for the Aodh service. Signed-off-by: Takashi Kajinami <tkajinam@redhat.com>
* Georgian translationNorwayFun2022-07-251-35/+37
| | | | Signed-off-by: Temuri Doghonadze <temuri dot doghonadze at gmail dot com>
* [logging] Safeguard against attempting to log non-UTF charactersJake Hunsaker2022-07-212-1/+6
| | | | | | | | | | | | | | The `logging` module does not support non UTF-8 characters, and as such there was an exception being thrown when trying to log for example a copied file that has such characters in the file name. Safeguard against this by converting all messages logged via `Plugin._format_msg()` to UTF-8, and replace any problematic characters with `?`s to attempt to preserve context within the logs. Closes: #2790 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Refactor add_blockdev_cmd into add_device_cmdJake Hunsaker2022-07-208-51/+106
| | | | | | | | | | | | | | | | | | | | | | | | Initially, the design behind `add_blockdev_cmd()` made the assumption that there would (eventually) be separate methods for different kinds of devices. On review, this is less practical and less maintainable than a single method, `add_device_cmd()` paired with improved functionality for handling device lists. As such, rework `add_blockdev_cmd()` into `add_device_cmd()` and with it, change the logic on how device lists are sourced. The `devices` dict handed to plugins now has a top-level separation between device types, in this revision putting `block` and `fibre` devices under `storage` in the `devices` dict. In using `add_device_cmd()`, plugins may now specify either `block`, `fibre`, or `storage` for both. In addition, any devices passed via the `devices` parameter that aren't keys in the devices dict are returned, meaning a plugin may specify a list of devices and add `storage` to include all storage devices for command iteration. This change should allow easier addition of network device iteration. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] Fix loop devices data gatheringJose Castillo2022-07-191-1/+13
| | | | | | | | | | | | | | | | | | | | | When we run parted command on detached loop devices, some error messages are printed in the kernel ring buffer, like: [ +10.838245] blk_update_request: I/O error, dev loop0, sector 0 op 0x1: (WRITE) flags 0x800 phys_seg 0 prio class 0 Warning: Error fsyncing/closing /dev/loop0: Input/output error These error messages are printed as well when parted gets run while collecting sosreport. This patch solves the problem by removing detached devices from the list returned from get_block_devs(). Fixes: RHBZ#2010735 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [openvswitch] Extend package version patternDavid Marchand2022-07-191-1/+1
| | | | | | | | | | | | The next OVS release will be numbered 3.0. In a near future, the Red Hat Fast Datapath channel will provide packages versionned in a same manner. While at it, OVS release major number may change again in the future. Use a pattern matching from OVS 2.x up to OVS 9.x. We should be fine for a while :-). Signed-off-by: David Marchand <david.marchand@redhat.com>
* [ovn_central] Query ovn-northd status with ovn-appctlTrent Lloyd2022-07-191-8/+11
| | | | | | | | This will tell us both if it is currently active or standby but also this command has been seen to hang/timeout if ovn-northd is in a bad state which was not otherwise obvious. Signed-off-by: Trent Lloyd <trent.lloyd@canonical.com>
* [cirrus] Update GCE testing imagesJake Hunsaker2022-07-191-9/+12
| | | | | | | | Updates the images for Fedora to use the stock images on GCE, the CentOS Stream images to their latest release, and the Ubuntu images to test on the latest 22.04 LTS release. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [clean] Don't re-create regex for parsers on every skip checkJake Hunsaker2022-07-192-4/+13
| | | | | | | | | | | | | When determining if a parser should be skipped for a given file, we were previously doing so ineffeciently by regenerating the regex object for every file from the parser's `skip_files` class attr. Instead, during parser initialization, use those string definitions to create a list of regex objects to be used directly by the skip file checks. This way, we only generate the regex objects once for each parser for the entire run. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [clean,IP Parser] Skip obvious version files for the IP parserJake Hunsaker2022-07-195-2/+71
| | | | | | | | | | | For files that can be considered obvious version files - those that end specifically with either `version` or `version.txt` - skip processing via the IP parser, as this may lead to improper obfuscation of certain version strings. This is also applied to files ending in `release`. Closes: #2962 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [insights] Collect /var/lib/insightsJake Hunsaker2022-07-062-2/+14
| | | | | | | | | | | Adds collection of `/var/lib/insights` to the `insights` plugin. There is an `.egg` in this location but rather than individually skipping it, add a global forbidden path on all eggs. Related: RHBZ#2103233 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [logs] Drop catalog from `this` and `last` bootJake Hunsaker2022-07-062-3/+3
| | | | | | | | | Removes catalog entries from the journal collection for `this` and `last` boot collections. Closes: #2132 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Increase default timeoutJake Hunsaker2022-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | For our CI tests, CPU resources are not guaranteed which in turn can cause longer-than-expected run times for test executions. In practice, this is only seen occasionally but it requires manual intervention when the timeouts are hit (and thus far it has been seen that the changes these timeouts are hit on are not actually causing the timeouts). Previous conversations have revolved around improving test efficiency, however this seems unlikely given the nature of some of the test setup and further, even with the most efficienct approach possible we would still be at the whim of resource availability. As such, increase the default timeout to account for this resource consideration. Closes: #2700 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [PackageManager] Make pkg_by_name() more predictableJake Hunsaker2022-06-287-37/+28
| | | | | | | | | | | | | | | | | | | | As highlighted in #1817, `pkg_by_name()` could provide unpredictable results, when using wildcards. As such, limited this method to only returning package info for exact package name matches. In turn, change `Plugin.is_installed()` to leverage `PackageManager.all_pkgs_by_name()` which does explicitly support wildcards and returns information on _all_ matching packages, not just the last one found. In so doing, clean up the `PackageManager` design to use a new `packages` property for these lookups, and update the former usage of `all_pkgs()` accordingly. Similarly, signal `get_pkg_list()` should be private (in any sense that a python method can be) by renaming to `_get_pkg_list()` and update the single Plugin (`etcd`) referencing this method. Closes: #1817 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* General data do main.fmfMaros Kopec2022-06-282-6/+9
| | | | Signed-off-by: Maros Kopec <makopec@redhat.com>
* Enable testing on Testing FarmMaros Kopec2022-06-284-0/+24
| | | | | | | | Using tmt/fmf enable testing on Testing Farm via Packit. The executed tests are stable BeakrLib tests which were upstreamed for this purpose. Signed-off-by: Maros Kopec <makopec@redhat.com>
* [policies] Remove deadcode around runlevelsJake Hunsaker2022-06-273-53/+0
| | | | | | | | | | | Removes the `runlevel_by_service()` methods from the redhat and suse policies, as these methods are both outdated (by trying to leverage `chkconfig`) and entirely unsued. Further, removes the `LinuxPolicy.default_runlevel()` method as it is similarly unused in sos. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [utilities] Switch locale to C.UTF-8Jake Hunsaker2022-06-241-1/+1
| | | | | | | | | | | | Changes the `LC_ALL` locale env var used for all command collections from `C` to `C.UTF-8` which should provide safer/more reliable output from non-English localizations. This is backed up by PEP-538: https://peps.python.org/pep-0538/ Closes: #2946 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [clean] Refactor handling of symlink obfuscationJake Hunsaker2022-06-242-20/+68
| | | | | | | | | | | | | | | | | | | | Previously, there was a small but not impossible situation for a race condition within `clean`'s handling of symlinks where a symlink name could be obfuscated differently than what the link's target could be obfuscated too. Fix this by handling symlinks separately than the rest of the archive, like what we do for directory names. When obfuscating files, archives will now skip over symlinks and yield file names for iteration, rather than generating and returning full file lists. Once the obfuscation of "real" files is complete, then separately iterate over symlinks. Since the file obfuscation also includes file names, this means that link targets are already known to the mappings and we eliminate the potential race condition. Closes: #2852 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sosnode] Properly pass `--namespaces` to nodesJake Hunsaker2022-06-151-0/+4
| | | | | | | | | | The `namespaces` option was presented to `sos collect`, but was not actually being passed to nodes. Fix this, and gate the usage of the option to version 4.3, or the relevant RHEL backport version like we do for `--container-runtime`. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cleaner] Allow disabling specific parsers individuallyJake Hunsaker2022-06-155-0/+100
| | | | | | | | | | | Adds a new `--disable-parsers` option that allows users to selectively disable parsers for a given execution of `sos clean`. This may be useful in specific scenarios where obfuscation is not strictly needed for all the types of data we obfuscate, and where the user trusts whomever may be receiving the archive for review. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [InitSystem] Allow toggle of default `is_running` resultJake Hunsaker2022-06-153-7/+13
| | | | | | | | | | | | | | | | | | | The base `InitSystem` used when systemd is not present (or at least functional), defaults to returning `True` for all probes, in an effort to not inadvertantly block service queries. This works well for most scenarios, however it backfires when checking for runlevel-analogous systemd targets for items such as the `cantboot` preset - in that the base `InitSystem` will always enable that preset. Fix that by allowing calls to `InitSystem.is_running()` to specify a default value to return, instead of blindly always returning `True`. Similarly, update the preset check to default to `False` to avoid improperly enabling that preset when systemd is unavailable. Closes: #2913 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [host] Add collection of "top-level" symlinks and their targetsJake Hunsaker2022-06-151-0/+11
| | | | | | | | | | | | | | | Adds collection of a `find` command that shows symlinks from /, or one subdirectory below, that lists all symlinks and their targets in `ls` output format. This is by request from a RH support team for situations where problematic systems have directories underneathe / that are solely symlinks, and this information is relevant to problem investigation. While the `host` plugin may not be the most intuitive place for this collection, there are no other existing plugins that would be "more correct", and adding a new "symlinks" plugin would likely only serve to confuse authors and maintainers going forward. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ostree] Add services enablement triggerJake Hunsaker2022-06-141-0/+1
| | | | | | | | | | | | | | Adds two services to the `services` tuple for this plugin to both serve as an enablement trigger, and to capture the status and journals of these services automatically. This is an update/replacement to #2919 originally proposed by Colin Walters. Closes: #2919 Co-authored-by: Colin Walters <walters@verbum.org> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Make forbidden path checks more efficientJake Hunsaker2022-06-084-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | Forbidden path checks have up until now worked by taking a given file path (potentially with globs), expanding that against all discovered files that actually exist on the system, and then comparing a potential collection path against that list. While this works, and works reasonably fast for most scenarios, it isn't very efficient and causes significant slow downs when a non-standard configuration is in play - e.g. thousands of block devices which sos would individually have to compare against tens of thousands of paths for every path the `block` plugin wants to collect. Improve this by first not expanding the forbidden path globs, but taking them as distinct patterns, translating from shell-style (to maintain historical precedent of using globs to specify paths to be skipped) to python regex patterns as needed. Second, use `re` to handle our pattern matching for comparison against the distinct patterns provided by a plugin to skip. Closes: #2938 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [vdsm] Set LVM option use_devicesfile=0Juan Orti Alcaine2022-06-071-1/+3
| | | | | | | | | | | | Since RHV 4.4 SP1, vdsm configures LVM to use devicesfile, causing that the LVM filter configuration used by sos is ignored. This change disables the use of the devicesfile, so that the information of the devices used for RHV storage domains can be collected. Fixes: RHBZ#2093993 Signed-off-by: Juan Orti <jortialc@redhat.com>
* [libvirt] Collect swtpm logs from host/containerBogdan Dobrelya2022-06-071-0/+2
| | | | | | | Update the libvirt plugin to collect swtpm logs from hosts, and certain containerized environments, like OpenStack TripleO Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
* [systemtap] Correct enable trigger to `commands`Jake Hunsaker2022-06-061-1/+1
| | | | | | | | | | The enablement trigger of `files` in this plugin was incorrect, and should have been `commands` given we're checking for an executable. Fix that, so that this plugin can properly enable on more than just the package names. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>