aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [policies] add SuSE policybmr-suse-policyBryn M. Reeves2024-05-211-0/+125
| | | | | | | | | | | Add a basic policy for SuSE distributions. Currently does not make a distinction between OpenSuSE and the various SuSE Enterprise releases and uses the RedHatPlugin taging class as the policy's allowed plugin set. Fixes #523. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ceph_mds] Capture alternative mds file pathmainJose Castillo2024-05-201-1/+3
| | | | | | | | | | | Newer versions of Ceph place information in /var/lib/ceph/<fsid>/mds* instead of /var/lib/ceph/mds/*, so we need to capture the new path as well. Related: RH: SUPDEV-154 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [redhat|policy] Check for archive size before uploadJose Castillo2024-05-161-6/+23
| | | | | | | | | | | | | | The Red Hat Customer Portal has a max limit for single http requests of 1Gb. From sos side, we never checked this and so customers had to wait for the whole upload to be attempted before receiving an error from the portal. This patch attempts to stop the upload before it starts, informing customers of such limit, and switching to secure FTP where there's no limit. Related: RHEL-22732 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [livepatch] Add config output and bring out serviceArif Ali2024-05-161-3/+6
| | | | | | | | | Add the service in the service dict so that we collect the journal for the corresponding service. Also acts as an extra trigger. Obfuscate the certs that the config outputs Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [kubernetes] plugin improvementsEtienne Champetier2024-05-151-50/+76
| | | | | | | | | | | | | | - enable when k8s services are running - enable when kubelet package is present - add admin.conf as default kubeconfig - ensure we are not enabled if Openshift is - use 'oc' when present: this is relevant only for old OpenShift installs move limitranges / resourcequotas to the base plugin - collect journal only for existing services services - scrub collected files Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
* [deb][pkg] Add python3-boto3 to dependsArif Ali2024-05-151-1/+1
| | | | | | | | Now that the python3-boto3 package is in the `main` pocket we can now add to `Depends`. This will enhance future deb packages to allow S3 uploads. Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [Plugins, Options] Standardized PluginOpt names to use dashesJake Hunsaker2024-05-1312-36/+36
| | | | | | | | | | | | | | | | | | | | This commit standardizes the use of dashes/hypens (`-`) for the names of PluginOpts. This is done to conform with argparse formatting so that the formating of options names is consistent across sos global options, component options, and now plugin options. For example, the `networking` plugin's `namespace_pattern` option is now `namespace-pattern` and should now be specified via the `--plugin-option networking.namespace-pattern=foo` syntax. Similarly, developers will now need to use `Plugin.get_option('namespace-pattern')` in order to reference it. Note that the use of global options within plugins (for example `--all-logs`) is unchanged, meaning that users will continue to use `--all-logs` and due to how these options get stored, developers would still use `Plugin.get_option('all_logs')`. Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
* [tomcat] Enable the plugin by pki-servlet-engine packagePavel Moravec2024-05-121-1/+2
| | | | | | | | | pki-servlet-engine implements Tomcat as well, let add the package to the plugin's triggers. Resolves: #3640 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [foreman] Decrease hammer ping timeoutPavel Moravec2024-05-121-1/+1
| | | | | | | | | hammer ping either finishes within a minute (or two), or never. Let decrease its timeout accordingly. Resolves: #3639 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [microovn] Added new plugin support for MicroOVN.Alan Baghumian2024-05-102-53/+126
| | | | Signed-off-by: Alan Baghumian <alan.baghumian@canonical.com>
* [ebpf] Check for bpftool presence before running pluginJose Castillo2024-05-081-0/+1
| | | | | | | | | | | | | | | | The plugin was running even when the bpftool was not present, throwing an exception when it tried to parse a json output: INFO: [plugin:ebpf] Could not parse bpftool prog list as JSON: Expecting value: line 1 column 1 (char 0) It now checks if the program is present before running any command at all. Related: RH SUPDEV-151 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [cirrus] Start testing on new devel ubuntu dailyArif Ali2024-05-082-5/+5
| | | | | | | | | | | | | | Ubuntu 24.10 release cycle has new started with the daily builds, so we start testing on these to uncover any issues Also update to latest GCE images for any new ubuntu images Fix the `msr` predicate, such that it is caught on 24.04 and newer releases of ubuntu Related: #3610 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [cirrus] Update CentOS Stream image versionsJake Hunsaker2024-05-081-2/+2
| | | | | | Updates the CentOS Stream image versions to their current latest builds. Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
* [pylint] pylint and flake8 updatesArif Ali2024-05-0357-233/+276
| | | | | | | | | | | | | | pylint for the following rules applied * C0411: wrong-import-order * R0912: too-many-branches * R0914: too-many-locals * R1725: super-with-arguments * E1101: no-member Resolves: #3597 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [pylint] Convert all tests to f-stringsArif Ali2024-05-026-31/+31
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* Adding the plugin 'aap_gateway.py' for the sos report to collectLucas Benedito2024-05-021-0/+53
| | | | | | | | | the files used for troubleshooting issues at Ansible Automation Platform Gateway Related: RH AAP-20033 Signed-off-by: Lucas Benedito <lbenedit@redhat.com>
* [neutron] Don't collect ml2 certsArif Ali2024-05-021-0/+32
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [tests] Add some tests for netplan and jujuArif Ali2024-05-014-1/+305
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [CodeQL] Resolve remaining alerts from CodeQL scansJake Hunsaker2024-04-286-6/+4
| | | | | | | Resolve the remaining handful of alerts from CodeQL, while others have been manually dimissed after review. Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
* [sunbeam] Add new plugin for sunbeamArif Ali2024-04-274-72/+246
| | | | | | | | | | Refactor ovn_host and openswitch plugins to utilise the commands from sunbeam Closes: #3297 Resolves: #3586 Related: SET-87 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [ssh] Collect sshd_config.d directoryPavel Moravec2024-04-271-2/+9
| | | | | | | | | Collect sshd config files in its dedicated sshd_config.d directory, as well as config files included from them. Resolves: #3595 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [cirrus] Update images, add noble to supported listArif Ali2024-04-271-17/+24
| | | | | | Update the ubuntu images to the newest available Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [pylint] Convert remaining content to f-stringsArif Ali2024-04-2636-680/+630
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [tox] Use posargs for the testsArif Ali2024-04-263-7/+11
| | | | | | | | | | | | | | | | | | | | | | | This allows to run specific tests, and not all the tests in one go. This is especially useful if you're writing a plugin or creating a test for a specific scenario. Below an example of what would be possible ``` sudo tox -e stagetwo_tests -- tests/report_tests/plugin_tests/openstack/openstack.py ``` This will run stagetwo tests for the specific test, i.e. openstack in this case This also fixes the stagetwo tests, so that it picks up the systemd python libs from the distro environment Update the installation of avocado-framework from one place, so that we don't need to change the version in many places. Adding `test-requirements.txt` to handle this and integrate this with both tox and Cirrus CI Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [processor] handle `msr` module loading via predicateArif Ali2024-04-261-5/+17
| | | | | | | | | | | The cpupower and turbostat applications are not installed by default on most environments, but where it is, it will load the `msr` module when running this commends. Adding the predicate will solve this. Closes: #3610 Related: #3624, SET-622 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* Including settings.local.py file to be collected and parsed.Rudnei Bertol Junior2024-04-261-0/+3
| | | | | | | | This change, allows the sosreport to collect the settings.local.py file, when customer has custom changes out of the default settings.py file. Signed-off-by: Rudnei Bertol Junior <rudnei@redhat.com>
* [dracut] avoid 100s delay with rpm-ostree cliwrapEtienne Champetier2024-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling dracut on an rpm-ostree based system with cliwrap enabled you get the following message: ``` This system is rpm-ostree based; initramfs handling is integrated with the underlying ostree transaction mechanism. Use `rpm-ostree initramfs` to control client-side initramfs generation. rpm-ostree: Note: This system is image (rpm-ostree) based. rpm-ostree: Dropping privileges as `dracut` was executed with not "known safe" arguments. rpm-ostree: You may invoke the real `dracut` binary in `/usr/libexec/rpm-ostree/wrapped/dracut`. rpm-ostree: Continuing execution in 5 seconds. ``` Calling `/usr/libexec/rpm-ostree/wrapped/dracut --print-cmdline` is still slow because it calls rpm multiple times which is also a wrapped cli. Call dracut with the env variable RPMOSTREE_CLIWRAP_SKIP to avoid the 5s waits. This is safe because we only use read only commands. With rpm-ostree v2024.4 `rpm --eval` is marked as safe, so we don't have the 5s wait anymore for rpm calls (https://github.com/coreos/rpm-ostree/pull/4835) Resolves: RHEL-33703 Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
* [plugins] apply --since to all journal collectionEtienne Champetier2024-04-252-7/+4
| | | | | | | If user limit logs with --since, there is no reasons to have logs older than the limit. Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
* [archive] Fix get_archive_root after files reorderingPavel Moravec2024-04-241-1/+1
| | | | | | | | | | | Commit d5d8c21 reordered files in the archive, such that the first member is not the archive root directory further more. Let change the get_archive_root method accordingly to prevent self.archive_root being empty. Resolves: #3616 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pylint] Fix deprecated warningsArif Ali2024-04-242-1/+2
| | | | | | | * W4903: deprecated-argument * W4902: deprecated-method Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [pkg] Don't initialize _packages to empty setRenaud Métrich2024-04-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | When initializing _packages, a distinction must be made between not having any package and not being initialized at all. Otherwise, if a package manager returns no package, the query command will execute hundreds of times. This can reproduce with 'flatpak' on RHEL when no package is returned: # flatpak list --> no output # strace -fttTvyy -s 128 -e execve -o sos.strace -- ./bin/sos report [...] Press ENTER to continue, or CTRL-C to quit. ^C # grep -c ' execve("/usr/sbin/flatpak"' sos.strace 350 Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
* [Global] Resolve empty except alerts from CodeQLJake Hunsaker2024-04-2113-25/+36
| | | | | | | | | | | | | This commit resolves the remaining 'Empty except' alerts from CodeQL scanning. Most of these involve logging something during exception handling when we were previously simply `pass`ing. Others, either when logging is unavailable or it makes no sense to log something for, are resolved by placing comments within the except block as the CodeQL alerts should be suppressed if the 'empty except' (`pass`ing) has an explanatory note. Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
* [aap_receptor] Add receptor status outputThom Carlin2024-04-201-0/+1
| | | | Signed-off-by: Thom Carlin <tcarlin@redhat.com>
* [global] Update use of pipes with shlexJake Hunsaker2024-04-199-9/+9
| | | | | | | | | | | | `pipes` is deprecated and being removed from Python in 3.13. Our usage is exclusively `pipes.quote()`, which has actually been calling `shlex.quote()` behind the scenes for some time (at least since 3.6). Update our usage of `quote` to directly import from `shlex`. Resolves: #3310 Signed-off-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com>
* [pylint] Convert all report plugins to f-stringsArif Ali2024-04-19143-783/+752
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [ceph] Add more microceph commandsPonnuvel Palaniyappan2024-04-191-5/+15
| | | | Signed-off-by: Ponnuvel Palaniyappan <pponnuvel@gmail.com>
* [kdump] Create AzureKDump classAadhar Agarwal2024-04-191-1/+46
| | | | | | | | | | | | This change collects kdump information for Azure Linux. With this change, we will check the 'path' variable in /etc/kdump.conf to check where information is being dumped. If get_vm_core is set to true, collect the latest vm core created in the last 24 hours that is <= 2GB Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
* *[aap_receptor]** Add receptorctl work list outputThom Carlin2024-04-171-0/+2
| | | | Signed-off-by: Thom Carlin <tcarlin@redhat.com>
* **[aap_receptor]** Change receptorctl status output to jsonThom Carlin2024-04-161-0/+2
| | | | Signed-off-by: Thom Carlin <tcarlin@redhat.com>
* [avocado] Upgrade avocado to 103.X LTSArif Ali2024-04-154-28/+22
| | | | | | | | | | | | | | * Extra changes required due to module and function changes in new avocado * CentOS Stream is now seen as centos-stream in avocado instead of centos * Fine tune tox for stage tests Closes: #3588 Resolves: #3594 Co-authored-by: Jake Hunsaker <jacob.r.hunsaker@gmail.com> Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [testing] Add most testing via tox.iniArif Ali2024-04-1236-164/+495
| | | | | | | | | | | | | | | | | Consolidate testing, so that things can be run from CLI, CI and various other means in a consistent way by using tox. * Updated all the flake8 tests in the tests folder. * Added pylint as a neutral test so that we can work on this in stages and have some collaboration on what we test and don't * The tox tests for unit, stageone, stagetwo testing makes is easier for users to know how to run tests, and not have to do things manually * Using tox for CI doesn't make sense, as that will create virtual envs and will disregard system/snap based python modules so may not work Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [kafka] Add kafka pluginAlejandro Santoyo2024-04-111-0/+69
| | | | | | | | | | | Adding a plugin to collect: - Kafka logs and config files - basic installation info for debugging purposes Resolves: SET-96 Signed-off-by: Alejandro Santoyo <alejandro.santoyo@canonical.com>
* [cirrus] Run tests on latest daily builds for ubuntuArif Ali2024-04-0910-20/+71
| | | | | | | | | | | | Fix the issues reported by the tests on the new version of ubuntu Resolves: #3587 Closes: #3588 Related: SET-594,SET-595 Co-authored-by: David Negreira <david.negreira@canonical.com> Signed-off-by: Arif Ali <arif.ali@canonical.com> Signed-off-by: David Negreira <david.negreira@canonical.com>
* [AAP CONTROLLER] Add new presetRudnei Bertol Junior2024-04-092-1/+19
| | | | | | | | | | | Adds a new preset for `aap_controller`, or Ansible Automation Controller. This preset will set the `containers_common` plugin to collect output for the `awx` user. Related: #3561 Signed-off-by: Rudnei Bertol Junior <rudnei@redhat.com>
* [AAP EDA] Adding aap eda nginx log files to be collectedRudnei Bertol Junior2024-04-081-0/+2
| | | | | | | | | | Adding the line to collect the nginx log files for the AAP EDA sos report used for troubleshooting issues at Ansible Automation Platform Event Driven Controller Related: RH AAP-12898 Signed-off-by: Rudnei Bertol Junior <rudnei@redhat.com>
* [AAP RECEPTOR] Add a new AAP receptor plugin.Rudnei Bertol Junior2024-04-081-0/+53
| | | | | | | | | | Adding the file 'aap_receptor.py' for the sos report collects the files used for troubleshooting issues at Ansible Automation Platform Controller/Execution Nodes Related: RH AAP-19657 Signed-off-by: Rudnei Bertol Junior <rudnei@redhat.com>
* [build] Bump version to 4.7.1Pavel Moravec2024-04-084-4/+19
| | | | Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [kubernetes] k8s improvements for Charmed KubernetesShunde Zhang2024-04-031-51/+124
| | | | | | | | | | | Add more resources to output when kubernetes.all option is true. Remove openshift specific resources from base class. Output json format if kubernetes.all option is true. Export pod logs to an individual file for each container, so the plugin can export logs if there are multiple containers in a pod. Signed-off-by: Shunde Zhang <shunde.zhang@canonical.com>
* [samba] Capture wbinfo --online-statusJose Castillo2024-04-021-0/+1
| | | | | | | | | | | Capturing this command output can help find the domain status, specially in these cases where having multiple domains in the same forest/cross forest, or in cases where there is sssd and samba_winbind. This output complements that of 'net ads testjoin'. Related: RH: RHEL-30958 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [telegraf] Add new telegraf pluginMarcin Wilk2024-03-261-0/+61
| | | | Signed-off-by: Marcin Wilk <marcin.wilk@canonical.com>