aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [Makefile] Make makefile working after the reorgPavel Moravec2020-06-027-8/+78
| | | | | | | | | | Since reorganization of sosreport directory tree for 4.0 preparation, Makefie stopped working. Let apply the reorg to also here. Resolves: #2096 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [component|collect|report] Add metadata collectionJake Hunsaker2020-05-298-25/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds facilities to capture metadata information about a particular sos run, and save it to any resulting archive as `manifest.json`. This manifest will include component-specific information that should assist in analysis of sos runs. For `report`, this is an extension of existing reporting functionality, that records information on a per-plugin basis regarding command output and file collection. However, more information is recorded in this collection than the JSON or HTML reporting structures that review a finished archive. Manifest data is added at the time of collection; for commands this includes a breakout of command, parameters, full execution syntax, filepath relative to archive root, and the actual return code of the command, even if non-zero. For files, the copied files are grouped by the specification set in `add_copy_spec()` calls, I.E. for any file pattern regex that collects at least one file, all files collected by that regex are listed. Additionally, this adds a `tags` parameter to `add_copy_spec()`, `add_cmd_output()`, and `collect_cmd_output()` that if used will add tagging information to the manifest entries for those collections. This is intended to assist in future sos work (E.G. `sos examine`) and third party utilities in identifying relevant/connected data that is present in the archive. Note that all collections specified by a single call to any of these collection methods will inherit the same tags. For `collect` we now record the cluster type, node list, and a separate entry for each node in the node list that includes the sos version, node sos policy, and the archive within the collect tarball that was collected for that host. Closes: #1990 Resolves: #2050 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [archive] Drop bzip2Bryan Quigley2020-05-266-12/+8
| | | | | | | | | | | | | | | | | | This just leaves xz with gzip as the automatic backup. Bzip2 took the most time by far and only does marginally better than gzip. time 27 Size 10.72MiB --batch -z xz --log-size 1 time 27 Size 16.32MiB --batch -z gzip --log-size 1 time 40 Size 14.17MiB --batch -z bzip2 --log-size 1 time 43 Size 105.21MiB --batch -z xz --all-logs time 64 Size 187.38MiB --batch -z gzip --all-logs time 135 Size 182.86MiB --batch -z bzip2 --all-logs Resolves: #2053 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] poll dpdk status from ifaces and portsAaron Conole2020-05-261-0/+10
| | | | | | | | | | | It's possible that a deployment is using ovs-bonds rather than dpdk bond ports. In that case, it's required to pull the iface information as well. Resolves: #2051 Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] pull cfm, qos, and bond infoAaron Conole2020-05-261-0/+8
| | | | | | | | The connectivity fault mgmt, qos and bond data can all be retrieved on a per-port basis. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] Add LACP statsAaron Conole2020-05-261-0/+1
| | | | | Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] List important dpdk related directoriesAaron Conole2020-05-261-1/+4
| | | | | | | | Sometimes the permissions or selinux attributes are modified in an unexpected way. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] ensure -t 5 for ovs-vsctl where neededAaron Conole2020-05-261-4/+4
| | | | | | | | | Most instances of ovs-vsctl were run without a previous check. If the vswitchd is in a hung state, the command may never timeout. Ensure that most places are using the timeout option. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] capture all datapath dataAaron Conole2020-05-261-12/+15
| | | | | | | | | | | | | | | This includes flows, ct stats, frag stats, and conntrack information for all of the datapath types that are active. Additionally, pull the tunnel information for datapaths. Stop using 'ovs-dpctl' in favor of 'ovs-appctl dpctl/*' - for multiple reasons. The 'ovs-dpctl' command doesn't support the userspace datapath. 'ovs-dpctl' cannot pull all attribute types (including type=offloaded) in newer OVS versions. Also, the default attribute type is 'all' so adding type=offloaded is redundant. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] pull additional bridge informationAaron Conole2020-05-261-1/+4
| | | | | | | | Pulls additional flow stats, features, forwarding information and mac layer information. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] add support for OpenFlow 1.4 and 1.5Aaron Conole2020-05-261-1/+3
| | | | | | | | | The bridge protocol support has been extended for some time, so ensure that we actually pull this protocol information if it is configured that way. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openvswitch] only check mempool information for dpdk-init=trueAaron Conole2020-05-261-8/+11
| | | | | | | Ensures that the get-mempool-info command will be present. Signed-off-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [process] Collect iotopJose Castillo2020-05-261-1/+6
| | | | | | | | | | | | | Collect the output of the 'iotop' command by specifying the number of samples in the command line with the option 'samples', with 0.5 seconds delay between each one. By default we capture 20 samples. Resolves: #2024 Signed-off-by: Jose Castillo <jcastillo@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies/cos] eliminate 'id' local variableBryn M. Reeves2020-05-261-3/+2
| | | | | | | | The string 'id' is a Python keyword: do not use it as a local variable name. Signed-off-by: Bryn M. Reeves <bmr@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies/cos] check for blank and comment lines in os-releaseBryn M. Reeves2020-05-261-2/+15
| | | | | | | | The os-release file may contain blank and comment lines. Skip them when parsing values. Signed-off-by: Bryn M. Reeves <bmr@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos] raise exceptions in SoS._init_component() when --debugBryn M. Reeves2020-05-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An exception in SoS._init_component() currently leads to a fairly terse error even with --debug: # sos report -vv --batch --debug Could not initialize 'report': dictionary update sequence element #0 has length 1; 2 is required By propagating the exception when --debug is given we get the full backtrace on the terminal: # sos report -vv --batch --debug Could not initialize 'report': dictionary update sequence element #0 has length 1; 2 is required Traceback (most recent call last): File "/home/breeves/src/git/sos/bin/sos", line 21, in <module> sos = SoS(sys.argv[1:]) File "/home/breeves/src/git/sos/sos/__init__.py", line 112, in __init__ self._init_component() File "/home/breeves/src/git/sos/sos/__init__.py", line 153, in _init_component raise err File "/home/breeves/src/git/sos/sos/__init__.py", line 149, in _init_component self.cmdline) File "/home/breeves/src/git/sos/sos/report/__init__.py", line 118, in __init__ super(SoSReport, self).__init__(parser, args, cmdline) File "/home/breeves/src/git/sos/sos/component.py", line 98, in __init__ self.policy = sos.policies.load(sysroot=self.opts.sysroot) File "/home/breeves/src/git/sos/sos/policies/__init__.py", line 60, in load if policy.check(remote=remote_check): File "/home/breeves/src/git/sos/sos/policies/cos.py", line 30, in check os_release = dict(line.strip().split('=') for line in fp ValueError: dictionary update sequence element #0 has length 1; 2 is required Signed-off-by: Bryn M. Reeves <bmr@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [containers_common] Call machinectl on foregroundPavel Moravec2020-05-261-1/+1
| | | | | | | | | | | | | Commands like: machinectl -q shell user1@ .. hang if not called on foreground / with terminal. Resolves: #2082 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [containers_common] fix user's home expansionPavel Moravec2020-05-261-1/+1
| | | | | | | | | Apply os.path.expanduser on ~[user], not ~%s . Relates to: #2082 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [xdp] Add XDP pluginToke Høiland-Jørgensen2020-05-261-0/+21
| | | | | | | | | | | | | | | | This adds a plugin for gathering information about the loaded XDP programs on a system, using the xdp-loader tool in the xdp-tools package. This is complementary with the existing eBPF plugin, because this plugin supports getting status for multiple XDP programs on each interface as supported by libxdp. For now, this just prints the output of 'xdp-loader status' which will list any XDP programs attached. We don't currently support structured output (such as JSON) from xdp-tools, but should we add that in the future we can of course update this plugin. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [travis] Kill PPCBryan Quigley2020-05-201-7/+0
| | | | | | | | | | Apparently I just broke travis entirely with trying allow- downgrades. Resolves: #2077 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] collect iptables when proper kernel modules loadedPavel Moravec2020-05-191-10/+13
| | | | | | | | | | | Since kernel-4, iptables / ip6tables is newly provided by nf_tables kernel module. Therefore, collecting ip[,6]tables commands should be gated by presence of also this kernel module. Resolves: #2054 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [postfix] collect whole /etc/postfixPavel Moravec2020-05-191-3/+7
| | | | | | | | | Skip just collecting some SSL stuff (not required, potentially sensitive). Resolves: #2075 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [nfs] merge nfsserver plugin into nfs onePavel Moravec2020-05-192-56/+12
| | | | | | | | | | | | | | | nfsserver plugin enabledness relies on legacy init scripts. A more appropriate way to idenfity a NFS server is via nfs-utils package (though it could be present also on a NFS client). As that package enables nfs plugin, it is reasonable to merge the plugins into one. Closes: #2061 Resolves: #2073 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [man] update references to 'general' pluginPavel Moravec2020-05-191-2/+2
| | | | | | | | | | | 'general' plugin was replaced by 'host' plugin years ago. Let update an example in man pages accordingly. Resolves: #2072 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [networking] Small change to produce more-useful, numbered ufw rule statusDavid A. Desrosiers2020-05-191-2/+2
| | | | | | | | | | | | This allows inspection of the rule order, as well as insert/edit/delete of the rules by that numbered id (ufw delete 23). More details can be found here: https://help.ubuntu.com/community/UFW Resolves: #2065 Signed-off-by: David A. Desrosiers <setuid@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [doc] Update path to the sosreport command.Jose Castillo2020-05-191-5/+5
| | | | | | | | | | | The documentation references ./sosreport , but the command now lives inside ./bin, so this commit updates such references. Resolves: #2060 Signed-off-by: Jose Castillo <jcastillo@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [containers_common] collect rootless containers infoPavel Moravec2020-05-191-0/+29
| | | | | | | | | | | | | | | | Add the ability to collect data/info about rootless podman/buildah containers, in particular: - containers_common plugopt 'rootlessusers' as a list of users to inspect - for each user, collect: - its containers config - [podman|buildah] info and [UID|GID] map - collect user-status and few user-related config files Resolves: #2055 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sos] Write to host filesystem if in container with HOST env var setJake Hunsaker2020-05-131-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Moving tmpdir specifications out of policy gave us the ability to have logging within `Policy`, however it was unnoticed before that this stopped the redirection from container filesystem to host filesystem when sos was running in a container (and we wanted to save the archive to the host and not the container). Fix this by standardizing a check for a `HOST` environment variable, when a `container` env var is set as well. This has been used by the Red Hat policy for some time to determine chroot locations for when we're running in a container, and has been working well. The `container` environment variable should be set at container setup by modern container runtimes. If either the `container` or `HOST` environment variable is not set, but we are running in a container, then we will continue to write to the container's filesystem (while policy will still determine any chroot requirements separately). Resolves: #2041 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [travis] make ppc failure optionalBryan Quigley2020-05-131-6/+7
| | | | | | | | Related to #2048, but not a true fix. Resolves: #2067 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [build] Enable copr builds and add packit configDominika Hodovska2020-05-131-0/+12
| | | | | | | Resolves: #1853 Signed-off-by: Dominika Hodovska <dhodovsk@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [plugins] convert_copyspec_scl fixJan Jansky2020-05-121-2/+3
| | | | | | | | | | | Fixing convert_copyspec_scl method which returned // instead of /. That caused in some cases that some files was not collected by plugins. Resolves: #2016 Signed-off-by: Jan Jansky <jjansky@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redis] Collection of redis from sclJan Jansky2020-05-121-29/+29
| | | | | | | | | | As preparation for Satellite 7 configuration and log collection adding collection of rh-redis32 from scl. Resolves: #2016 Signed-off-by: Jan Jansky <jjansky@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [general] set file logging only when initializedPavel Moravec2020-05-121-2/+5
| | | | | | | | | | | | To fix regression in 8a2a765: Could not initialize 'report': local variable 'flog' referenced before assignment Resolves: #2057 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Apply size limit to directory specsJake Hunsaker2020-05-121-2/+35
| | | | | | | | | | | | | | | | | Addresses an issue where size limiting was not being applied to whole directory specifications, as we would only stat the directory directly when it was returned from a glob. Now, if the given copyspec is just a directory path, recurse into it with an explicit '*' match. Updates the forbidden path check to account for the newly extended files list to match against the directory-only forbidden specifications. This may result in more log entries for deep directory structures whose parent directory/directories is/are forbidden. Closes: #1750 Resolves: #2035 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [nvmetcli] Add new plugin for NVMe Target CLIPavel Moravec2020-05-121-0/+32
| | | | | | | Resolves: #2056 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [insights] collect insights dump output in deterministic filenamePavel Moravec2020-05-121-1/+4
| | | | | | | | | | | | | | Currently, "insights-client --offline" stdout is stored in filename like insights-client_--offline_--output-dir_.var.tmp.sos.cbl0ox16. (and so on) Let make the filename unified and deterministic. Also add the trailing vim expand tabs comment. Resolves: #2058 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [systemd] gate systemd-resolve commands by systemd-resolved servicePavel Moravec2020-05-121-3/+8
| | | | | | | | | | | systemd-resolve command starts systemd-resolved service when that is not running; thus we should call the command only under the relevant predicate. Resolves: #2059 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [rabbitmq] Call containerised rabbitmqctl report on foregroundPavel Moravec2020-05-071-1/+2
| | | | | | | | | | | In some use cases, "rabbitmqctl report" run in a container can hung due to missing terminal. Let workaround it for now by running the command with --foreground timeout option. Resolves: #2047 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Take care of empty lines while parsing /etc/os-releaseSourabh Jain2020-05-071-1/+2
| | | | | | | | | | | | | | The check function in CozPolicy class hits the ValueError exception if we have empty lines in /etc/os-release file. Updated the list comprehension used to parse the /etc/os-release file with a if condition to take care of empty lines. Closes: #2045 Resolves: #2046 Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [auditd] Get auditd plugins.d contentstuxpreacher2020-05-071-1/+2
| | | | | | | Resolves: #2043 Signed-off-by: Dr. Jason Breitweg <jason@breitweg.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [azure] Update metadata service URLOliver Falk2020-05-071-2/+2
| | | | | | | | | | | Use latest api-version when querying the metadata service; Additionally switch to use /instance/compute instead of only /instance, as this contains more information (eg. network config) Resolves: #2019 Signed-off-by: Oliver Falk <ofalk@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] mark 9 plugins as supported on COSXuewei Zhang2020-05-0510-18/+32
| | | | | | | | | | 9 exisiting plugins already works on Container-Optimized OS. Marking it to reflect that. Resolves: #1419 Signed-off-by: Xuewei Zhang <xueweiz@google.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] add COS policyXuewei Zhang2020-05-051-0/+36
| | | | | | | | | | Add a basic policy class for Container-Optimized OS (COS). A new CosPlugin tagging class is introduced for COS-specific plugin cases. Signed-off-by: Xuewei Zhang <xueweiz@google.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redhat] Update CoreOS release line matchJake Hunsaker2020-05-051-1/+1
| | | | | | | | | Updates the release line we try to match against for identifying CoreOS hosts to the syntax now used by Red Hat CoreOS. Resolves: #2042 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [containers_common] Add plugin for common containers configsPavel Moravec2020-05-053-14/+27
| | | | | | | | | | | | | Move collection of whole /etc/containers and /usr/share/containers to one containers_common plugin enabled by the package of the same name. Since the package is a common dependency for buildah and podman, no regression in default data collection happens. Resolves: #2040 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Add Timing, summary, and reduce IO for small filesBryan Quigley2020-05-041-9/+20
| | | | | | | | | | | | Timing - see how long each test takes Summary - output the key results at the end Use /dev/shm to store temporary files Make since command actually meaningful Resolves: #2039 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [s390] Convert enablement to using default architecture checkJake Hunsaker2020-05-011-7/+1
| | | | | | | | | | | Removes the enablement override for the plugin and instead relies on the default architecture checks by specifying the `s390` arch in the `architectures` tuple. Resolves: #2038 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [Plugin] Fix enablement triggers when only restriction is architectureJake Hunsaker2020-04-301-0/+5
| | | | | | | | | | When a plugin, such as the `powerpc` plugin, only defines an architecture enablement trigger and no files, commands, packages, etc... our current enablement checks would return false. When the 'normal' trigger restrictions are all empty, but there is an architecture trigger, now properly enable based solely on that architecture. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [travis] Add tests against arm64, ppc64le, and s390xBryan Quigley2020-04-301-0/+18
| | | | | | | Resolves: #2037 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] Convert docstrings to class attrsJake Hunsaker2020-04-30298-578/+590
| | | | | | | | | | Converts all current plugin docstrings into a `short_desc` attribute, that is now referenced by `Plugin.get_description()`. Closes: #1960 Resolves: #2036 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>