aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [Plugin] Allow plugins to define default command environment varsJake Hunsaker2022-03-254-2/+140
| | | | | | | | | | | Adds the ability for plugins to define a default set of environment vars to pass to all commands executed by the plugin. This may be done either via the new `set_default_cmd_environment()` or `add_default_cmd_environment()` methods. The former will override any previously set values, whereas the latter will add/update/modify any existing values. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collect] Correct `self.primary` to NoneType defaultJake Hunsaker2022-03-241-2/+2
| | | | | | | | | | Corrects the initial assignment of `self.primary` to `None` instead of `False`, so that quick scanning over the code is more inline with `Cluster` instances. Closes: #2892 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_nova] Collect containerized metadata logsBogdan Dobrelya2022-03-241-32/+28
| | | | | | Update the openstack plugin to collect nova metadata logs Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
* [scsi] Add collection of SCSI persistent reserve commandsJake Hunsaker2022-03-221-0/+18
| | | | | | | | | | Adds collection of various `sq_persist` and `sg_inq` commands to the `scsi` plugin for scsi block devices on the host system. Also adds a docstring description to the plugin to assist with `sos help` output. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cgroups] not collect memory.kmem.slabinfoJan Jansky2022-03-221-0/+3
| | | | | | | | | | Forbid collection of memory.kmem.slabinfo which in case of system with lot of containers may cause stuck kworker. Resolves: #2889 Signed-off-by: Jan Jansky <jjansky@redhat.com>
* [ceph_mon] Obfuscate sensitive config keysJake Hunsaker2022-03-171-0/+13
| | | | | | | | | Adds a `postproc()` to the `ceph_mon` plugin to obfuscate sensitive configuration keys printed by the `ceph config-key dump` command. Closes: #2885 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* Improve sos collect for OCP:Nadia Pinaeva2022-03-172-1/+10
| | | | | | | | | | | | 1. wait for sos tmp project to be deleted (just calling delete changes project state to Terminating, and running a new sos collect is not possible before this project is fully deleted) 2. use --retries flag to copy sos reports from the nodes more reliably. The flag has been recently added to kubectl, and the most reliable way to check if it's available or not is to check command error output for "unknown flag" substring Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [md] Restrict data capture to raid membersJose Castillo2022-03-171-2/+7
| | | | | | | | | | | | | | | | When generating sos report, md-raid plugin won't capture the metadata information from the actual RAID device. Also, it tries to fetch metadata information for all block devices available in the system. Sometimes RAID is created using the disk partition, but sos won't collect metadata from those devices. This patch takes the list of raid members from lsblk, and captures the output only for these devices. Resolves: RHBZ#2062283 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [distros] Pass --upload-directory to SFTP uploadsPavel Moravec2022-03-172-2/+7
| | | | | | Resolves: #2880 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* Add ovs datapath and groups collection commandsNadia Pinaeva2022-03-152-0/+7
| | | | | | Add ct-zone-list command for openshift-ovn Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [distros] Fix broken upload due to 1bcb449Pavel Moravec2022-03-141-1/+1
| | | | | | | | | | Commit 1bcb449 needs to be enhanced to test if self.upload_url has been already set. Otherwise, 'NoneType' object has no attribute 'startswith' is raised. Resolves: #2879 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [mac_parser] Match quoted mac addresses, fix duplication checkJake Hunsaker2022-03-142-8/+38
| | | | | | | | | | | | | First, update the regexes to account for possible quotes wrapping the mac address to match. Second, fix an edge case with these quoted mac addresses in our check for avoiding duplicating obfuscations of already obfuscated addresses by checking the stripped mac address instead of the raw one. Closes: #2873 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_mon] Replace an obsolete commandPonnuvel Palaniyappan2022-03-143-9/+34
| | | | | | | | | | mon_status command is no longer available since Octopus release. Replaced it with its ceph tell equivalent that works in both older as well as newer Ceph releases. [ceph_osd/mgr] Improve the method to locate the daemon's IDs. Signed-off-by: Ponnuvel Palaniyappan <pponnuvel@gmail.com>
* [tigervnc] Update collections for newer versions of TigerVNCJake Hunsaker2022-03-141-5/+23
| | | | | | | | | | | | | First, relaxes the file specifications for collection by capturing the entire `/etc/tigervnc/` directory. Second, adds collection of service status and journal output for each configured vnc server. Collection of `vncserver -list` is kept for backwards compatibility. Finally, add a short docstring for the plugin for --help output. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collectl] New collectl pluginJose Castillo2022-03-101-0/+28
| | | | | | | | | collectl is a tool that helps gather performance data and perform benchmarks and monitoring of the systems' health. The plugin captures the configuration file and the logs in /var/log/collectl/ Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [Plugins] Adjust paths for containerized setupMatthias Runge2022-03-093-4/+20
| | | | | | | | | Red Hat OpenStack uses a container based setup, log files are found under /var/log/containers/<service>. Config files are located under /var/lib/config-data/puppet-generated/ Signed-off-by: Matthias Runge <mrunge@redhat.com>
* [tests] Add a test for non-default plugin_timeout complianceJake Hunsaker2022-03-022-1/+27
| | | | | | | | | | | | | | | | | | | | There was a gap in our testing that allows #2863 to escape our notice - that a `Plugin()`'s `plugin_timeout` attribute would be ignored if it wasn't set to `TIMEOUT_DEFAULT`. As that was resolved by #2864, add a test to ensure it remains working as expected. The expected resolution order for a plugin's whole timeout is as follows: 1. The value set by `-k plugin.timeout` 2. The value set by `--plugin-timeout` 3. The value hardcoded in the plugin via the `plugin_timeout` attr 4. `TIMEOUT_DEFAULT` Related: #2863 Related: #2864 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [smartcard] List p11-kit modulesJakub Jelen2022-03-021-1/+3
| | | | Signed-off-by: Jakub Jelen <jjelen@redhat.com>
* [smartcard] Add more related packagesJakub Jelen2022-03-021-1/+3
| | | | | | add a note that the pam_pkcs11 is only available in RHEL7 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
* [redhat] Honour credential-less --upload-url on RedHat distro properlyPavel Moravec2022-03-011-1/+2
| | | | | | | | | | | When missing some credentials, do overwrite upload_url to the Red Hat SFTP server *only* when upload-url points to the Customer Portal API server. Resolves: #2869 Closes: #2870 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [cleaner] Use compiled regex lists for parsers by defaultJake Hunsaker2022-02-2810-86/+129
| | | | | | | | | | | | | | | | | | This commit follows the initial change made to the username and keyword parsers in #2823 and applies it to all parsers by default. When a new match is found, a new `regex.Pattern()` object will now be compiled and saved in the parser's map, and this object will be used for ongoing obfuscations from that point forward, rather than rebuilding regexes for every line we iterate over with that parser. This is now built into the base `SoSMap` and leveraged by parsers, rather than being handled directly by parsers. Further, this will be enabled by default for all existing and new parsers. This shows decent improvements to hostname parser performance in local testing. Note that this functionality is explicitly disabled for the mac and ip parsers. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sosnode] Handle downstream versioning for runtime option checkJake Hunsaker2022-02-221-9/+51
| | | | | | | | | | | | | | First, adds parsing and formatting for an sos installation's release version according to the loaded package manager for that node. Adds a fallback version check for 4.2-13 for RHEL downstreams that backport the `container-runtime` option into sos-4.2. Carry this in upstream to account for use cases where a workstation used to run `collect` from may be from a different stream than those used by cluster nodes. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] list VRFsAntoine Tenart2022-02-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add command listing VRFs and their associated tables; including in network namespaces. This information could be retrieved from reading the `ip -d address show` output, but it is hard to see quickly. As the `ip vrf show` output is quite small, let's include it. If the system has two VRFs, the output will look like: Name Table ----------------------- vrf0 42 vrf1 43 And if no VRF is defined the output will look like: Name Table ----------------------- No VRF has been configured Signed-off-by: Antoine Tenart <atenart@kernel.org>
* [networking] consistently list the routing policy rulesAntoine Tenart2022-02-171-3/+4
| | | | | | | | | | | | The commands used to list the routing policy rules were inconsistent: - The IPv6 routing policy rules were not retrieved in namespaces. - The command used were inconsistent in the file (it's only cosmetic, but making it consistent helps maintenance). Fix this. Signed-off-by: Antoine Tenart <atenart@kernel.org>
* [report] Honor plugins' hardcoded plugin_timeoutPavel Moravec2022-02-171-1/+4
| | | | | | | | | | | | | | Currently, plugin's plugin_timeout hardcoded default is superseded by whatever --plugin-timeout value, even when this option is not used and we eval it to TIMEOUT_DEFAULT. In this case of not setting --plugin-timeout either -k plugin.timeout, honour plugin's plugin_timeout instead. Resolves: #2863 Closes: #2864 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pulpcore] Stop collecting commands relevant to old taskig systemPavel Moravec2022-02-171-5/+0
| | | | | | | | | | | The reserved resource approach was used by pulp-3 for a sporadic time in early pulp-3 development only. It is abandoned and should not be productised anywhere. So it is safe to remove the commands (together with rq broker status that was in charge of reserved resources). Resolves: #2865 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [ovn_central] Rename container responsable of Red Hat ovn_central pluginFernando Royo2022-02-171-11/+12
| | | | | | | | | | ovn_central plugin is running by container with name 'ovn-dbs-bundle*', a typo has been identified and this cause plugin ovn_central not enabled by default as it does not recognize any container responsible of this. This patch fix this container name match, searching schema db keeping backward compatibility with openvswitch.
* [runtimes] Allow container IDs to be used with `container_exists()`Jake Hunsaker2022-02-162-3/+20
| | | | | | | | | | | | | | As container runtimes can interchange container names and container IDs, sos should also allow the use of container IDs when checking for the presence of a given container. In particular, this change unblocks the use of `Plugin.exec_cmd()` when used in conjunction with `Plugin.get_container_by_name()` to pick a container based on a provided regex that the container name may match. Related: #2856 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [setup] Add sos-help to build processPavel Moravec2022-02-161-2/+3
| | | | | | | Resolves: #2860 Closes: #2861 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [man] Mention sos-help in main sos manpagePavel Moravec2022-02-161-0/+8
| | | | | | Related to #2860 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [host] Skip entire /etc/sos/cleaner directoryJake Hunsaker2022-02-151-1/+1
| | | | | | | | | | | While `default_mapping` is typically the only file expected under `/etc/sos/cleaner/` it is possible for other mapping files (such as backups) to appear there. Make the `add_forbidden_path()` spec here target the entire cleaner directory to avoid ever capturing these map files. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [build] Bump version to 4.34.3Jake Hunsaker2022-02-143-4/+4
| | | | Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] Remove useless inclusion of tempfile_util in commonsJake Hunsaker2022-02-141-2/+1
| | | | | | | | | | | | | An early implementation of #2729 included expanding `TempFileUtil` and passing it as a means to create temp files to write command output directly to. That approach was abandoned in favor of a more robust implementation, but the cleanup of the previous design was apparently not complete. Fix this by removing the inclusion of tempfile_util in our `commons` dict. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [utilities] Don't try to chroot to /Jake Hunsaker2022-02-141-1/+1
| | | | | | | | | | With the recent fix for sysroot being `None` to always being (correctly) `/`, we should guard against situations where `sos_get_command_output()` would now try to chroot to `/` before running any command. Incidentally, this would also cause our unittests to fail if they were run by a non-root user. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [foreman-installer] collect foreman-maintain config and storage dataPavel Moravec2022-02-141-0/+2
| | | | | | | | | | data.yml keeps status of foreman-maintain activitis in progress. foreman_maintain.yml contains foreman-maintain config. Resolves: #2847 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [avocado] Pin avocado test suite to version 94Jake Hunsaker2022-02-111-1/+1
| | | | | | | | | | | The latest release of avocado-framework, 95.0, makes several changes that will require us to investigate moving to the newer nrunner test-runner. For the moment, pin our CI tests to a previous version so that the changes in newer avocado versions don't block current development. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Set fallback to None sysrootPavel Moravec2022-02-091-1/+1
| | | | | | | | | | 9596473 commit added a regression allowing to set sysroot to None when running sos report on a regular system (outside a container). In such a case, we need to fallback to '/' sysroot. Resolves: #2846 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [dellrac] ensure the logpath directory existsPavel Moravec2022-02-081-1/+7
| | | | | | | | | | Due to the runat=logpath argument, we must ensure the logpath directory is created. Also catch properly the case when the directory has been created before. Resolves: #2845 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [libvirt] Collect containerized logsBogdan Dobrelya2022-02-071-1/+6
| | | | | | | | | Update the libvirt plugin to collect logs from /var/log/containers, which may be populated in certain environments, like OpenStack TripleO This is an addition to #1130 where a couple of things got missed Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
* [hostname] Reduce false positive matchesJake Hunsaker2022-02-071-7/+8
| | | | | | | | | | | | | This commit aims to reduce false-positive matches by the hostname parser/map. Do this by first removing a too-broad substring check that is better covered by a simpler check in the `_domains` internal dict, made possible by the previous change which explicitly checks without the tld as part of the domain string. Second, improve the set of extensions to strip from potential matches that would otherwise be regarded as TLDs, but are in fact not TLDs. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ovn-central] collect NB/SB ovsdb-server cluster statusHemanth Nakkina2022-02-071-1/+12
| | | | | | | | | Add commands to collect cluster status of Northbound and Southbound ovsdb servers. Resolves: #2840 Signed-off-by: Hemanth Nakkina hemanth.nakkina@canonical.com
* [mac_parser] Avoid substring matches with look-behindsJake Hunsaker2022-02-071-5/+13
| | | | | | | | | This commit adds a negative look-behind to the regex patterns for mac addresses so we avoid matching substrings from both non-mac-address strings, certain ipv6 address strings, and longer strings of hextets that we could potentially match a substring of. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [discovery] Add new discovery pluginJose Castillo2022-02-071-0/+31
| | | | | | | | | | | This commit creates as new plugin for the discovery tool. This tool is an inspection and reporting tool, designed to find, identify, and report environment data. Fixes: RHBZ#2018549 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [Plugin] Add container-based command collections in manifestJake Hunsaker2022-01-311-2/+39
| | | | | | | | | | | | | | Following the previous commit of adding a `containers` key to a Plugin's manifest entry, we will now make an entry in the relevant `containers` entry for commands executed in containers. Additionally, we will make a symlink from the relevant `sos_containers/` path to the collection under `sos_commands/$plugin/`. This should allow for easier spot analysis of a container by providing a kind of "micro sos report" for each container collections happen from under the `sos_containers/` top level directory. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Add support for containers to `add_copy_spec()`Jake Hunsaker2022-01-314-29/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the ability for `add_copy_spec()` to copy files from containers running on the host via a supported container runtime. `add_copy_spec()` now has a `container` parameter which, if set, will generate the command needed to copy a file from a container to our temp directory. This will be collected after host files but before command collection. Runtimes have been updated with a `get_copy_command()` method that will return the command string needed to copy a given file from a given container to a given path on the host. Note that the `crio` runtime does not currently provide a copy mechanism like `docker` or `podman`, so file collections from containers will not be succesful on hosts using that as their default runtime. Finally, the manifest entries for plugins have been updated with a new `containers` dict field whose entries are container names that have been collected from. Those fields are also dicts having the same `files` and `commands` keys/content as those in the plugin entry directly. Closes: #2439 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [snapcraft] Update snapcraft.yamlArif Ali2022-01-291-3/+3
| | | | | | | | After testing directly from snapcraft server, there was an issue wrt classic snaps and paths. This update resolved this particular issue Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [virsh] Catch parsing exceptionPavel Moravec2022-01-261-1/+5
| | | | | | | | | In case virsh output is malformed or missing 'Name' otherwise, catch parsing exception and continue in next for loop iteration. Resolves: #2836 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [ovn_central] Account for Red Hat ovn package namingDaniel Alvarez Sanchez2022-01-252-2/+2
| | | | | | | | | | | | Previous ovn packages were 'ovn2xxx' and now they have been renamed to 'ovn-2xxx'. This causes sos tool to not recognize that the packages are installed and it won't collect the relevant data. This patch is changing the match to be compatible with the previous and newer naming conventions. Signed-off-by: Daniel Alvarez Sanchez <dalvarez@redhat.com>
* [collect] Update docstrings for collect for help commandJake Hunsaker2022-01-258-16/+114
| | | | | | | | | | | Updates the docstrings for collect components for the new `help` command, including minor formatting changes to make the help output more human-friendly. This includes docstring updates and changes to transports and cluster profiles. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies, redhat] Add docstring text for RH policies for sos helpJake Hunsaker2022-01-252-1/+59
| | | | | | | Adds helpful documentation to the docstrings for various Red Hat policies to provide more information via the new `sos help` command. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>