aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [nfsganesha] Collect rotated logs when using --all-logsJake Hunsaker2019-10-141-0/+4
| | | | | | | | | If --all-logs is specified, the nfsganesha plugin will now gather the rotated log files from /var/log/ganesha, not just the current log file. Fixes: #1016 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] Replace /var/run paths by /runPavel Moravec2019-10-1411-18/+16
| | | | | | | | | | | Since FHS 3.0, the system information data since boot are located in /run. Sosreport shall collect the data directly, without the need to follow symlink from /var/run to /run that exists just for the sake of legacy reasons. Resolves: #1824 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [dracut] add plugin to 'boot' profileBryn M. Reeves2019-10-141-0/+1
| | | | | | Related: #1818 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [subscription_manager] collect list --availableWilliam Bradford Clark2019-10-141-0/+2
| | | | | | | Resolves: #1793 Signed-off-by: William Bradford Clark <wclark@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Predicates] Allow predicates to check package installationJake Hunsaker2019-10-141-6/+25
| | | | | | | | | | | Extends the SoSPredicate class to accept and check a list of packages to gate command or file collection on if those packages are present on the system. Resolves: #1785 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [manageiq] modify plugin to account for regularly large filesdluong2019-10-141-0/+15
| | | | | | | | | | | | | | | | | The following 5 files are usually over the default 25mb limit: ansible_tower.log automation.log evm.log production.log top_output.log Those 5 files interfere with the *.log glob to behave as users expect. These 5 files were broken out to miq_main_log_files. Resolves: #1779 Signed-off by: David Luong <dluong@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [github] Remind to put 'Closes' for PR'sPablo Iranzo Gómez2019-10-101-0/+2
| | | | | | Resolves: #1815 Signed-off-by: Pablo Iranzo Gómez <Pablo.Iranzo@gmail.com>
* [github] Ease 'clicking' of PRs directly from GH interfacePablo Iranzo Gómez2019-10-101-4/+4
| | | | | | | Resolves: #1814 Signed-off-by: Pablo Iranzo Gómez <Pablo.Iranzo@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugins] Update plugins to only use new consolidated methodsJake Hunsaker2019-10-1062-326/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | Updates numerous plugins to no longer use `get_command_output()`, `call_ext_prog()`, or `check_ext_prog()` - instead only using `collect_cmd_output()` where the content needs to be saved to the archive, and `exec_cmd()` where it does not. For the vast majority of plugins, these calls were able to be changed in-place with little to no further alteration of plugin code outside of no longer making indenpendent open() calls to files created, as the content of those files is now directly available. Exceptions are noted below. For the dlm, gfs2, and kvm plugins the only use of get_command_output() was to mount /sys/kernel/debugfs which in modern distributions is no longer needed, so those plugins have had that functionality entirely removed instead of being ported to the new `exec_cmd()`. For the networking plugin, many of the checks are handled by SoSPredicates, and so those command collections now use Predicates rather than being gated by individual `exec_cmd()` calls. Resolves: #1807 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Consolidate command collection APIJake Hunsaker2019-10-102-73/+103
| | | | | | | | | | | | | | | | | | | | | | | Removed `call_ext_prog()`, `check_ext_prog()`, and `get_command_output()` in favor of consolidating Plugin command collection into 3 public methods: `add_cmd_output()`, `collect_cmd_output()`, and `exec_cmd()`. - `add_cmd_output()` remains unchanged and is the interface to use when plugins should collect command output during their collect() phase. - `collect_cmd_output()` will now return the content of a command's execution as well as the filename within the sos archive. This replaces `get_cmd_output_now()` and the rename aims to being a bit more standardization to the API names. `add_cmd_output()` calls will eventually be served by `collect_cmd_output()` during `collect()`. - `exec_cmd()` will run a command immediately, and return its output, without saving it to the archive. This serves to replace the `*_ext_prog()`, and `get_command_output()` calls. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ovirt] fix regex formattingBryn M. Reeves2019-10-091-4/+2
| | | | | | | | | | LGTM warns about unmatchable caret and dollar symbols in ovirt's DB_PASS_FILES since they are surrounded by leading and trailing whitespace. Resolves: #1823 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] fix else clause indentationBryn M. Reeves2019-10-091-2/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [corosync] fix logging call string formattingBryn M. Reeves2019-10-091-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ipa] collect kdcproxy configsPavel Moravec2019-10-081-0/+3
| | | | | | Resolves: #1806 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [pulp,katello] move qpid-stat commands to pulp pluginPavel Moravec2019-10-082-1/+43
| | | | | | | | | | These commands are rather pulp-related and they are required to be collected also on Satellite6 Capsules where no katello but pulp is present. Resolves: #1805 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [foreman] collect http[|s]_proxy env.variablesPavel Moravec2019-10-081-0/+3
| | | | | | | | Presence or values of the variables is crucial in some foreman-installer issues. Resolves: #1804 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [mongodb] extend plugin to packages from SCLPavel Moravec2019-10-081-1/+13
| | | | | | | | | mongo-server can distributed via SCL. Different package names, config and log locations shall be captured in that case as well. Resolves: #1803 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [login] new pluginMikel Olasagasti Uranga2019-10-081-3/+8
| | | | | | | | | | | | Move `last` plugin to a new plugin called `login` that contains what last plugin was collecting and add `/etc/login.defs` and `/etc/default/useradd` files from shadow-utils package for now. Closes #1808 Resolves: #1810 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [vdsm] Use add_service_status()Jake Hunsaker2019-10-081-2/+1
| | | | | | | | | Updates the vdsm plugin to use add_service_status() for vdsmd and supervdsmd. Resolves: #1799 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies/debian] Make sosreport archive names friendlyBryan Quigley2019-10-081-0/+1
| | | | | | | | | | | | | From the source, currently it's on legacy legacy - 'sosreport-tux.123456-20171224185433' friendly - 'sosreport-tux-mylabel-123456-2017-12-24-ezcfcop.tar.xz' This also makes adding a label actually do something. Resolves: #1819 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [redhat] Enable RHV preset on managers and hypervisorsJake Hunsaker2019-10-081-0/+3
| | | | | | | | | | | | | The RHV preset was previously not being automatically enabled on manager or hypervisor systems. This adds a check for the appropriate packages and enables the preset if either are present. Resolves: #1798 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [manageiq,policies] add Cloudforms preset and verify by defaultdluong2019-10-082-1/+14
| | | | | | | | | | | | | | | | | | | | | | | We would like sosreports to check if the following packages have been modified: cfme cfme-appliance cfme-gemset cfme-appliance-tools cfme-appliance-common We would check this by running an rpm -V against them. This would expedite support's process of elimination. This has been done by modifying policies/redhat.py, which the RH_CFME preset has been added to to check the integrity of the packges upon run of sos automatically rather than having manual --verify prompt. Resolves: #1797 Signed-off by: David Luong <dluong@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [snappy] check for connectivity to the snap storeEric Desrochers2019-10-081-0/+1
| | | | | | | | | | | Check for connectivity to the snap store "api.snapcraft.io". Will be very useful to have as customers start upgrading to release where snaps are mandatory. Resolves: #1796 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kubernetes] simplify UbuntuPlugin kube_cmd settingBryn M. Reeves2019-10-081-6/+1
| | | | | | | | | Since the snap path for kubctl is always valid on Ubuntu don't test for the presence of the config file in setup(). Related: #1795 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kubernetes] separate Red Hat and Ubuntu Kubernetes pluginsBryn M. Reeves2019-10-081-31/+44
| | | | | | | | | | Separate the Red Hat and Ubuntu versions of the kubernetes plugin to account for differences in packaging and configuration paths. Related: #1654. Resolves: #1795. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kernel] Add collection of livepatch informationKamalesh Babulal2019-10-081-0/+1
| | | | | | | | | | | | | | Kernel livepatch support is available since, kernel version v4.0. Collect information relating to livepatch available under the path /sys/kernel/livepatch/. Each of the subdirectories following the path is a kernel livepatching module and hosts the information about the current patching state of the functions to be livepatched by the module. Resolves: #1794 Signed-off-by: Kamalesh Babulal <kamalesh@linux.ibm.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Copy empty directories _do_copy_pathsKamalesh Babulal2019-10-081-0/+4
| | | | | | | | | | | | | | Empty directories too provide some valid and helpful information in the path copied, for example, Kernel livepatching subsystem exports the functions being livepatched as empty directories instead of a file. Similarly disable directory of apparmor, which indicates the status of the profile. The current code copies a directory to the archive only if it contains files and skips in the case of an empty directory. This patch, copies such skipped directory too. Signed-off-by: Kamalesh Babulal <kamalesh@linux.ibm.com>
* [foreman,katello] collect db sizes only in foreman pluginPavel Moravec2019-10-082-42/+15
| | | | | | | | | | | | Collect foreman database sizes only in foreman plugin - in the more detailed format that katello plugin did. Further, stop collecting katello_repositories table as that can be bigger while providing less valuable information. Resolves: #1791 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [filesys] Capture /etc/mtab file.Kenneth D'souza2019-10-081-0/+1
| | | | | | | | | | | This will help us to know if /etc/mtab is a symblink to /proc/self/mounts. Helps in troubleshooting known issues of systemd and df. Resolves: #1790 Signed-off-by: Kenneth D'souza <kennethdsouza94@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [filesys] fix postprocessing for /etc/fstab passwords.Kenneth D'souza2019-10-081-1/+1
| | | | | | | | | | | | | | | | | | The current regex will replace the entire string after password= with * including the mount options. This patch fixes this issue by stopping the replacement when "," (mount option separator)is detected. Before patch: //cifs-server/share /mnt cifs username=user1,password=******** After patch: //cifs-sever/share /mnt cifs username=user1,password=********,nounix,vers=1.0 0 0 Resolves: #1789 Signed-off-by: Kenneth D'souza <kennethdsouza94@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ipa] collect ipa-healthcheck logsRob Crittenden2019-10-081-1/+2
| | | | | | | Resolves: #1782 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [zfs] Get zpool eventsNathaniel Clark2019-10-081-0/+1
| | | | | | | | | | Dump zpool events -v to see the history of what has happened to the zpool. Resolves: #1781 Signed-off-by: Nathaniel Clark <Nathaniel.Clark@misrule.us> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugin] add_copy_spec handle same file diff sizelimitdluong2019-10-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows add_copy_spec to handle the same file with the different size limits. For example: log = evm.log all_logs = *.log miq_log_dir = '/var/www/miq/vmdb/log/' self.add_copy_spec([ os.path.join(self.miq_log_dir, log) ], sizelimit=0) self.add_copy_spec([ os.path.join(self.miq_log_dir, x) for x in self.all_logs ]) Here, it would copy evm.log first with no sizelimit since add_copy_spec was called on 'log' first. It would then skip the next time it tries to get added from the glob contained in all_logs. Closes: #1786 Resolves: #1802 Signed-off by: David Luong <dluong@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [virtwho] collect /etc/virt-who.confPavel Moravec2019-10-081-2/+3
| | | | | | | | The most basic config file also matters :) Resolves: #1778 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [Plugin] simplify file and command cert substitution methodsBryn M. Reeves2019-10-081-41/+24
| | | | | | | | | | Simplify the methods for substituting file and command certificate data, and add a "desc" keyword argument allowing plugins to add a description of the data that was removed. Related: #1690 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] Add method to scrub certs/keys from collected filesJake Hunsaker2019-10-081-0/+29
| | | | | | | | | | | | | | | | | | | | | | | This adds a new do_file_private_sub() method to the Plugin class to allow for easy, and standardized scrubbing of private data such as certificates or key pairs from files collected by sos, in much the same way that do_cmd_private_sub() provides that functionality for command output. This method only takes a path or path regex representing the filename/pattern to match against. Matches are replaced with "-----SCRUBBED $thing" where $thing is the specific type of content being replaced as provided in the collected file content. For example, a private key would be replaced with "-----SCRUBBED RSA PRIVATE KEY-----". This is done so that support representatives can still know the type of information that was collected, without knowing the actual sensitive content. Resolves: #1690 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ovn_central] dont add db outputs when no table is found in schemaPavel Moravec2019-10-031-0/+2
| | | | | | | | | | When get_tables_from_schema method returns None (i.e. due to a parsing error or missing config file), add_database_output tries to iterate over None object, what raises an exception. Resolves: #1808 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [autofs]: obfuscate password in autofs maps.Rohan Sable2019-10-031-0/+7
| | | | | | | | | | | | | | This patch adds password scrubbing for autofs maps. Before patch: /etc/auto.test:test -fstype=cifs,username=test,password=passwd,test-opt /mnt After patch: /etc/auto.test:test -fstype=cifs,username=test,password=******,test-opt /mnt Resolves: #1809 Signed-off-by: Rohan Sable <rohanjsable@yahoo.com>
* [sosreport] calculate report digest incrementallyBryn M. Reeves2019-10-031-1/+6
| | | | | | | | | | Avoid reading the entire report archive into memory to calculate the archive digest: instead, read 1MiB at a time and update the in-memory checksum. Related: #1317, #1777 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosreport] Fix unhandled Out of Memory exceptionJose Castillo2019-10-031-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patches attempts to address the Memory Error exception thrown by sosreport when it attempts to compress the sosreport file. An example of the backtrace thrown is the following: Creating compressed archive... [archive:TarFileArchive] An error occurred compressing the archive: [Errno 12] Cannot allocate memory Traceback (most recent call last): File "/usr/sbin/sosreport", line 25, in <module> main(sys.argv[1:]) File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1637, in main sos.execute() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1616, in execute return self.final_work() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1529, in final_work checksum = self._create_checksum(archive, hash_name) File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1469, in _create_checksum digest.update(archive_fp.read()) MemoryError Closes: #1317 Resolves: #1777 Signed-off-by: Jose Castillo <jose.mfcastillo@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ceph] collect journal logs for ceph servicesPavel Moravec2019-10-031-0/+12
| | | | | | | | | Enable the plugin also by presence of either service, and collect journal logs of the services. Resolves: #1776 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [satellite] remove plugin for spacewalkPavel Moravec2019-10-031-77/+0
| | | | | | | | | | | | | | Spacewalk has and rhn has been replaced in favour of foreman/katello/candlepin/pulp. Currently the only usage of the plugin is on Satellite5 on RHEL6 and nowhere else. Other distros dont use it, spacewalk upstream does not use sosreport, so the removal wont affect anybody. And last but not least, the plugin name is confusing as it has nothing in common with Satellite6. Resolves: #1775 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [mrggrid,mrgmessg] remove obsolete pluginsPavel Moravec2019-10-032-51/+0
| | | | | | | | | | mrggrid was used for Condor / HTCondor but it hasn't been used for years. mrgmessg was meant for qpid C++ broker, what is covered by qpid plugin. Resolves: #1774 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [gluster] collect statedumps from /run directlyPavel Moravec2019-10-031-1/+1
| | | | | | | | | As /run being the default runtime directory for units, we should methodically generate statedumps to /run instead of /var/run. Resolves: #1773 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [gluster] process files only from a statedump dirPavel Moravec2019-10-021-1/+3
| | | | | | | | | Traversing statedump dir for statedump files must skip subdirectories (where the dump files won't appear). Resolves: #1812 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [grafana] Updates Grafana plugin to work on Debian and Ubuntu.Chris Johnston2019-10-011-3/+3
| | | | | | | | Closes: #1771 Resolves: #1772 Signed-off-by: Chris Johnston <chris.johnston@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [last] split lastlog per UID rangesEric Desrochers2019-10-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lastlog by default reports all users regardless of their UID and doesn't give any hints about UID. In some context, such as users obfuscation inside SOSCleaner, it is useful to know which users are part of which UID range so that we can then decide if this need to be obfuscated or not. Splitting the file by UID range will highly benefit SOSCleaner but I'm sure it could benefit other purposes as well. Reserves for dynamically allocated system users and groups. "lastlog -u 0-999" Min/max values for automatic uid selection in useradd. "lastlog -u 1000-60000", Centrally and statically allocates users and groups. "lastlog -u 60001-65536" Further reservations. "lastlog -u 65537-4294967295" https://en.wikipedia.org/wiki/User_identifier "The majority of modern Unix-like systems (e.g., Solaris-2.0 in 1990, Linux 2.4 in 2001) have switched to 32-bit UIDs, allowing 4,294,967,296 (232) unique IDs." Closes: #1743 Resolves: #1770 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [openstack_manila] Collect db version and protect passwordsGoutham Pacha Ravi2019-10-011-6/+18
| | | | | | | | | | | | | | - It'd be helpful to collect the database version used by the deployment for debug. - The password protection regex did not include all the plaintext password configuration options. - Add support to collect package versions for the verify mode of report collection. Resolves: #1759 Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [nginx] add new pluginMikel Olasagasti Uranga2019-10-011-0/+39
| | | | | | | | | | This adds a plugin for Nginx, a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache. Resolves: #1735 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [maas] obfuscate database passwordFelipe Reyes2019-10-011-0/+5
| | | | | | | | | | regiond.conf file contains the password used to connect to maas database, this change will remove it from the generated output. Resolves: #1734 Signed-off-by: Felipe Reyes <felipe.reyes@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>