aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [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>
* [plugins] Update a few common plugins for new help outputJake Hunsaker2022-01-254-2/+67
| | | | | | | | | | | | | Updates four common plugins to provide several examples of how to format plugin documentation so that the new `help` component is able to provide useful information on them. Going forward, new plugins should include docstrings to provide this help information as part of the initial review process. Existing plugins will be updated as time allows or as plugins are updated and/or refactored. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos] Add 'help' component for enhanced help informationJake Hunsaker2022-01-2514-25/+982
| | | | | | | | | | | | | | | | | | | | | This commit marks the beginning of the addition of a new `help` component for sos, which will be used to display more in-depth help information surrounding all the different components of sos. The command is intended to be invoked with a specific help topic in mind, that mirrors our project layout. E.G. to get help on the report component, a user would use `sos help report`, whereas to get help on a specific plugin a user would use `sos help report.plugins.$plugin`. This first commit includes both the initial framework for the `help` component, as well as updating `SoSReport` and `Plugin` to provide a basic implementation for the new subcommand. Additionally, `Policy` is given a basic framework for existing policies to report certain default values as well as available presets. A stub section is provided for the base `RedHatPolicy` to serve as a redirector for the actually used policies that subclass it. Closes: #2205
* [mac_parser] Skip parsing of modinfo outputJake Hunsaker2022-01-251-0/+3
| | | | | | | | Skip parsing of modinfo output by the mac parser, as this can lead to numerous false positive matches and unhelpfully obfuscate the signature of modules. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cleaner] Update regex for finding IPv4/v6 addressesNikhil Kakade2022-01-251-2/+2
| | | | | | | | | | | | | The regex trys to match a single character not present in the given list [^:|-]. The string which starts with addresses are left out as there is no character to match. Adding ? to matches the previous token between zero and one time. Resolves Issue: #2829 Signed-off-by: Nikhil Kakade <nikhilkaka5@outlook.com>
* [foreman] Use psql-msgpack-decode wrapper for dynflow >= 1.6Pavel Moravec2022-01-251-4/+12
| | | | | | | | | | | In dynflow >=1.6.3, dynflow* tables in postgres are encoded by msgpack which makes plain CSV dumps unreadable. In such a case, psql-msgpack-decode wrapper tool from dynflow-utils (of any version) must be used instead of the plain psql command. Resolves: #2830 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [systemd] Collect systemctl list-units --allKir Kolyshkin2022-01-181-0/+1
| | | | | | | | | | | | | Systemd has a hard limit of units that it can keep, and the limit is 128K. Once that limit is hit (which is usually happening due to various bugs), systemd returns E2BIG ("Argument list too long") when trying to start a new unit. Until recently, it was not possible to figure out what is going on without looking at the "systemctl list-units --all" output. That's why it's nice to have it in sos report. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
* [clean] Ignore empty items for obfuscation betterJake Hunsaker2022-01-173-3/+6
| | | | | | | | | | This commit fixes a couple edge cases where an item empty (e.g. and empty string '') was not being properly ignored, which in turned caused failures in writing both obfuscations and replacement files. This should no longer be possible. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [virsh] Call virsh commands in the foreground / with a TTYPavel Moravec2022-01-171-5/+9
| | | | | | | | | | | | In some virsh errors (like unable to connect to a hypervisor), the tool requires to communicate to TTY otherwise it can get stuck (when called via Popen with a timeout). Calling it on foreground prevents the stuck / waiting on cmd timeout. Resolves: #2825 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [report] pass foreground argument to collect_cmd_outputPavel Moravec2022-01-171-3/+9
| | | | | | Related to: #2825 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [clean,parsers] Build regex lists for static items only onceJake Hunsaker2022-01-175-11/+38
| | | | | | | | | | | | | | | | | | For parsers such as the username and keyword parsers, we don't discover new items through parsing archives - these parsers use static lists determined before we begin the actual obfuscation process. As such, we can build a list of regexes for these static items once, and then reference those regexes during execution, rather than rebuilding the regex for each of these items for every obfuscation. For use cases where hundreds of items, e.g. hundreds of usernames, are being obfuscated this results in a significant performance increase. Individual per-file gains are minor - fractions of a second - however these gains build up over the course of the hundreds to thousands of files a typical archive can be expected to contain. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [vmware] collect vmware timesync statusPavel Moravec2022-01-131-1/+2
| | | | | | | | | It displays information whether VMware time sync is enabled, which affects how ntpd/chronyd works. Resolves: #2824 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [storcli] Fix show events commandMahesh Potkar2022-01-131-1/+8
| | | | | | | | | | | Adapter information is not showing in /call show events command because it requires file=<filename> as a parameter e.g. /opt/MegaRAID/storcli/storcli64 /call show events file=storcli64_.call_show_events Signed-off-by: Mahesh Potkar <maheshpotkar@gmail.com>
* [Plugin] Wrap add_service_status to add_cmd_outputJake Hunsaker2022-01-121-2/+2
| | | | | | | | | | | | | The changes to allow writing command output to a file highlighted a short coming in add_service_status - by wrapping to `_add_cmd_output()` instead of `add_cmd_output()`, we are not applying the default values for kwarg parameters and thus potentially causing undesired behavior during the actual collection. Fix this by wrapping to `add_cmd_output()`, which will then in turn call `_add_cmd_output()`. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Allow writing command output directly to diskJake Hunsaker2022-01-124-40/+123
| | | | | | | | | | | | | | | | | | This commit addresses a long standing ask in sos, regarding resource consumption when sos is run with `--all-logs`. For executions where `--all-logs` is used, or for specific commands where `sizelimit` has been set to 0, `add_cmd_output()` and `add_journal()` will now instruct `sos_get_command_output()` to write output directly to a file rather than saving the output in memory. When this occurs, the `output` key in the returned dict will be empty. Note that this does extend to `collect_cmd_output()` or `exec_cmd()`. Resolves: #1506 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [dellrac] Add new pluginVikas Goel2022-01-111-0/+43
| | | | | Dell Remote Access Controller information and support data for Dell hardware Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [perccli] Add new pluginVikas Goel2022-01-101-0/+58
| | | | | | | PowerEdge RAID Controller management https://www.dell.com/support/kbdoc/en-us/000177280/how-to-use-the-poweredge-raid-controller-perc-command-line-interface-cli-utility-to-manage-your-raid-controller Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [collector] Cleanup cluster only if definedPavel Moravec2022-01-101-1/+2
| | | | | | | | | In case cluster init fails, self.cluster = None and its cleanup must be skipped. Resolves: #2822 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [collect] Deal None sos_version properlyPavel Moravec2022-01-101-1/+2
| | | | | | | | | | | In case collector cluster hits an error during init, sos_version is None what LooseVersion can't compare properly and raises exception 'LooseVersion' object has no attribute 'version' Related: #2822 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [utilities] Restrict when commands are checked for wildcardsBryan Quigley2022-01-071-4/+7
| | | | | | | Arguments that start with / and must contain a * are the only ones that get checked if they can be expanded. Signed-off-by: Bryan Quigley <code@bryanquigley.com>
* [cleaner] Add skips for known files and usernamesJake Hunsaker2022-01-073-1/+5
| | | | | | | | | | Adds skips for `/proc/kallsyms` which should never be obfuscated, as well as any packaging-related log file for the IP parser. Further, do not obfuscate the `stack` users, as that is a well-known user for many configurations that, if obfuscated, could result in undesired string substitutions in normal logging. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cleaner] Improve parser-specific file skippingJake Hunsaker2022-01-071-3/+14
| | | | | | | | | This commit improves our handling of skipping files on a per-parser basis, by first filtering the list of parsers that `obfuscate_line()` will iterate over by the parser's `skip_file` class attr, rather than relying on higher-level checks. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [hostname] Fix loading and detection of long base domainsJake Hunsaker2022-01-071-1/+8
| | | | | | | | | | | | | | Our domain matching has up to now assumed that users would be providing 'base' domains such as 'example.com' whereby something like 'foo.bar.example.com' is a subdomain (or host) within that base domain. However, the use case exists to provide 'foo.bar.example.com' as the base domain, without wanting to obfuscate 'example.com' directly. This commit fixes our handling of both loading these longer domains and doing the 'domain is part of a domain we want to obfuscate' check. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cirrus,tests] Update testing matrix to Fedora 35Jake Hunsaker2022-01-061-2/+3
| | | | | | | | | | | | | | F35 has been out for a bit, we should update our testing matrix accordingly. New images have been pushed to GCP, so this change updates Cirrus to use those new images. Note this adds installation of pip to Fedora test VMs as well rather than baking that into the images. Ethtool is now also explicitly installed. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] Enhance ss_pred by xsk_diag kmodPavel Moravec2022-01-051-1/+1
| | | | | | | | | | 'ss -peaonmi' does require also xsk_diag kmod that must be added to the list of kmod predicates of the ss command. Resolves: #2818 Related: #2816 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [tests] Do not remove temp dirs from failed CI test runsJake Hunsaker2022-01-052-3/+6
| | | | | | | | | | | | In the event a CI test execution fails before the archive is created, for any reason, we want to preserve the temp directory as the logs there are still useful. As such, add a specific env var to our test runs via avocado. Then, when we detect a failure check for that env var to determine if we should in fact do our cleanup or not. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_mds] Collect mds specific data in ceph_mdsNikhil Kshirsagar2022-01-051-1/+50
| | | | | | | | | | Enhance the ceph_mds plugin to collect data specific to mds nodes. Related: #1945 Resolves: #2800 Signed-off-by: Nikhil Kshirsagar <nkshirsagar@gmail.com>
* Add cluster cleanup for all exit() callsNadia Pinaeva2022-01-051-2/+1
| | | | Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
* [system] Collect glibc tuning decisionsPavel Moravec2022-01-051-0/+7
| | | | | | Resolves: #2812 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [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>