aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [build] Bump version to 4.5.5Jake Hunsaker2023-06-233-4/+7
| | | | | | This commit marks the release of sos-4.5.5. Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
* [docker] collect on Debian tooJohan Guldmyr2023-06-221-2/+3
| | | | | | | | Tested by: - manually patching file on Debian 11 and 12 (both on sos version 4.0.2) - sudo ./bin/sos report from this commit (and on python 3.11) Signed-off-by: Johan Guldmyr <johan@meetiqm.com>
* [Plugin] Fix exception when calling os.makedirsJose Castillo2023-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When calling get_cmd_output_path() to create a directory via the plugin hpssm, sos threw the following exception: Traceback (most recent call last): File "/root/sos/sos/report/__init__.py", line 1224, in setup plug.setup() File "/root/sos/sos/report/plugins/hpssm.py", line 67, in setup logpath = self.get_cmd_output_path() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/sos/sos/report/plugins/__init__.py", line 2168, in get_cmd_output_path os.makedirs(cmd_output_path) File "<frozen os>", line 225, in makedirs FileExistsError: [Errno 17] File exists: '/var/tmp/sos.1gdy83zb/sosreport-localhost-vbwfnpn/sos_commands/hpssm' This was happening because the directory 'hpssm' was already created. With this change we avoid any race where we call os.makedirs() after we have already created the plugin directory. Closes: RHBZ #2216608 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [conntrack] collect conntrack commands only when kmods are loadedPavel Moravec2023-06-221-3/+11
| | | | | | | | | Two conntrack commands require several kmods - guard collection of the commands by relevant SoSPredicate. Resolves: #3279 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [keywords] Add new PrepperJake Hunsaker2023-06-223-18/+39
| | | | | | | | | Adds a new Prepper to handle keyword preparation. This is slightly inefficient since we will only realistically need this once, but baking it into the archive loop does not pose any other problems, and it would be more fragile to break out a special flow just for keywords. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [username] Add new PrepperJake Hunsaker2023-06-225-50/+71
| | | | | | | | | Adds a new Prepper for usernames, and removes the bits from the parser and mapping that otherwise handled the initial preparation of the mapping. The prepper will source from the same initial files, as well as from the `--usernames` command line option. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [mac] Add new PrepperJake Hunsaker2023-06-223-5/+28
| | | | | | | Adds a new Prepper to handle feeding relevant files to the mac parser for initial preparation of the mappings. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [hostname] Add new prepperJake Hunsaker2023-06-228-75/+78
| | | | | | | | | Adds a new Prepper for handling hostname determination for preparing the mapping and parser. As part of this new prepper, pass the CLI options to each prepper for use. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ip] Add new prepperJake Hunsaker2023-06-224-2/+42
| | | | | | Adds a new prepper for IP network address sourcing. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [cleaner] Separate cleaner prepping from archivesJake Hunsaker2023-06-224-49/+240
| | | | | | | | | | | | | | | | | | | | | | Up until now, the archive abstractions have defined what files `sos clean` will use to prepare the mappings for obfuscation before entering the normal obfuscation loop over every file in every archive. While this is straight forward enough, it is not particularly flexible, and prevents us from easily using other approaches for preparing the mappings beyond what is directly obtained via the parsers (which in some cases need special handling to be prepared at all). Change this by introducing `SoSPrepper`s which will be used to determine now only what files to pass to which parsers on an archive-by-archive basis, but will also allow for manually retrieving items from disaparate sources within the archive(s) and handing those directly to the mappings, without the need for those items to first pass the parser check. Related: RH: SUPDEV-135 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [vault] Add vault pluginArif Ali2023-06-221-0/+55
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [maas] adding configuration file collectionAlejandro Santoyo2023-06-221-0/+3
| | | | | | | | | | | | | Adding the below paths to collection as they are useful to troubleshoot some issues. "/var/lib/maas/http/*.conf" "/var/lib/maas/*.conf" "/var/lib/maas/rsyslog" Resolves #3280 Signed-off-by: Alejandro Santoyo <alejandro.santoyo@canonical.com>
* [build][snap] Fix build of snapArif Ali2023-06-211-1/+5
| | | | | | | | Originally, it was working by coincidence Reference: https://github.com/canonical/rockcraft/issues/225#issuecomment-1597025315 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [kernel] verify also kernel-redhat on RedHatPolicyPavel Moravec2023-06-151-0/+6
| | | | | | | | | RedHat distributions can deliver kernel in RPM named either 'kernel' or 'kernel-redhat', in which case we must verify both package names. Resolves: #3274 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [ipa] add EPN log file (ipaepn.log)François Cami2023-06-141-1/+2
| | | | | | | | | | | | | Since https://www.freeipa.org/page/Releases/4.8.7, IPA includes a tool to send email notifications to users when their passwords are about to expire. This logs into: /var/log/ipaepn.log More information: https://pagure.io/freeipa/issue/3687 Resolves: #3272 Signed-off-by: François Cami <fcami@redhat.com>
* [sssd] Handle spaces in postproc regex substitutionJake Hunsaker2023-06-121-3/+3
| | | | | | | | | | Widen the capturing of strings for the `ldap_default_authtok` substitution performed on sssd configuration files to also capture strings with spaces. Closes: #3266 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [grub2] Capture user created configuration filesJose Castillo2023-06-121-0/+2
| | | | | | | | | | | | | | | | | | For now neither "/boot/grub2/custom.cfg" nor "/boot/grub2/user.cfg" are embedded in the sosreport, which may contain critical information when troubleshooting boot issues. Indeed it happens customers create the files badly, e.g. create a copy of "boot/grub2/grub.cfg" itself, which ends up having a dead loop in Grub and preventing the system to boot. With such information, we would troubleshoot such issues more rapidly. Resolves: RHBZ#2213951 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [ipa] add SID log file (ipaserver-enable-sid.log)François Cami2023-06-091-0/+1
| | | | | | | | | | | Since https://www.freeipa.org/page/Releases/4.9.8, SID configuration is instegrated in the base installer. This logs into: /var/log/ipaserver-enable-sid.log More information: https://pagure.io/freeipa/issue/8995 Resolves: #3268 Signed-off-by: François Cami <fcami@redhat.com>
* [sosnode] Report sos report execution errors in consistent formatJake Hunsaker2023-06-091-2/+3
| | | | | | | | This change simply makes `SosNode` report execution errors using the standardized UI formatting, instead of printing the log format to console (but the logged message will still be written to the log file). Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ocp] Handle delete project timeouts more gracefullyJake Hunsaker2023-06-092-16/+33
| | | | | | | | | | | | | | | | In scenarios where the cluster is unable to delete the temporary project due to a failure on one of the cluster nodes during the collection, we would previously fail to delete the temporary project with a nasty traceback after waiting for 5 minutes. Be better at this by reducing the wait time (by adding a new `timeout` parameter to `exec_primary_cmd()`) and more gracefully reporting the error, and the fact that the user must make manual intervention to remove the temporary project. Related: RH SUPDEV-74 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [report] Add flags from regex if they existArif Ali2023-06-091-3/+8
| | | | | | | | | | | | Now that we ae using flags in re.subn, it doesn't like the full pattern that is being passed through via do_file_private_sub. So, we separete pattern and the flags, and pass these through to re.subn Closes: #3261 Signed-off-by: Arif Ali <arif.ali@canonical.com> Signed-off-by: David Negreira <david.negreira@canonical.com>
* [cxl] Add a new Compute Express Link (CXL) pluginSteve Scargall2023-06-061-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | Compute Express Link (CXL) is an industry-supported Cache-Coherent Interconnect for Processors, Memory Expansion, and Accelerators. The CXL Consortium (https://www.computeexpresslink.org/) is an open industry standard group formed to develop technical specifications that facilitate breakthrough performance for emerging usage models while supporting an open ecosystem for data center accelerators and other high-speed enhancements. There are currently three specifications (v1.1, 2.0, and v3.0) publicly available. CPUs are available from Intel and AMD that support CXL v1.1. Hardware is emerging that supports up to CXL v3.0. This plugin uses open-source utilities from https://github.com/pmem/ndctl that introduce new and updated commands to support CXL devices in the Linux Kernel. Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
* [pm] Update plugins to use package_managerArif Ali2023-06-052-11/+7
| | | | | | | | | | Remove `check_enabled()` for the maas plugin, as that is now not required with `SnapPackageManager` now enabled for the `UbuntuPlugin` Use package manager to detrmine is package is a snap rather than `snap list`. Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [apache] collect all /etc/httpd/conf/*.conf filesPavel Moravec2023-06-051-1/+1
| | | | | | | | | httpd.conf can refer to files in either conf.d or directly in conf dir, so let collect all configs by default. Resolves: #3264 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [specfile] new fedora guidelinesSandro Bonazzola2023-05-312-0/+21
| | | | | | adapt the specfile to new fedora packaging guidelines. Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
* [specfile] align with Fedora spec fileSandro Bonazzola2023-05-311-14/+15
| | | | Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>
* [cleaner] Enhance trailing characters list after AMC addressPavel Moravec2023-05-311-3/+3
| | | | | | | | | A MAC address can be followed by characters other than just blank char or a newline. Let enhance the list accordingly. Resolves: #3258 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [Plugin|Archive] Fix collection of symlinks in containersJake Hunsaker2023-05-313-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | When collecting an sos report from witin a container, and intending to collect host-level information, symlink collection would previously collect the container's version of the symlink target due to how they would resolve within the `Archive.add_file()` flow. Fix this by simply forcing the follow up collection of the sysroot location of the symlink target, which would previously be aborted due to the fact that sos had already collected the container's matching file. This introduces a certain level of inefficiency by way of doubling the copy operations, however ensuring that we only make a single copy operation originally involves a quite fragile set of path mangling that depends heavily upon how the symlinks are created on the host's filesystem. For example a symlink using a relative path could be resolved somewhat easily, but a symlink using an absolute path introduces a certain amount of indeterminate resolution, which we cannot allow for the vast majority of use cases that are performed outside of a container. Resolves: rhbz#2075720 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [build] Bump version to 4.5.4Jake Hunsaker2023-05-263-4/+7
| | | | | | This commit marks the release of sos-4.5.4 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_*][ubuntu] Update paths and collectionsArif Ali2023-05-2617-64/+95
| | | | | | | | | | | Update the apache plugin to only collect the defaults and update the openstack bits to collect specifics for their service move gnocchi.py to openstack_gnocchi.py Closes: #2525 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [foreman] collect qpid-stat -qPavel Moravec2023-05-251-0/+7
| | | | | | | | | | | When katello-agent is (still) enabled, "qpid-stat -q" provides a great overview of pending requests and connected agents. As there is no katello plugin, we must collect it in foreman directly. Resolves: #3251 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [microk8s][ubuntu] Add microk8s pluginDavid Negreira2023-05-241-0/+52
| | | | | | Add a new plugin to support collecting data from microk8s on Ubuntu. Signed-off-by: David Negreira <david.negreira@canonical.com>
* [lstopo] Add detection for hwloc packageArif Ali2023-05-241-1/+5
| | | | | | This package is the one for ubuntu to run the lstopo command Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [rhc] New plugin for RHCJose Castillo2023-05-241-0/+49
| | | | | | | | | | | RHC is a client tool and daemon that connects the system to Red Hat hosted services enabling system and subscription management. This plugin captures configuration files and the output of 'rhc status'. Closes: RHBZ#2196649 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [powerpc] collect invscout logsSourabh Jain2023-05-241-0/+8
| | | | | | | | | | | | | | | | Gather the microcode and Vital Product Data (VPD) files produced by running the invscout commands. The invscout commands are executed prior to the commencement of log file collection. The invscout log files are generally small in size (KBs) and previous log files are removed from the /var/adm/invscout directory each time the invscout command is executed. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Suggested-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com> Tested-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com>
* [landscape] Add more loggingNikhil Kshirsagar2023-05-241-2/+8
| | | | Signed-off-by: Nikhil Kshirsagar <nikhil.kshirsagar@canonical.com>
* [policies] Mariner has been rebranded to Azure Linuxroot2023-05-241-5/+5
| | | | Signed-off-by: Eric Desrochers <edesrochers@microsoft.com>
* [juju] Ensure to collect hidden filesArif Ali2023-05-191-1/+2
| | | | | | | | Currently, it was inconsistent with the hidden file collection, this line ensures that we collect these files for better support Closes: #3242 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* powerpc: collect RMC status logsSourabh Jain2023-05-191-3/+11
| | | | | | | | | | | | | Resource Monitoring and Control (RMC) responsible for establishing management connection between HMC (Hardware Management Console) and Logical partition (LPAR). Add commands to collect the status/info of RMC service, node, and other system resource. Additionally collect RSCT node ID file. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com> Tested-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com> Suggested-by: Borislav Stoymirski <borislav.stoymirski@bg.ibm.com>
* [specfile] add runtime requirement to python3-setuptoolsPavel Moravec2023-05-191-0/+1
| | | | | | | | As pkg_resources module from setuptools is used in SosNode. Resolves: #3241 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [kernel] collect /var/lib/systemd/pstorePavel Moravec2023-05-191-0/+1
| | | | | | | | | After a kernel panic, /sys/fs/pstore data is backed off to /var/lib/systemd/pstore which should be collected as well. Resolves: #3244 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [rhui] Fix small typo while obfuscating cookiesJose Castillo2023-05-171-1/+1
| | | | | | Fix small typo while obfuscating cookies. Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [collector] collect report from primary node if in node_listPavel Moravec2023-05-171-2/+9
| | | | | | | | | | When sos is running on primary node with hostname listed in node_list, collect report from the node (until strict node option prohibits it). Resolves: #3240 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [redhat] Add debugging output to failed SFTP uploadsJake Hunsaker2023-05-161-0/+10
| | | | | | | | Adds debugging information to failed SFTP uploads when verbosity is set above 1. This prints to console since our log files have already been closed at this point. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [logging] Make ui_log sensitive to verbosityJake Hunsaker2023-05-161-2/+6
| | | | | | | | Makes the `ui_log` logger sensitive to verbosity settings, by allowing debug messages to print to console if verbosity is set above 1 (e.g. `-vv` or `-vvv`). Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ubuntu] update policy to use MultiPackageManagerArif Ali2023-05-161-0/+15
| | | | | | | | | | | | This change allows it to use the default deb as the primary package manager and the snap as a fallback package manager This change also ensures that the sosreport, if installed via snap for sos collect is detected if the deb doesn't exist Closes: #3214 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [apt] mask credentials in list filesArif Ali2023-05-161-0/+14
| | | | | | | | | The /etc/apt/sources.list or files in /etc/apt/sources.list.d may have credentials for private repositories. This change should mask the files and remove the username and the password. Resolves: #1514 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [plugins] collect strings before commandsPavel Moravec2023-05-151-1/+1
| | | | | | | | | When plugin timeouts during commands execution/collection, ensure we have collected sos_strings for tailed files. Resolves: #3237 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pm][snap] remove __init__Arif Ali2023-05-151-5/+0
| | | | | | The __init__ was not required, so removing it Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [alternatives] Add ubuntu sectionArif Ali2023-05-151-13/+47
| | | | | Related: #3224 Signed-off-by: Arif Ali <arif.ali@canonical.com>