aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [python] Update import for RHELPolicyJake Hunsaker2021-01-041-2/+2
| | | | | | | | | Updates the import of `RHELPolicy` for setting the python version checking command on RHEL systems. Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [build] Add packages from policy re-orgJake Hunsaker2021-01-041-3/+5
| | | | | | | Adds the new packages to `setup.py` that were created as a result of the policy re-org from #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [boot] Add ls /sys/firmware command outputAkshay Gaikwad2021-01-041-1/+2
| | | | | | | | | | "ls /sys/firmware" command is useful to check if system boots with UEFI or BIOS. Resolves: #2353 Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph] include time-sync-status for ceph monPonnuvel Palaniyappan2021-01-041-0/+1
| | | | | | | | | | | | | Ceph mons might get into time sync problems if ntp/chrony isn't installed or configured correctly. Since Luminous release, upstream support 'time-sync-status' to detect this more easily. Closes: #2356 Resolves: #2357 Signed-off-by: Ponnuvel Palaniyappan <pponnuvel@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [DpkgPackageManager] Add subclass for dpkgJake Hunsaker2021-01-042-9/+26
| | | | | | | | | Adds a new `DpkgPackageManager` subclass for use with dpkg-based distributions. Closes: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [RpmPackageManager] Add discreet PackageManager subclassJake Hunsaker2021-01-044-20/+32
| | | | | | | | | | | | | | Adds a discreet subclass of `PackageManager` for RPM based distributions. Note this also makes a minor alteration to the determination of relevant commands based on the initialization of `PackageManager`, which will make it easier to build out subclasses going forward, while still allowing individual policies to override if desired. Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Presets] Separate Presets from policiesJake Hunsaker2021-01-044-170/+209
| | | | | | | | | | | | Moves the `PresetDefaults` base class out from `sos/policies/__init__.py` and into a new `sos/presets` subdir. Further, removes the presets defined in the RH-family policies into a new `sos/presets/redhat.py` subdir to allow for ease of maintenance and tracking. Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [PackageManager] Separate PackageManager from policiesJake Hunsaker2021-01-046-238/+253
| | | | | | | | | | | | Moves `PackageManager` out from `sos/policies/__init__.py` into a new `sos/policies/package_managers` subdir. Future commits will aim to canonicalize package manager subclasses for policies to use, and ease the creation of new reusable package managers. Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Move linux policies into new subdirJake Hunsaker2021-01-0411-533/+573
| | | | | | | | | | | Moves the actual policy files for supported distributions out of `sos/policies` and into a new subdir `sos/policies/distros`. Note that `Policy()` still lives in the former, while `LinuxPolicy()` has been moved into `sos/policies/distros/__init__.py` Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [InitSystem] Separate InitSystem from policiesJake Hunsaker2021-01-044-191/+222
| | | | | | | | | | Moves `InitSystem` and the related `SystemdInit` subclass out of `sos/policies/__init__.py` and into a new `sos/policies/init_systems/` subdir. Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ContainerRuntime] Separate runtimes from policiesJake Hunsaker2021-01-044-180/+226
| | | | | | | | | Moves `ContainerRuntime` and the related subclasses out from `sos/policies/__init__.py` into a new `sos/policies/runtimes` subdir. Related: #2349 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Policy] Allow any number of vendor urls in banner messagesJake Hunsaker2021-01-048-19/+50
| | | | | | | | | | | | | | | | | Enhances policy banner message generation by allowing an arbitrary number of vendor urls to be displayed. The `vendor_url` class attr has been changed to `vendor_urls` which should be a list of 2-tuples formatted as `(description, url)`. Further updates the existing policies to use this new form, and expands on the Red Hat family distributions to include support website locations where applicable. Also updates the Ubuntu policy to point to both the community and commercial support resources. Closes: #1869 Resolves: #2325 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redhat] Automatically failover to dropbox when RHCP upload failsJake Hunsaker2021-01-041-0/+15
| | | | | | | | | | | | | | When an upload to the RHCP fails for some reason, now automatically failover to attempt an upload to the FTP dropbox. This failover has been intended for some time, as we already failover to the FTP location if we detect we're missing, for example, login credentials for the Customer Portal. This change just extends that intention to when we run into errors with the actual upload process. Resolves: #2350 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking/ufw/firewall_tables] Split out firewall from networkingBryan Quigley2021-01-043-72/+121
| | | | | | | | | | | Drop fallback to nat as that can bring in more kernel modules Left ip/6-table save in networking for now as it can be filtered by networking options and I don't want to break that. Resolves: #2348 Signed-off-by: Bryan Quigley <code@bryanquigley.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [containers_common|podman] Gather container digestsBrad Hubbard2020-12-182-0/+2
| | | | | | | | | | It can be useful to have the digest for each container image for verifying exact binary compatibility, etc. Resolves: #2339 Signed-off-by: Brad Hubbard <bhubbard@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [component] Use sysroot from Policy when opts doesn't specify itPavel Moravec2020-12-151-2/+2
| | | | | | | | | | Until --sysroot option is specified, Archive (sub)classes should be called with sysroot determined from Policy. Resolves: #2346 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Openvswitch] Add ovs-configuration journalJuan-Luis de Sousa-Valadas Castaño2020-12-151-0/+1
| | | | | | | | | | | | OpenShift 4.6 Introduces a new service called ovs-configuration, usually this information is also acquired in the must-gather but if precisely this service is at fault we may not be able to run must-gather. Resolves: #2345 Signed-off-by: Juan Luis de Sousa-Valadas <jdesousa@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policy] Add /sbin to PATH for SuSE policy.Daria Bukharina2020-12-151-1/+1
| | | | | | | | | | | These changes fix iscsi plugin for SuSE distributions because `iscsiadm` util is placed in /sbin. Resolves: #2344 Closes: #2340 Signed-off-by: Daria Bukharina d.bukharina@yadro.com Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [subscription_manager] scrub passwords on one line onlyPavel Moravec2020-12-151-2/+2
| | | | | | | | | | | Fix regexp to scrub proxy_password on one line and don't obfuscate subsequent line when the password is empty. Closes: #2328 Resolves: #2343 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] collect broken symlinksPavel Moravec2020-12-141-6/+10
| | | | | | | | | | | | Information about broken symlink destination is useful information that sos report should collect. Currently it stops doing so as stat-ing the symlink to determine filesize fails. Closes: #2333 Resolves: #2338 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collect] Add unavailable warning to `sos collect --help`Jake Hunsaker2020-12-131-0/+23
| | | | | | | | | | | | Adds a warning message to the end of `sos collect --help` output when the `collect` component is not available due to a missing dependency or missing sub package. Closes: #2336 Resolves: #2341 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryan Quigley <code@bryanquigley.com>
* [networking] Add kmod predicate to `ufw` commandsJake Hunsaker2020-12-131-1/+5
| | | | | | | | | | | The `ufw` commands will load the `bpfilter` and `iptable_filter` kernel modules if they are not already present. As such, add a `SoSPredicate` for those kernel modules to gate collection of `ufw` commands. Related: #2326 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryan Quigley <code@bryanquigley.com>
* [lxd] Add predicate to lxd/lxc commands for network kmodsJake Hunsaker2020-12-111-3/+24
| | | | | | | | | | | The `lxd` and `lxc` commands will load a handful of networking related kernel modules if those modules are not already loaded. As such, gate running those commands from the `lxd` plugin with a proper `SoSPredicate`. Related: #2326 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [wireless] Update enablement triggers and add predicate for iw commandsJake Hunsaker2020-12-111-13/+6
| | | | | | | | | | | | | | First, update the enablement trigger to use the `commands` tuple to use a policy's defined PATH to search for the `iw` command, rather than splitting out subclasses based on the `files` tuple. Second, add a predicate that requires the `cfg80211` kmod to be loaded before running any `iw` commands, as this command will load the module if it is not already loaded. Related: #2326 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Add test for newly loaded kernel modulesJake Hunsaker2020-12-111-2/+10
| | | | | | | | | | | | | | | Adds a test to `simple.sh` to check if we loaded any new kernel modules during a normal exeuction. This test will be somewhat limited in the fact that this currently only tests the plugins that are loaded by default on each tested distribution. Also included is a minor typo fix for reporting where IP addresses were not obfuscated, if any. This typo did not affect the actual test however. Resolves: #2326 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [pmem] Updated for ipmctl v2.xSteve Scargall2020-12-111-6/+11
| | | | | | | | | | ipmctl version 2.x introduces new commands and options. It also deprecates some older commands. Resolves: #2161 Signed-off-by: Steve Scargall <steve.scargall@intel.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [options] Fix --log-size=0 being ignored and unreported otherwiseJake Hunsaker2020-12-102-1/+4
| | | | | | | | | | | | | | | | | | The `--log-size` option was being silently ignored, due to a too-loose conditional in `Component.apply_options_from_cmdline()` which was inadvertently filtering out the option when a user set it to 0. Note that this did not affect `sos.conf` settings for this same value. Similarly, reporting the effective options after preset and cmdline merging was skipping log-size when it was set to 0, since we normally want to filter out null-value options (which imply they were not invoked). Adding an explicit check for `log-size` here is the easiest route forward to allow the reporting we expect. Closes: #2334 Resolves: #2335 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [crio] collect "crio config"Pavel Moravec2020-12-101-1/+4
| | | | | | | | | | The command dumps layered configuration currently used, which sometimes supersets config files. Resolves: #2337 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collector] allow overriding plain --cluster-typePavel Moravec2020-12-091-0/+1
| | | | | | | | | | | In few user scenarios, it is useful to force sos collect to override cluster type, but let it generate list of nodes by itself. For that, it is sufficient to set the self.cluster_type accordingly. Resolves: #2331 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] Dont stop collecting by empty specfile when sizelimit=0Pavel Moravec2020-12-091-1/+1
| | | | | | | | | | When sizelimit=0, collecting an empty file would set limit_reached wrongly and stop collecting further files. Let fix this corner case. Resolves: #2330 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [fibrechannel] Add optional argument for plugin to collect debug infoDaria Bukharina2020-12-021-0/+10
| | | | | | | | | | | Add a possibility to enable collecting debug logs from vendor specific paths. To enable this feature you need to pass optional `debug` argument. Resolves: #2324 Signed-off-by: Daria Bukharina d.bukharina@yadro.com Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [apt] Move unattended-upgrades log collectionEric Desrochers2020-11-302-2/+3
| | | | | | | | | | | | | | | | Having u-u logs collection inside the apt plugin make more sense as it is using apt functionnalities and python modules such as apt, apt_inst, apt_pkg. u-u is a mechanism to automatically install security upgrades on Debian/Ubuntu. It is enabled by default at installation. Resolves: #2323 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_ceilometer] Add backend_url and transport_urlJose Castillo2020-11-301-3/+2
| | | | | | | | | | | | | | to connection keys This patch adds the password and url in backend_url and transport_url to the list of connection keys, so it gets properly masked. Related: RHBZ#1892692 Resolves: #2298 Signed-off-by: Jose Castillo <jose.mfcastillo@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos] Use parse_args() instead of parse_known_args()Jake Hunsaker2020-11-301-1/+1
| | | | | | | | | | | | | | | | | When sos-4.0 work first went in, the way we extracted cmdline args for the parser was to call `parse_known_args()` in an effort to avoid passing unknown args to subcmds that don't support those specific args. As the parsers were built out however, this became unnecessary. The default behavior of `parse_args()` is smart enough to filter out args that are not supported by the specific component being run. With this being the case, we no longer need to manually check for unknown args being passed, and with that clear a LGTM warning. Resolves: #2299 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_barbican] Add new pluginWilliam Konitzer2020-11-301-0/+54
| | | | | | | Resolves: #2315 Signed-off-by: William Konitzer <wkonitzer@mirantis.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] Align sosreport plugins with Mirantis Cloud PlatformWilliam Konitzer2020-11-3010-18/+80
| | | | | | | | | | | installation: - Update Salt/SaltMaster plugins; - Update OpenStack services plugins; - Update Keepalived as IndependentPlugin class Signed-off-by: William Konitzer <wkonitzer@mirantis.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [systemd] Add tmpfiles.d conf filesAkshay Gaikwad2020-11-301-1/+4
| | | | | | | | | systemd-tmpfiles uses these configuration files to create volatile files and directories. These configurations needs to gathered by sosreport for analyzing what tmpfiles rule are included. Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [readme] Update badgingJake Hunsaker2020-11-231-2/+2
| | | | | | | Update the build badge for the repo README to point to Cirrus-CI instead of Travis now that we've switched CI platforms. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] Remove superfluous if/out_ns and re-indent per-ns codeMauricio Faria de Oliveira2020-11-231-46/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split this into its own commit as it's mostly indentation changes. From: ``` if self.g_n_n(): out_ns = self.g_n_n(<filters>) for namespace in out_ns: ... if self.get_option('ethtool_namespaces'): for namespace in out_ns: ... ``` To: ``` for namespace in self.g_n_n(<filters>): ... if self.get_option('ethtool_namespaces'): for namespace in self.g_n_n(<filters>): ... ``` Resolves: #2308 Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin,networking] Move namespace filtering to get_network_namespaces()Mauricio Faria de Oliveira2020-11-232-27/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy the logic over from the networking plugin to `filter_namespaces()`, which is generic, taking any list of namespaces; and then wrap it in `get_network_namespaces()` for the particular network namespace type. Now other plugins may be able to filter namespaces as well, and not only network namespaces, but other types that may be added (which can get convenience wrappers `get_X_namespaces()` then.) In order to make the review simpler, the changes for the networking plugin are intentionally small (keep the optional `if self.g_n_n():` and only filter in `out_ns` which is used in `ethtool_namespaces`.) The next patch addresses that, with the larger indentation changes. Testing with the networking plugins' options to filter namespaces by a regex pattern, and limit by the number: ``` $ ip netns ns3 ns2 ns1 ``` Option `networking.namespace_pattern` (only namespaces with trailing 2): ``` $ sudo ./bin/sos report -o networking \ -k networking.namespace_pattern='.*2' --batch $ find sosreport-*/sos_commands/networking \ | cut -d/ -f2- | grep ip_netns_exec sos_commands/networking/ip_netns_exec_ns2_iptables-save sos_commands/networking/ip_netns_exec_ns2_ip_-s_-s_neigh_show sos_commands/networking/ip_netns_exec_ns2_ip_address_show sos_commands/networking/ip_netns_exec_ns2_ip_route_show_table_all sos_commands/networking/ip_netns_exec_ns2_ethtool_-i_lo sos_commands/networking/ip_netns_exec_ns2_ethtool_-k_lo sos_commands/networking/ip_netns_exec_ns2_ethtool_-S_lo sos_commands/networking/ip_netns_exec_ns2_ethtool_lo sos_commands/networking/ip_netns_exec_ns2_ip6tables-save sos_commands/networking/ip_netns_exec_ns2_netstat_-W_-agn sos_commands/networking/ip_netns_exec_ns2_netstat_-W_-neopa sos_commands/networking/ip_netns_exec_ns2_ip_rule_list sos_commands/networking/ip_netns_exec_ns2_netstat_-s ``` Option `networking.namespaces` (only one namespace): ``` $ sudo ./bin/sos report -o networking \ -k networking.namespaces=1 --batch $ grep 'Limiting namespace iteration' sosreport-*/sos_logs/sos.log 2020-11-18 22:48:00,263 WARNING: [plugin:networking] \ Limiting namespace iteration to first 1 namespaces found $ find sosreport-*/sos_commands/networking \ | cut -d/ -f2- | grep ip_netns_exec sos_commands/networking/ip_netns_exec_ns3_ethtool_-i_lo sos_commands/networking/ip_netns_exec_ns3_ip_rule_list sos_commands/networking/ip_netns_exec_ns3_ip_route_show_table_all sos_commands/networking/ip_netns_exec_ns3_netstat_-W_-neopa sos_commands/networking/ip_netns_exec_ns3_netstat_-s sos_commands/networking/ip_netns_exec_ns3_ethtool_-k_lo sos_commands/networking/ip_netns_exec_ns3_netstat_-W_-agn sos_commands/networking/ip_netns_exec_ns3_iptables-save sos_commands/networking/ip_netns_exec_ns3_ip_address_show sos_commands/networking/ip_netns_exec_ns3_ip_-s_-s_neigh_show sos_commands/networking/ip_netns_exec_ns3_ip6tables-save sos_commands/networking/ip_netns_exec_ns3_ethtool_-S_lo sos_commands/networking/ip_netns_exec_ns3_ethtool_lo ``` Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report,conntrack,ebpf,networking] Introduce get_network_namespaces()Mauricio Faria de Oliveira2020-11-235-41/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Put the list of network namespaces in `commons['namespaces']['network']` as with eg, existing block devices in `commons['devices']['block']`. Then provide the shortcut function `get_network_namespaces()` for such. And convert the conntrack/ebpf/networking plugins to use it, which deduplicates their code and simplifies the plugins per-ns handling. ``` $ ip netns ns3 ns2 ns1 $ sudo python3 >>> from sos import SoS >>> from sos.report.plugins import Plugin >>> >>> sos = SoS(['report']) >>> plugin = Plugin(sos._component.get_commons()) >>> plugin.commons['namespaces']['network'] ['ns3', 'ns2', 'ns1'] >>> plugin.commons['devices']['block'] ['loop1', 'vdb', 'vda', ...] ``` The contents of the `sos_commands/{contrack,ebpf,networking}` directories are identical before/after this patch (no changes). Before and After: ``` $ sudo ./bin/sos report -o conntrack,ebpf,networking --batch ``` Compare: ``` $ find sosreport-<OLD>/sos_commands/ | cut -d/ -f2- | sort \ > find-sosreport.old $ find sosreport-<NEW>/sos_commands/ | cut -d/ -f2- | sort \ > find-sosreport.new $ diff find-sosreport.{old,new} $ $ md5sum find-sosreport.{old,new} 6fb6d8db55b4bc7197de3c65358c3576 find-sosreport.old 6fb6d8db55b4bc7197de3c65358c3576 find-sosreport.new ``` For reference, listing the commands run for `ns1`: ``` $ find sosreport-sos-g-2020-11-18-ryrcztt/sos_commands/ \ | cut -d/ -f2- | grep ns1 sos_commands/networking/ip_netns_exec_ns1_ip_rule_list sos_commands/networking/ip_netns_exec_ns1_netstat_-W_-neopa sos_commands/networking/ip_netns_exec_ns1_netstat_-s sos_commands/networking/ip_netns_exec_ns1_iptables-save sos_commands/networking/ip_netns_exec_ns1_ip_address_show sos_commands/networking/ip_netns_exec_ns1_ethtool_lo sos_commands/networking/ip_netns_exec_ns1_ip_route_show_table_all sos_commands/networking/ip_netns_exec_ns1_netstat_-W_-agn sos_commands/networking/ip_netns_exec_ns1_ip6tables-save sos_commands/networking/ip_netns_exec_ns1_ip_-s_-s_neigh_show sos_commands/networking/ip_netns_exec_ns1_ethtool_-i_lo sos_commands/networking/ip_netns_exec_ns1_ethtool_-k_lo sos_commands/networking/ip_netns_exec_ns1_ethtool_-S_lo sos_commands/conntrack/ip_netns_exec_ns1_conntrack_-S sos_commands/conntrack/ip_netns_exec_ns1_conntrack_-L_-o_extended sos_commands/ebpf/ip_netns_exec_ns1_bpftool_net_list ``` Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [conntrack] gather per-namespace dataMauricio Faria de Oliveira2020-11-231-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run conntrack commands per-namespace, as the ebpf/networking plugins: Test-case: ``` # ip netns ns3 ns2 ns1 ``` Before: ``` # ./bin/sos report -o conntrack,ebpf,networking --batch # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec .../sos_commands/ebpf/ip_netns_exec_ns1_bpftool_net_list .../sos_commands/ebpf/ip_netns_exec_ns2_bpftool_net_list .../sos_commands/ebpf/ip_netns_exec_ns3_bpftool_net_list ... .../sos_commands/networking/ip_netns_exec_ns1_ip_address_show ... .../sos_commands/networking/ip_netns_exec_ns2_ip_address_show ... .../sos_commands/networking/ip_netns_exec_ns3_ip_address_show ... ``` After: ``` # ./bin/sos report -o conntrack,ebpf,networking --batch # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec .../sos_commands/conntrack/ip_netns_exec_ns1_conntrack_-L_-o_extended .../sos_commands/conntrack/ip_netns_exec_ns1_conntrack_-S .../sos_commands/conntrack/ip_netns_exec_ns2_conntrack_-L_-o_extended .../sos_commands/conntrack/ip_netns_exec_ns2_conntrack_-S .../sos_commands/conntrack/ip_netns_exec_ns3_conntrack_-L_-o_extended .../sos_commands/conntrack/ip_netns_exec_ns3_conntrack_-S .../sos_commands/ebpf/ip_netns_exec_ns1_bpftool_net_list .../sos_commands/ebpf/ip_netns_exec_ns2_bpftool_net_list .../sos_commands/ebpf/ip_netns_exec_ns3_bpftool_net_list ... .../sos_commands/networking/ip_netns_exec_ns1_ip_address_show ... .../sos_commands/networking/ip_netns_exec_ns2_ip_address_show ... .../sos_commands/networking/ip_netns_exec_ns3_ip_address_show ... ``` Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] Ignore stderr from ip netns for list of namespacesMauricio Faria de Oliveira2020-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sosreport of a system with this issue: ``` # ip netns Error: Peer netns reference is invalid. Error: Peer netns reference is invalid. test-ns ``` Shows that the networking plugin runs commands for the `Error:` lines: (note the ebpf plugin does not due to differences addressed in PR #2306) ``` # ./bin/sos report -o ebpf,networking --batch # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec .../sos_commands/ebpf/ip_netns_exec_test-ns_bpftool_net_list .../sos_commands/networking/ip_netns_exec_Error_ip6tables-save .../sos_commands/networking/ip_netns_exec_Error_ip6tables-save.1 ... .../sos_commands/networking/ip_netns_exec_test-ns_ip6tables-save ... ``` This happens because the networking plugin calls `collect_cmd_output()` with default `stderr=True` and does not handle such line type. For the purposes of getting the list of network namespaces, it is OK to ignore `stderr` since it does not provide that information. However, we do want it in the archive, so it is fully documented for analysis/debug. So change the call from `collect_cmd_output()` to `add_cmd_output()` to include both `stdout` and `stderr` in the archive, and call `exec_cmd()` that ignores `stderr` to get the list of network namespaces. Note that the plugin _currently_ does not need `exec_cmd(stderr=False)` to ignore `stderr`, as described in PR#2306, but will once/if that is applied. However, with the next patch, `stderr=False` won't be needed. Before: ``` # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec .../sos_commands/ebpf/ip_netns_exec_test-ns_bpftool_net_list .../sos_commands/networking/ip_netns_exec_Error_ip6tables-save .../sos_commands/networking/ip_netns_exec_Error_ip6tables-save.1 ... .../sos_commands/networking/ip_netns_exec_test-ns_ip6tables-save ... ``` After: ``` # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec .../sos_commands/ebpf/ip_netns_exec_test-ns_bpftool_net_list .../sos_commands/networking/ip_netns_exec_test-ns_ip6tables-save .../sos_commands/networking/ip_netns_exec_test-ns_ip_-s_-s_neigh_show ... ``` And the `ip netns` contents with `stderr` still remain in the archive: ``` # tar xf /tmp/sosreport-*.tar.xz --to-stdout \ --wildcards '*/sos_commands/networking/ip_netns' Error: Peer netns reference is invalid. Error: Peer netns reference is invalid. test-ns ``` Test suite: ``` # ./tests/simple.sh ... Everything worked! ``` Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [grub2] Stylistic cleanup for grub2-mkconfig callsJake Hunsaker2020-11-231-4/+2
| | | | | | | | | | Small stylistic cleanups for the `grub2-mkconfig` environment variable settings and command formatting. Closes: #1070 Resolves: #2317 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Add method to get all containers matching a regexJake Hunsaker2020-11-231-0/+18
| | | | | | | | | | | | Adds a new method, `Plugin.get_all_containers_by_regex()`, that will return all known containers on the system with a name matching a provided regex string. Optionally, this method may also return terminated containers in addition to those that are active and running. Closes: #2176 Resolves: #2319 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redhat] Add podman to valid container env varsJake Hunsaker2020-11-231-1/+1
| | | | | | | | | | | In newer versions of podman, the `container` env var set inside the container will be set to `podman` instead of `oci`. Add this value to the list of valid values to use to determine if sos is running inside a container or not, for when we want to capture from the host system. Resolves: #2320 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* add lang files to sos.specPavel Moravec2020-11-231-1/+1
| | | | | | | | | | Fix packit/copr build failures by adding lang files to sos.spec Closes: #2318 Resolves: #2321 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [flake8] Fix minor indentation issueJake Hunsaker2020-11-191-1/+1
| | | | | | Resolve a minor indentation issue. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cleaner] Simplify MAC addr parsing from #2311Jake Hunsaker2020-11-191-6/+13
| | | | | | | | | | | | | | | | | The previously merged #2311 was thought to be sufficient for remaining cases where MAC addrs were followed by punctuation characters, however it was found to be too restrictive in that it would leave quoted and other forms of MAC addrs unobfuscated when those addrs were immediately followed by other characters. Simply the regex match to catch all of these, and further update the `parse_lines()` override to properly trim down the match to just the address substring. Related: #2311 Related: #2305 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [travis] Drop testing via TravisJake Hunsaker2020-11-191-65/+0
| | | | | | | | | | | We are dropping the use of Travis for our CI testing, and moving to Cirrus-CI. Resolves: #2305 Closes: #2246 Closes: #2048 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>