aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [sos] Fix typo in po filesJose Castillo2022-05-0479-79/+79
| | | | | | | There was a missing space between two words in one of the strings in all po files. Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [report] --list-plugins should report used, not default, option valuesJake Hunsaker2022-05-041-7/+15
| | | | | | | | | | | | | | When using `--list-plugins`, sos should report the values that will be used in a given command, or with a given config file, not what the default values are. By reporting the set value, users can be sure their configuration or commandline settings are being honored correctly before executing a report collection. Closes: #2921 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [fibrechannel] collect Cisco fnic statisticsPavel Moravec2022-05-041-1/+2
| | | | | | | | | Collect /sys/kernel/debug/fnic statistics about Cisco UCS fibre channel fNIC connection. Resolves: #2926 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [scsi.py] Updated scsi plugin to collect more informationBhushan Kale2022-05-031-1/+8
| | | | | | Now collecting ses page 2 information of scsi devices using sg_ses command Signed-off-by: Bhushan Kale bhushanskale@hotmail.com
* [utilities] Close file only when storing to filePavel Moravec2022-05-031-1/+2
| | | | | | | | Call _output.close() only when to_file=true. Closes: #2925 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pacemaker,corosync] Collect rotated logsJake Hunsaker2022-04-282-3/+4
| | | | | | | | Modifies the collection specs for pacemaker and corosync logs to also include rotated copies. Additionally add collections of `pengine` files for pacemaker. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin,Policy] Make a base tagging class, minor docstring fixesJake Hunsaker2022-04-282-44/+71
| | | | | | | | | | | | | | | | Fixing the sphinx documentation warnings with the previous commit unearthed a few inconsistencies with the docstrings for various bits of `Plugin()` and `Policy()`. Fix those so that docs can be properly formatted and cross-reference each other. Related to this, add a new `PluginDistroTag` base class that tagging classes will now subclass. At the moment, this only serves to enhance the generate docs however this may prove useful in the future if we ever want to leverage these taggings classes more directly. Closes: #2917 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [docs] Correct automodule definitions for sphinx docsJake Hunsaker2022-04-287-6/+12
| | | | | | | | | | | | | | | | | Building sphinx docs was generating warnings for several locations about sphinx being unable to reference certain classes. This was found to be due to the `automodule` definitions for each section including the `:noindex:` setting. Removing this configuration resolved the vast majority of cross-referencing warnings that sphinx would report on during a build of the docs. Note that a single warning will remain, referencing threading.Thread, after this change. Closes: #2917 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Simplify flow in _container_init()Jake Hunsaker2022-04-261-7/+9
| | | | | | | | | Simplifies the logic and flow of `LinuxPolicy._container_init()` so that it is both easier to follow and less prone to edge cases that could break in-container collections that are not setup to capture from the host system. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report,collect] Add env var and prompt options for encryptionJake Hunsaker2022-04-264-0/+86
| | | | | | | | | | | | | | | Adds a new `--encrypt` option that may be used in place of the existing encrypt-related options. If used alongside `--batch`, this new option will cause sos to set encryption options based on the `SOSENCRYPTKEY` or `SOSENCRYPTPASS` environment variables. This allows users to leverage this functionality without potentially leaking the values into `ps`-like output inside the archive. If `--batch` is not used, then this option prompts the user to select the type of method to use and then provide the value in-line, or to use the env var option. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugin/ceph_mon]: collect crush hierarchy infoPonnuvel Palaniyappan2022-04-221-1/+2
| | | | Signed-off-by: Ponnuvel Palaniyappan <pponnuvel@gmail.com>
* [rpm] Capture directory listing for /var/lib/rpmJake Hunsaker2022-04-221-0/+1
| | | | | | Adds collection of directory listing output for `/var/lib/rpm`. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [seagate_ses] Add new plugin to get Seagate JBOD statusNikhil Kakade2022-04-221-0/+65
| | | | | | | SES Monitoring tool "getstatus" is used to information of Seagate storage products. Signed-off-by: Nikhil Kakade <nikhilkaka1@gmail.com>
* [Plugin] Don't tail binary files for `add_copy_spec()`Jake Hunsaker2022-04-122-14/+8
| | | | | | | | | When a file collection will reach its sizelimit, don't tail the file if it has binary content, as this will be useless collection. Closes: #2851 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [utilities] Better detect binary files with python3-magicJake Hunsaker2022-04-126-30/+41
| | | | | | | | | | Adds a new `file_is_binary()` method to `sos.utilities` to serve as a single point to determine if a file is binary or not, relying on the python3-magic module. Closes: #2839 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cirrus] Update CentOS Stream 8 image, add Stream 9 testingJake Hunsaker2022-04-121-6/+16
| | | | | | | Updates the CentOS Stream 8 image used to run the CI tests, and adds testing on CentOS Stream 9 now that those images are available. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ocp, openshift] Re-align API collection options and rename optionJake Hunsaker2022-04-082-21/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in #2888, the `openshift` plugin was extended to allow API collections by using a default-available kubeconfig file rather than relying on user-provided tokens. This also included flipping the default value of the `no-oc` plugin option to `True` (meaning do not collect API output by default). This worked for the plugin, but it introduced a gap in `sos collect` whereby the cluster profile could no longer reliably enable API collections when trying to leverage the new functionality of not requiring a user token. Fix this by updating the cluster profile to align with the new default-off approach of API collections. Along with this, add a toggle to the cluster profile directly to allow users to toggle API collections on or off (default off) directly. This is done via a new `with-api` cluster option (e.g. `-c ocp.with-api`). Further, rename the `openshift` plugin option from `no-oc` to `with-api`. This change not only makes the option use case far more obvious, it will also align the use of the option to both `collect` and `report` so that users need only be aware of a single option for either method. The cluster profile also has logic to detect which plugin option, `no-oc` or `with-api` to use based on the (RHEL) sos version installed on the nodes being inspected by the `ocp` cluster profile. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [dnf,yum] Merge plugins into dnf, remove yum pluginJake Hunsaker2022-04-072-138/+47
| | | | | | | | | | | | | | | | | | | | | | | `dnf` has long been the successor to `yum` for RPM based distributions, with the latter remaining as a legacy feature. In fact, in most cases `yum` is now simply a symlink to `dnf`. As such, merge missing collections from `yum` into the `dnf` plugin where appropriate, and then remove the `yum` plugin. Collections still referencing yum locations, such as `/etc/yum.repos.d/` that are still used by `dnf` are brought forward and retain their `yum_*` tags in the manifest in addition to new `dnf_*` tags. The `history` plugin option has been removed and this is now a default collection - previously it was gated to avoid duplication with the `yum` plugin. The `history-info` option has also been slightly changed to only capture the last 50 transactions instead of potentially up to hundreds retained by `dnf`. Closes: #1954 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* Use --force-pull-image option for pods created with oc.Nadia Pinaeva2022-04-074-15/+32
| | | | | | | Set --force-pull-image=True by default, can be turned off with --force-pull-image=False Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* Use /etc/os-release instead of /etc/redhat-release as the mostNadia Pinaeva2022-04-061-3/+2
| | | | | | compatible way to find host release Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [presets] Adjust OCP preset optionsJake Hunsaker2022-04-061-4/+9
| | | | | | | | | | | | | | Adjust the options used by the 'ocp' preset to better reflect the current collection needs and approach. This includes disabling the `cgroups` plugin due to the large amount of mostly irrelevant data captured due to the high number of containers present on OCP nodes, ensuring the `--container-runtime` option is set to `crio` to align container-based collections, disabling HTML report generation and increasing the base log size rather than blindly enabling all-logs. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [candlepin] collect information about SCAJan Jansky2022-04-051-0/+7
| | | | | | | | | | This change should start to collecting information about SCA enablement per organization. Resolves: #2901 Related: RHBZ2060925 Signed-off-by: Jan Jansky <jjansky@redhat.com>
* Add one more container for plugin enablementNadia Pinaeva2022-04-011-1/+1
| | | | Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [clusters] Allow clusters to not add localhost to node listJake Hunsaker2022-03-283-1/+7
| | | | | | | | | | | | | | | | | | | For most of our supported clusters, we end up needing to add the local host executing `sos collect` to the node list (unless `--no-local` is used) as that accounts for the primary node that may otherwise be left off. However, this is not helpful for clusters that may reports node names as something other than resolveable names. In those cases, such as with pacemaker, adding the local hostname may result in duplicate collections. Add a toggle to cluster profiles via a new `strict_node_list` class attr that, if True, will skip this addition. This toggle is default `False` to preserve existing behavior, and is now enabled for `pacemaker` specifically. Related: RHBZ#2065821 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [pacemaker] Redesign node enumeration logicJake Hunsaker2022-03-281-34/+76
| | | | | | | | | | | | | | | | | It has been found that `pcs status` output is liable to change, which ends up breaking our parsing of node lists when using it on newer versions. Instead, first try to parse through `crm_mon` output, which is what `pcs status` uses under the hood, but as a stable and reliable xml format. Failing that, for example if the `--primary` node is not functioning as part of the cluster, source `/etc/corosync/corosync.conf` instead. Related: RHBZ2065805 Related: RHBZ2065811 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openshift] Adding ability to use the localhost.kubeconfig and KUBECONFIG ↵Vladislav Walek2022-03-281-2/+43
| | | | | | env to use system:admin Signed-off-by: Vladislav Walek <22072258+vwalek@users.noreply.github.com>
* [sar] Limit sar conversion by age, remove shell encapsulationJake Hunsaker2022-03-251-2/+41
| | | | | | | | | | | | | | | | | | | The conversion of 'saX' binary data to human-readable 'sar' format is typically handled by sysstat on the host system when a new day rolls over the previous 'saX' file. As such, there should generally only be one day (the current day's data) that needs manual conversion. For this reason, limit our calling of 'sar' to files that have not been converted already _and_ are less than a week old, to avoid spending time converting very old files that are likely not useful. Further, remove the shell encapsulation of the sar command. Finally, add a docstring description of the plugin for `sos help` output. Closes: #1741 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [archive] Dont obfuscate tmpdir path of final archivePavel Moravec2022-03-251-3/+6
| | | | | | | | | | | | | When renaming the sosreport directory (inside the /var/tmp/sos.* working directory), apply cleaner obfuscation to the sosreport directory but not to the working directory path. This is achieved by proper setting of FileCacheArchive._name that should have the relative directory name only without the leading path. Resolves: #2887 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [cleaner] Dont obfuscate tmpdir path of local private_mapPavel Moravec2022-03-251-2/+3
| | | | | | | | | | When writing down a private_map file local to a sosreport, do cleanup of its filename but not its leading path (like /var/tmp/). Relevant: #2887 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [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>