aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [unpackaged] deal with recursive loop of symlinks properlyPavel Moravec2021-08-311-2/+3
| | | | | | | | | | When the plugin processes a recursive loop of symlinks, it currently hangs in an infinite loop trying to follow the symlinks. Use pathlib.Path.resolve() method to return the target directly. Resolves: #2664 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [processor] Apply sizelimit to /sys/devices/system/cpu/cpuXPavel Moravec2021-08-301-1/+8
| | | | | | | | | | | | Copy /sys/devices/system/cpu/cpuX with separately applied sizelimit. This is required for systems with tens/hundreds of CPUs where the cumulative directory size exceeds 25MB or even 100MB. Resolves: #2639 Closes: #2665 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [omnipath_client] Ensure opacapture runs only with allow-system-changesJose Castillo2021-08-301-2/+7
| | | | | | | | | | | | | | | | | | | | While omnipath_client plugin is collecting "opacapture", `depmod -a` command is executed to regenerates some files under /usr/lib/modules/$kernel. modules.dep modules.dep.bin modules.devname modules.softdep modules.symbols modules.symbols.bin This patch ensures that the command is only run when the option --allow-system-changes is used. Fixes: RHBZ#1998433 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [openvswitch] Get userspace datapath implementationsKevin Traynor2021-08-301-1/+7
| | | | | | | | | OVS has options for the userspace datapath so certain functionality can use implementations based on SIMD instructions if available. Add some commands which show the implementations available and used. Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
* [ssh] Include info about ~/.ssh folders of users.Maciej Strzelczyk2021-08-301-0/+33
| | | | | | | | | | | The SSH demon will not accept connection for users whose `.ssh` forlders don't have proper permissions set. This change makes the ssh plugin to list (ls -laZ) the `~/.ssh` folders of all users found in the system. Closes #2658 Signed-off-by: Maciej Strzelczyk <strzelczyk@google.com>
* [udisks] New udisks pluginJose Castillo2021-08-301-0/+30
| | | | | | | | | | | This new plugin captures the udisks config in: /etc/udisks/ And status and object dump via udisksctl command. Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [plugins] Update existing plugin options to new classJake Hunsaker2021-08-3067-247/+313
| | | | | | | Updates all existing plugin options to use the new `PluginOpt` class introduced in the previous commit. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Make plugin options their own classJake Hunsaker2021-08-305-117/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now plugin options were defined via tuples, with positional significance of the tuple elements. This made plugin option creation fairly easy, but option handling could easily become confusing. Instead, create a new `PluginOpt` class that plugin options from here on out will need to build from in order to function. These will still be applied to plugins by inserting them into the `option_list` class attr in order to retain an easy way to expand plugin options for authors. Internally, options are now assigned to a dict which is then directly accessed for plugin option manipulations. PluginOpt default values are retained separate from their current value, and elements are assigned directly to meaningful identifiers within the class. This should alleviate some of the overhead when handling plugin options within sos. Not all current tuple elements have been carried over into the new `PluginOpt` class - for example, the 'speed' attribute has been dropped as it does not have a current function. In the planned `sos info` component, the time effects of a plugin option should be documented in the `long_desc` attribute instead. Additionally, the `Plugin.get_option_as_list()` method has been removed as it was not being used anywhere. Note that this particular commit only introduces the new class, and the loading options used by `SoSReport()`. As such, plugins using options currently will report errors during test runs. A commit following this one will shuffle existing plugin options into the new class structure and allow the plugins to execute normally. Resolves: #274 Resolves: #452 Resolves: #1597 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [rabbitmq] Capture Erlang crash dump from RabbitMQTakashi Kajinami2021-08-261-0/+7
| | | | | | | | | | When RabbitMQ process crashes, it sometimes generates erl_crash.dump in its log directory. This file is is useful to understand the cause. This change ensures that file is captured in sosreport even without --all-logs. Signed-off-by: Takashi Kajinami <tkajinam@redhat.com>
* [unpackaged] Limit package_manager file list to relevant pathsJake Hunsaker2021-08-251-5/+8
| | | | | | | | | | | | | | | | Since the `unpackaged` plugin looks for all files within $PATH, we should in turn limit the list of files returned by the package manager that we're comparing against to the same paths. Otherwise, we are iterating over a needlessly large list of packaged files outside of the filesystem paths that we actually care about. On systems with a large number of installed packages, this can result in a packaged file list that is smaller by tens or even hundreds of thousands of entries and in turn results in a much faster `setup()` time for the plugin. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collect] Remove double prompt for case IDJake Hunsaker2021-08-231-5/+0
| | | | | | | | Remove the case ID prompt within `collect`, since the one from `Policy` will always apply. This avoids a double prompt for a case ID if the user does not originally provide one. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Ceph] Add support for containerized Ceph setupTeoman ONAY2021-08-231-4/+37
| | | | | | | RH Ceph 4 can either be installed as RPM or as containers. The changes permits to collect the ceph config on both kind of setup. Signed-off-by: Teoman ONAY <tonay@redhat.com>
* [collect,docs] Drop `--master` and update internal referencesJake Hunsaker2021-08-2315-122/+102
| | | | | | | | | | | | | | | | This commit follows up on the previous changes from #2555 by fully dropping the `--master` option in favor of `--primary`, `--manager`, and `--controller`. Internal references have been updated as well, using the term `primary` across all instances. Note that within OCP cluster profile, 'primary' labeling and option setting still relies on the 'master' label/role reported by the environment, as that remains the term used to identify such nodes. Resolves: #2329 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Update Cirrus testing for Foreman 2.5Jake Hunsaker2021-08-231-7/+5
| | | | | | | | | | | | | Updates the Foreman tests to use new images created for Foreman 2.5. Additionally, adds an option to the prep script to prevent new Debian release suite changes from causing the prep scripts to abort the tests. For out purposes, suite changes are not important during test runs as these images are built on known versions. Resolves: #2656 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] add openeuler policy supportlijingwei2021-08-201-0/+40
| | | | Signed-off-by: lijingwei <lijingwei@uniontech.com>
* [pylint] Drop pylintrcJake Hunsaker2021-08-191-354/+0
| | | | | | Drops the pylintrc file from the repo, as it has been unused for years. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sapnw] Add condition for length of fields varJan Jansky2021-08-161-0/+2
| | | | | | | | | | For better complexity of code i am proposing check for len(fields) >= 7 as we later in code getting fields[7] values. Resolves: #2647 Signed-off-by: Jan Jansky <jjansky@redhat.com>
* [build] Bump version to 4.24.2Jake Hunsaker2021-08-163-4/+7
| | | | | | This commit marks the relase of sos-4.2 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sapnw] Fix IndexError exceptionJose Castillo2021-08-121-1/+2
| | | | | | | | | | | | | | | | This patch solves the situation where the command: /usr/sap/hostctrl/exe/saphostctrl -function ListInstances returns: No instances found And a non-zero return code. Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [sosnode] Fix passing of plugin options when using `--only-plugins`Jake Hunsaker2021-08-112-19/+20
| | | | | | | | | | | | | Fixes the handling of plugin options passed by `sos collect` to each node by first aligning the SoSOption name to those of `report` (`plugopts`), and second re-arranges the handling of plugin options and preset options passed by the user when also using `--only-plugins` so that the former are preserved and passed only with the `--only-plugins` option value. Resolves: #2641 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos] Read config section for clean when `--clean` is usedJake Hunsaker2021-08-115-0/+72
| | | | | | | | | | | | | | | | When a `report` or `collect` run would use `--clean` or `--mask` to do in-line obfuscation of collected reports, sos would not read the config section for clean - it would only be read if `sos clean` was called directly. As such, users would need to manually specify config file values for each run. Alleviate this gap by reading the config section for `clean` if either of the cleaner options are used. Do this before we apply cmdline options so that we maintain our order of precedence. Related: RHBZ#1950350 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_instack] Capture yaml files to define overridesTakashi Kajinami2021-08-101-1/+17
| | | | | | | | | | | | | Currently TripleO supports using additional yaml files to define resource overrides. - hieradata_override - net_config_override Because these files are useful when checking configurations in an undercloud node, this change makes sosreport capture these yaml files. The undercloud.conf file is parsed to look up these yaml files. Signed-off-by: Takashi Kajinami <tkajinam@redhat.com>
* [tests] Allow entire test classes to be distro specificJake Hunsaker2021-08-101-0/+21
| | | | | | | | | | | | | | Previously new test cases had to be written in such a way that they could be run on any supported distribution, even if their individual tests were all marked for specific distributions. Use of the distro-only decorators would fail when applied to test cases as a whole due to how test instantiation errors are handled. To address this, provide a distro check within `BaseSoSTest` so that tests can be made distro-specific and we can signal to avocado to skip all tests within that test case without failing the test suite entirely. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [opencontrail] adds a plugin for opencontrailmcriswell2021-08-041-0/+40
| | | | Signed-off-by: Matt Criswell <mcriswell@mirantis.com>
* [tests] Add test for cleaning and existing archiveJake Hunsaker2021-08-044-25/+110
| | | | | | | | | | | | | | | | Adds a test that ensures we are properly extracting and cleaning an already existing archive (one is being included under tests/test_data/ now), much the same as we test for a proper `sos report --clean` run. As part of this, some aspects of the `full_report_run.py` test are moved into the base test classes, and the new `existing_archive.py` test will explicitly run `sos clean` instead of `sos report`. The included archive for obfuscation testing is taken from a stock Fedora 34 VM with a known configuration which is reflected in the items being tested for. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cleaner] Use a nested ProcessPoolExecutor for extractionJake Hunsaker2021-08-041-5/+19
| | | | | | | | | | | | | | | | | | | | This commit inserts a nested ProcessPoolExecutor into the extraction workflow for archives that are being obfuscated by `sos clean`. Previously, the extraction was handled inside the same thread as the rest of the obfuscation routines for each archive. However, it has been found that when very large archives are manipulated concurrently, performance can take a massive hit during the extraction process. This is due to GIL limitations. In this aspect 'very large archives' implies many tens of thousands of files - e.g. 50K+. Because TarFile uses a 10K internal buffer, we end up spinning a lot of time processing each file via the interpreter. By shunting each extraction off into a new process space, we can avoid the GIL issues altogether. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [rhui] Update the plugin on several placesPavel Moravec2021-08-041-8/+6
| | | | | | | | | | | - obfuscate "rhui_manager_password: xxx" in /root/.rhui/answers.yaml* - no need to collect or obfuscate anything from /etc/ansible/facts.d - newly detect the plugin via /etc/rhui/rhui-tools.conf file or rhui-manager command (only) Resolves: #2637 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pulp] adding obfuscation of proxy_password inbvassova2021-08-031-2/+2
| | | | | | | | /etc/pulp/server/plugins.conf.d/ Resolves: #2564 Signed-off-by: Barbora Vassova bvassova@redhat.com
* [storcli] Add 'json' option collecting data in JSON format.Vikas Goel2021-08-031-4/+11
| | | | Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [report] Fix display of default values in --list for magic valuesJake Hunsaker2021-08-023-14/+21
| | | | | | | | | | | | | | | | | | | | | When plugin options use a magic value as a placeholder for logic checks used during collections, those magic values can be confusing to users when reported via `--list`. This was originally limited to the timeout-related options, and was mitigated by a note in the option description. However, this approach is not maintainable as more plugin options implement magic values to allow complex determination of what the actual value should be during an execution - for example, with the new `--namespaces` option and plugin options allowing users to override that global value. Fix the former by implementing a `TIMEOUT_DEFAULT` constant. Fix the latter by reassigning the internal magic value from `None` to the implied value of `0`. Related: #2547 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [conntrack|ebpf] Add 'namespaces' plugin optionJake Hunsaker2021-08-022-3/+14
| | | | | | | | | | Adds plugin options to the `conntrack` and `ebpf` plugins to limit the number of namespaces they will iterate over, allowing plugin specific options to override the global `--namespaces` option. Resolves: #2547 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos|options] Add global 'namespaces' optionJake Hunsaker2021-08-026-11/+35
| | | | | | | | | | | | | | | Adds a global `--namespaces` option that can be used to limit the number of namespaces all plugins will iterate over. If a plugin provides a specific plugin option, such as the `networking.namespaces` option, then if set that plugin option will override the global option value. The global option defaults to not limiting namespaces, matching current behavior. Closes: #2092 Resolves: #2547 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] collect 'ethtool -m'Pavel Moravec2021-07-301-20/+12
| | | | | | | | | Alongside of that, unify list of collected ethtool short options with list of tags added. Resolves: #2634 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [username parser] Load usernames from `last` for LDAP usersJake Hunsaker2021-07-303-22/+42
| | | | | | | | | | | | | | | | | | AD/LDAP users are not reported into `lastlog` generally, however they are reported in `last`. Conversely, `last` does not report local users who have not logged in but still exist. In order to obfuscate both kinds of users, we need to look at both sources. For this, first allow parsers to specify multiple prep files. Second, update the username parser to search through all `lastlog` collections as well as the `last` collection. Also includes a small update to the username parser's prep loading logic to ensure we are iterating over each username discovered only once. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [smclient] Add SANtricity storage device (NetApp) supportVikas Goel2021-07-301-0/+61
| | | | Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [ipmitool] Include channel, raw, and lan information.Vikas Goel2021-07-301-0/+8
| | | | Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [storcli] Add LSI MegaRAID device supportVikas Goel2021-07-301-0/+44
| | | | Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [qaucli] Add QLogic plugin supportVikas Goel2021-07-301-0/+41
| | | | Signed-off-by: Vikas Goel <vikas.goel@gmail.com>
* [build,tests] Include .po files for manual builds, add cirrus testJake Hunsaker2021-07-292-0/+15
| | | | | | | | | | | First, adds a MANIFEST.in file for distutils to reference, so that we can easily ensure that the .po files are included in any manual build from the git checkout. Second, add a cirrus task to ensure that basic rpm builds from the git checkout can be done by the user. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sar] Capture all formats of sar filesJose Castillo2021-07-291-18/+14
| | | | | | | | | | | Currently, the plugin captures only files with the format saDD. If an user enables the option -D, the format changes to saYYYYMMDD. By using this regex, we gather both formats while ignoring .xz files and other non-sar files. Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [policies] add uniontech server os policy supportliugang2021-07-291-0/+40
| | | | Signed-off-by: liugang <liuganga@uniontech.com>
* [cleaner] Read map file only once for parsersJake Hunsaker2021-07-298-36/+28
| | | | | | | | | | Instead of re-reading the mapping file for each parser, read it once and store the contents, then hand those contents over to each parser. This allows us to side-step handling the same exception for malformed config files over and over for each parser loaded. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [lgtm] Suppress false positive alertsJake Hunsaker2021-07-282-3/+7
| | | | | | | | | | | | | Adds an alert suppression for 2 LGTM.com alerts. First, one involving the overriding of `load_options()` when we're initializing the placeholder component for `collect` on systems that do not have the proper support for it. Second, an alert about logging sensitive data when we are reporting the temporary anonymous user used to leverage the RH SFTP server when the user does not provide credentials. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [packit] Update packit configurationJake Hunsaker2021-07-271-1/+7
| | | | | | | Updates the packit configuration to enable GH comment notifications, as well as expand the architectures the COPR RPMs are built for. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] use Avocado "recursive" behavior by defaultCleber Rosa2021-07-271-2/+0
| | | | | | | | | | | | | | Avocado will, by default, use the "recursive" behavior when looking for tests. It means that the class hierarchy will be crawled recursively, until, for "avocado-instrumented" tests, the top-most parent "avocado.Test" is found. When the "enable" behavior is activated, it forces the class to be considered one containing avocado-instrumented tests, but, it disables the recursive behavior and only the tests local to that specific class are found. Signed-off-by: Cleber Rosa <crosa@redhat.com>
* [MigrationResults] collect info about conversions and upgradesPavel Moravec2021-07-261-0/+21
| | | | | | | | | | | | A new tiny plugin independent on leapp and convert2rhel is proposed. It should collect /etc/migration-results with info about RHEL conversions and upgrades, whenever the file is present. Resolves: #2627 Relevant to: rhbz#1959598 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [report] Improve logging skipped commands during dry runPavel Moravec2021-07-261-1/+7
| | | | | | | | | | | Set default value for the attribute 'changes' when_add_cmd_output is called without that argument. Further, add reason to "skipped command" log due to --dry-run. Resolves: #2626 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [build] Remove old libxml2 dependencyJake Hunsaker2021-07-261-1/+0
| | | | | | | Removes an old dependency on python-libxml2 that has not been required for some time. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] Add collection for OVS datapathsJake Hunsaker2021-07-221-1/+5
| | | | | | | | | | | Updates PR#1820 to bring in additional command collection for the openvswitch plugin. Note that the `ovs-appctl` command added in that original PR is not brought forward, as subsequent changes since that PR have added an iterative collection of that command. Resolves: #1820 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Add foreman_proxy and foreman_installer testsPavel Moravec2021-07-221-0/+26
| | | | | | | | | | | Add tests checking independence of foreman_* plugins on the "main" foreman plugin. Add the two plugins to the list of expectedly enabled on a tfm instance. Relevant: #2546 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>