aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [report] Provide better warning about estimate-modePavel Moravec2022-01-052-4/+9
| | | | | | | | | | | | As --estimate-only calculates disk usage based on `stat` data that differs from outputs of other commands like `du`, enhance the warning about reliability of the calculated estimation. Also add a rule-of-thumb recommendation of real disk space requirements. Resolves: #2815 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [crio] Collect goroutine informationPeter Hunt2022-01-031-0/+11
| | | | | | According to instructions in https://github.com/cri-o/cri-o/blob/main/tutorials/debugging.md Signed-off-by: Peter Hunt <pehunt@redhat.com>
* [rpmostree] Improvements at rpm-ostree pluginPablo Alonso Rodriguez2021-12-221-1/+2
| | | | | | | - `rpm-ostree status` replaced with `rpm-ostree status -v` - Added `rpm-ostree kargs` output Signed-off-by: Pablo Alonso Rodriguez <palonsoro@gmail.com>
* [options] Allow spaces in --keywords values in sos.confJake Hunsaker2021-12-221-1/+4
| | | | | | | | | | | | | The `--keywords` option supports spaces to allow for obfuscated phrases, not just words. This however breaks if a phrase is added to the config file *before* a run with the phrase in the cmdline option, due to the safeguards we have for all other values that do not support spaces. Add a check in our flow for updating options from the config file to not replace illegal spaces if we're checking the `keywords` option, for which spaces are legal. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [transport] Detect retrieval failures and automatically retryJake Hunsaker2021-12-226-11/+31
| | | | | | | | | | | | | | | | If a paritcular attempt to retrieve a remote file fails, we should automatically retry that collection up to a certain point. This provides `sos collect` more resiliency for the collection of sos report archives. This change necessitates a change in how we handle the SoSNode flow for failed sos report retrievals, and as such contains minor fixes to transports to ensure that we do not incorrectly hit exceptions in error handling that were not previously possible with how we exited the SoSNode retrieval flow. Closes: #2777 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* Fix typo in word sensitive in collector and report init fileJeremy Coulombe2021-12-212-2/+2
| | | | Signed-off-by: Jeremy Coulombe <jeremy.coulombe@hotmail.fr>
* [ipmitool] Collect data for IPMI channel number 1Vikas Goel2021-12-141-3/+4
| | | | | | | | | Hardware vendors choose an IPMI channel number for BMC LAN. The current IPMI plugin is collecting data for channel 3. Dell is using channel number 3. The number is not reserved for a specific hardware vendor. It can be used by others too. Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [hostname] Fix edge case for new hosts in a known subdomainJake Hunsaker2021-12-131-4/+5
| | | | | | | | | | | | | Fixes an edge case that would cause us to at first not recognize that a given hostname string is a new host in a known subdomain, but then on the obfuscation attempt properly recognize it as such and result in an incomplete obfuscation. This was mostly triggered by specific patterns for build hosts within `sos_commands/rpm/package-data`. With this refined check, these types of matches are properly obfuscated. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] Put namespaced commands into subdirsJake Hunsaker2021-12-131-15/+12
| | | | | | | | | | | Where networking namespaces are used, there tend to be large numbers of namespaces used. This in turn results in sos running and collecting very large numbers of namespaced commands. To aid in consumability, place these collections under a subdir for the namespace under another "namespaces" subdir within the plugin directory. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [crio] Put inspect output in the containers subdirJake Hunsaker2021-12-131-2/+3
| | | | | | | | | Given the environments where crio is run, having `crictl inspect` output in the main plugin directory can be a bit overwhelming. As such, put this output into a `containers` subdir, and nest container log output in a `containers/logs/` subdir. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ocp] Skip project setup whenever oc transport is not usedJake Hunsaker2021-12-131-1/+3
| | | | | | | Fixes a corner case where we would still attempt to create a new project within the OCP cluster even if we weren't using the `oc` transport. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [foreman_proxy] Add new apache vhost logsTaft Sanders2021-12-121-0/+4
| | | | | | These were added in puppet-foreman_proxy_content commit 76e2a6 Signed-off-by: Taft Sanders <taftsanders@gmail.com>
* [rhui] New log folderTaft Sanders2021-12-121-0/+1
| | | | | | Included new log folder per Bugzilla 2030741 Signed-off-by: Taft Sanders <taftsanders@gmail.com>
* Add crio runtime and openshift_ovn pluginNadia Pinaeva2021-12-094-2/+124
| | | | | | | openshift_ovn plugin collects logs from crio containers Fix get_container_by_name function returning container_id and not name Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [Policy,collect] Prevent remote node policies from setting local PATHJake Hunsaker2021-12-095-9/+17
| | | | | | | | | | | This commit fixes an issue where policies loaded for remote nodes when using `sos collect` would override the PATH setting for the local policy, which in turn could prevent successful execution of cluster profile operations. Related: #2777 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cman] remove debugfs handling dead codePavel Moravec2021-12-081-3/+0
| | | | | | | Resolves: #2792 Closes: #2791 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [unbound] Add new plugin for Unbound DNS resolverPavel Moravec2021-12-071-0/+30
| | | | | | | | | Initial version of the plugin. Resolves: #2789 Related to: rhbz#2018228 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [sosnode] Fix removal warning when cleaning up on a local nodeJake Hunsaker2021-12-061-1/+3
| | | | | | | | | | | When `cleanup()` is called for a local node, we were generating a false warning that we couldn't remove the sos report. This removal attempt is unnecessary since local nodes moves the sos archive during collector archive creation, rather than copying it like we do for remote nodes. Closes: #2769 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] Fix setting of all options via `-a`Jake Hunsaker2021-12-061-1/+1
| | | | | | | | | | Fixes an issue where the use of `-a` would fail due to trying to iterate over the key of the plugin's options dict rather than the actual `PluginOpt` value. Closes: #2786 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [username] Improve username sourcing and remove case sensitivityJake Hunsaker2021-12-063-7/+13
| | | | | | | | | | | First, don't skip the first line of `last` output, and instead add the header from lastlog to the skip list. Additionally, add `/etc/cron.allow` and `/etc/cron.deny` as sources for usernames that might not appear in other locations in certain environments. Also, make matching and replacement case insensitive. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [hostname] Simplify case matching for domainsJake Hunsaker2021-12-061-6/+8
| | | | | | | | Instead of special handling all uppercase domain conventions, use our normal flow for obfuscation and just match the casing at the end of the sanitization routine. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [vdsm] Exclude /var/lib/vdsm/storage/transient_disksJose Castillo2021-12-061-0/+1
| | | | | | | | | | This patch adds the directory /var/lib/vdsm/storage/transient_disks to the list of forbidden paths, because it contains sensitive data (cloud-init disks) or big files. Resolves: RHBZ#2029154 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [policies] Add Rocky Linux policynazunalika2021-12-061-0/+52
| | | | | | | | Rocky Linux is an enterprise Linux distribution based on RHEL. This adds a Rocky Linux policy, which inherits the RedHatPolicy base and uses the RedHatPlugin tagging class. Signed-off-by: Louis Abel <label@rockylinux.org>
* [plugins] Update existing plugins to use a_c_o container parameterJake Hunsaker2021-12-069-69/+47
| | | | | | | | Updates plugins currently calling `fmt_container_cmd()` in their `add_cmd_output()` calls to instead use the new `container` parameter and rely on the automatic formatting. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Add container parameter for add_cmd_output()Jake Hunsaker2021-12-061-2/+14
| | | | | | | | | | | | Adds a new `container` parameter for `Plugin.add_cmd_output()`, which if set will format all commands passed to that call for execution in the specified container. `Plugin.fmt_container_cmd()` is called for this purpose, and has been modified so that if the given container does not exist, an empty string is returned instead, thus preventing execution on the host. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report,collect] Add option to control default container runtimeJake Hunsaker2021-12-035-0/+71
| | | | | | | | | | | | Adds a new `--container-runtime` option that allows users to control what default container runtime is used by plugins for container based collections, effectively overriding policy defaults. If no runtimes are active, this option is effectively ignored. If however runtimes are active, but the requested one is not, raise an exception to abort collection with an appropriate message to the user. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* Add journal logs for NetworkManager pluginNadia Pinaeva2021-12-031-0/+2
| | | | Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [collect] Catch command not found exceptions from pexpectJake Hunsaker2021-12-031-1/+5
| | | | | | | | | | When running a command that does not exist on the system, catch the resulting pexpect exception and return the proper status code rather than allowing an untrapped exception. Closes: #2768 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [clusters:ocp] fix get_nodes functionNadia Pinaeva2021-12-031-4/+4
| | | | Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [ceph_mgr] Add more data collection to ceph_mgrNikhil Kshirsagar2021-12-032-18/+45
| | | | | | | | | | | Enhance the ceph_mgr plugin to collect more data specific to mgr nodes. Also collect some additional manager data in the ceph_mon plugin. Related: #1945 Resolves: #2759 Signed-off-by: Nikhil Kshirsagar <nkshirsagar@gmail.com>
* [global] Align sysroot determination and usage across sosJake Hunsaker2021-11-3012-56/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The determination of sysroot - being automatic, user-specified, or controlled via environment variables in a container - has gotten muddied over time. This has resulted in different parts of the project; `Policy`, `Plugin`, `SoSComponent`, etc... to not always be in sync when sysroot is not `/`, thus causing varying and unexpected/unintended behavior. Fix this by only determining sysroot within `Policy()` initialization, and then using that determination across all aspects of the project that use or reference sysroot. This results in several changes: - `PackageManager()` will now (again) correctly reference host package lists when sos is run in a container. - `ContainerRuntime()` is now able to activate when sos is running in a container. - Plugins will now properly use sysroot for _all_ plugin enablement triggers. - Plugins, Policy, and SoSComponents now all reference the `self.sysroot` variable, rather than changing between `sysroot`. `_host_sysroot`, and `commons['sysroot']`. `_host_sysroot` has been removed from `Policy`. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policy] add OpenEulerPlugin into valid_subclasses for openEuler policylijingwei2021-11-301-0/+3
| | | | Signed-off-by: lijingwei <lijingwei@uniontech.com>
* [Plugin] Add tagging class for openEuler distrolijingwei2021-11-301-0/+5
| | | | Signed-off-by: lijingwei <lijingwei@uniontech.com>
* [policy] Add error message when FTP upload write failurePavel Moravec2021-11-301-1/+4
| | | | | | | | | | When (S)FTP upload fails to write the destination file, our "expect" code should detect it sooner than after timeout happens and write appropriate error message. Resolves: #2772 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [redhat] Fix broken URI to upload to customer portalPavel Moravec2021-11-301-1/+1
| | | | | | | | | Revert back the unwanted change in URI of uploading tarball to the Red Hat Customer portal. Related: #2772 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [networking] Additional interfaces info in netnsMichał Dulko2021-11-241-1/+1
| | | | | | | | This commit adds `-d` to the `ip address show` executed in each of the network namespaces on the host. This prints additonal info per each interface, the most useful probably being VLAN information. Signed-off-by: Michał Dulko <mdulko@redhat.com>
* [policies] Deal 200 return code as successPavel Moravec2021-11-241-1/+1
| | | | | | | | | | Return code 200 of POST method request must be dealt as success. Newly required due to the SFTP API change using POST. Related to: #2764 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [redhat] update SFTP API version to v2Pavel Moravec2021-11-241-5/+5
| | | | | | | | | | | Change API version from v1 to v2, which includes: - change of URL - different URI - POST method for token generation instead of GET Resolves: #2764 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [policies] strip path from SFTP upload filenamePavel Moravec2021-11-241-3/+3
| | | | | | | | | | | When case_id is not supplied, we ask SFTP server to store the uploaded file under name /var/tmp/<tarball>, which is confusing. Let remove the path from it also in case_id not supplied. Related to: #2764 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [collect] fix moved get_upload_url under Policy classPavel Moravec2021-11-241-1/+1
| | | | | | | | | SoSCollector does not further declare get_upload_url method as that was moved under Policy class(es). Resolves: #2766 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [clean, hostname] Fix unintentionally case sensitive shortname handlingJake Hunsaker2021-11-193-7/+28
| | | | | | | | It was discovered that our extra handling for shortnames was unintentionally case sensitive. Fix this to ensure that shortnames are obfuscated regardless of case in all collected text. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [clean,hostname_parser] Source /etc/hosts for obfuscationJake Hunsaker2021-11-193-4/+31
| | | | | | | | | | | | | | | | | | | | | | Up until now, our sourcing of hostnames/domains for obfuscation has been dependent upon the output of the `hostname` command. However, some scenarios have come up where sourcing `/etc/hosts` is advantageous for several reasons: First, if `hostname` output is unavailable, this provides a fallback measure. Second, `/etc/hosts` is a common place to have short names defined which would otherwise not be detected (or at the very least would result in a race condition based on where/if the short name was elsewhere able to be gleaned from an FQDN), thus leaving the potential for unobfuscated data in an archive. Due to both the nature of hostname obfuscation and the malleable syntax of `/etc/hosts`, the parsing of this file needs special handling not covered by our more generic parsing and obfuscation methods. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [nvidia]:Patch to update nvidia plugin for GPU infoMamatha Inamdar2021-11-171-2/+13
| | | | | | | | | | This patch is to update nvidia plugin to collect logs for Nvidia GPUs Signed-off-by: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com> Reported-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com> Reported-by: Yesenia Jimenez <yesenia@us.ibm.com>
* Collect "ip route cache" dataMichael Cambria2021-11-171-0/+2
| | | | Signed-off-by: Michael Cambria <mcambria@redhat.com>
* [presets] Optimise OCP preset for hundreds of network namespacesPavel Moravec2021-11-101-3/+7
| | | | | | | | | | | | | | | | | Sos report on OCP having hundreds of namespaces timeouts in networking plugin, as it collects >10 commands for each namespace. Let use a balanced approach in: - increasing network.timeout - limiting namespaces to traverse - disabling ethtool per namespace to ensure sos report successfully finish in a reasonable time, collecting rasonable amount of data. Resolves: #2754 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [report] Calculate sizes of dirs, symlinks and manifest in estimate modePavel Moravec2021-11-101-28/+28
| | | | | | | | | | | | | | | | | Enhance --estimate-mode to calculate sizes of also: - symlinks - directories themselves - manifest.json file Use os.lstat() method instead of os.stat() to properly calculate the sizes (and not destinations of symlinks, e.g.). Print five biggest plugins instead of three as sos logs and reports do stand as one "plugin" in the list, often. Resolves: #2752 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* Catch exceptions on user prompt for ENTER / Ctrl+CPavel Moravec2021-11-094-4/+11
| | | | | | | | | | | Catch unhandled EOFError in collector and cleaner. Update the behaviour in report that redundantly prints the error message twice. Resolves: #2751 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [sos] Reference TMPDIR environment variable and check fstype of tmpdirJake Hunsaker2021-11-091-4/+21
| | | | | | | | | | | | | | | | | | | | | If the `TMPDIR` env var is set, we should reference it if the user has not provided `--tmp-dir` by the cmdline or sos.conf. The order of precedence is now: 1. cmdline use of `--tmp-dir` 2. setting `tmp-dir` in `/etc/sos/sos.conf` 3. the `TMPDIR` environment variable 4. `/var/tmp` as a default Additionally, we will now check if the filesystem type for our tmpdir is tmpfs, and if so print a warning to the user about the potential pitfalls of doing so. This information is now recorded in the manifest as well. Closes: #2738 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] fix filter_namespace per patternPavel Moravec2021-11-091-8/+7
| | | | | | | | | | | | Curently, -k networking.namespace_pattern=.. is broken as the R.E. test forgets to add the namespace in case of positive match. Also ensure both plugopts namespace_pattern and namespaces work together. Resolves: #2748 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [ceph_osd] Add more data collectionNikhil Kshirsagar2021-11-081-1/+51
| | | | | | | | | Enhance the ceph_osd plugin to collect more data specific to OSD nodes. Related: #1945 Resolves: #2735 Signed-off-by: Nikhil Kshirsagar <nkshirsagar@gmail.com>