sosreport / sos

A unified tool for collecting system logs and other debug information
http://sos.rtfd.org
GNU General Public License v2.0
512 stars 541 forks source link

[plugins] kill the 'foo bar qux for Blah Blah distributions' meme #397

Closed bmr-cymru closed 10 years ago

bmr-cymru commented 10 years ago

Lots of plugins have c'n'p duplicated class docstrings that embed a 'for Red Hat distributions..' or similar string. These are duplicative, unnecessary and look a real mess in plugin listings, e.g.:

The following plugins are currently disabled:

 abrt                 excluded       ABRT log dump
 acpid                excluded       acpid related information
 activemq             excluded       ActiveMQ related information
 anaconda             excluded       Anaconda / Installation information
 anacron              excluded       capture scheduled jobs information
 apache               excluded       Apache related information for Red Hat distributions
 auditd               excluded       Auditd related information
 autofs               inactive       autofs server-related on RedHat based distributions
 boot                 excluded       Bootloader information
 ceph                 inactive       information on CEPH
 cgroups              excluded       Red Hat specific cgroup subsystem information
 cluster              excluded       cluster suite and GFS related information
 cobbler              excluded       cobbler related information
 corosync             excluded       corosync information for RedHat based distribution
 cron                 excluded       Crontab information
 certificatesystem    excluded       Red Hat Certificate System 7.1, 7.3, 8.0 and dogtag related information
 ctdb                 inactive       Samba CTDB related information
 cups                 excluded       printing related information (cups)
 dbus                 excluded       dbus information
 dhcp                 excluded       DHCP related information for Red Hat based distributions
 distupgrade          excluded       Distribution upgrade data
 docker               excluded       Docker information
 dovecot              excluded       dovecot server related information for RedHat based distribution
 directoryserver      excluded       Directory Server information
 emc                  inactive       EMC related information (PowerPath, Solutions Enabler
    CLI and Navisphere CLI)
 firewalld            excluded       FirewallD information
 foreman              excluded       Foreman project related information
 gdm                  excluded       gdm related information
 general              excluded       Basic system information for RedHat based distributions
 grub                 excluded       Grub information
 grub2                excluded       Bootloader information
 haproxy              excluded       HAProxy information
 hardware             excluded       hardware related information
 hpasm                excluded       HP ASM (hp Server Management Drivers and Agent) information
 hardwaretestsuite    excluded       Red Hat Hardware Test Suite related information
 i18n                 excluded       Internationalization related information
 infiniband           excluded       Infiniband related information
 ipa                  excluded       IPA diagnostic information
 ipsec                excluded       ipsec related information for Red Hat distributions
 ipvs                 excluded       Ipvs information
 iscsitarget          inactive       iscsi-target related information for Red Hat distributions
 java                 excluded       basic java information
 katello              excluded       Katello project related information
 kdump                excluded       Kdump related information for Red Hat distributions
 keepalived           excluded       Keepalived information
 kernel               excluded       kernel related information
 kernelrt             excluded       Information specific to the realtime kernel
 krb5                 excluded       Kerberos related information
 kvm                  excluded       KVM related information
 ldap                 excluded       LDAP related information for RedHat based distribution
 libraries            excluded       information on shared libraries
 libvirt              excluded       libvirt-related information
 lilo                 excluded       Lilo information
 logrotate            excluded       logrotate configuration files and debug info
 logs                 excluded       Basic system information for RedHat based distributions
 lsbrelease           excluded       Linux Standard Base information
 memory               excluded       memory usage information
 mongodb              excluded       MongoDB related information for Red Hat distributions
 mrggrid              excluded       MRG GRID related information
 mrgmessg             excluded       MRG Messaging related information
 mysql                excluded       MySQL and MariaDB information for Red Hat based distributions
 named                excluded       named related information for RedHat based distribution
 networking           excluded       network related information for RedHat based distribution
 nfsserver            inactive       NFS server-related information
 nis                  excluded       NIS related information
 nscd                 excluded       NSCD related information
 ntp                  excluded       NTP related information for RedHat based distributions
 oddjob               excluded       oddjob related information
 openhpi              excluded       OpenHPI related information
 openshift            excluded       Openshift related information
 openssl              excluded       openssl related information for Red Hat distributions
 openstack_ceilometer excluded       OpenStackCeilometer related information for Red Hat distributions.
 openstack_cinder     excluded       OpenStack related information for Red Hat distributions
 openstack_glance     excluded       OpenStackGlance related information for Red Hat distributions.
 openstack_heat       excluded       OpenStackHeat related information for Red Hat distributions.
 openstack_horizon    excluded       OpenStack Horizon related information for Red Hat distributions
 openstack_keystone   excluded       OpenStack Keystone related information for Red Hat distributions
 neutron              excluded       OpenStack Neutron related information for Red Hat distributions
 openstack_nova       excluded       OpenStack nova related information for Red Hat distributions
 openstack_swift      excluded       OpenStackSwift related information for Red Hat distributions.
 openswan             excluded       ipsec related information
 openvswitch          excluded       OpenVSwitch on Ubuntu/Debian related information
 ovirt                excluded       oVirt Engine related information
 ovirt_hosted_engine  excluded       oVirt Hosted Engine related information
 pam                  excluded       PAM related information for RedHat based distribution
 pci                  excluded       PCI device related information
 pcp                  excluded       Collect Performance Co-Pilot data
 postfix              excluded       mail server related information for RedHat based distributions
 postgresql           excluded       PostgreSQL related information for Red Hat distributions
 powerpc              excluded       IBM Power System related information
 ppp                  excluded       ppp, wvdial and rp-pppoe related information
 process              excluded       process information
 processor            excluded       CPU information
 psacct               excluded       Process accounting related information for RedHat based distributions
 pxe                  excluded       PXE related information for RedHat based distributions
 python               excluded       Python_Version information.
 qpid                 excluded       Messaging related information
 quagga               excluded       quagga related information
 rabbitmq             excluded       rabbitmq related information
 radius               excluded       radius related information on Red Hat distributions
 rhevm                excluded       RHEV-Manager related information
 rhui                 excluded       Red Hat Update Infrastructure for Cloud Providers data
 rpm                  excluded       RPM information
 s390                 excluded       s390 related information
 samba                excluded       Samba related information
 sanlock              excluded       sanlock-related information
 sar                  excluded       Collect system activity reporter data
 satellite            excluded       RHN Satellite and Spacewalk related information
 selinux              excluded       selinux related information
 sendmail             excluded       sendmail information for RedHat based distributions
 smartcard            excluded       Smart Card related information
 snmp                 excluded       snmp related information for RedHat based distributions
 soundcard            excluded       Sound card information for RedHat distros
 squid                excluded       squid Red Hat related information
 ssh                  excluded       ssh-related information
 sssd                 excluded       sssd-related Diagnostic Information on Red Hat based distributions
 startup              excluded       startup information for RedHat based distributions
 sunrpc               inactive       Sun RPC related information for Red Hat systems
 system               excluded       core system related information
 systemd              excluded       Information on systemd and related subsystems
 systemtap            excluded       SystemTap information
 sysvipc              excluded       SysV IPC related information
 test                 excluded       Test plugin
 tftpserver           excluded       tftpserver related information
 tomcat               excluded       Tomcat related information
 tuned                excluded       Tuned related information
 udev                 excluded       Udev related information
 upstart              excluded       Information on Upstart, the event-based init system.
 usb                  excluded       USB device related information
 veritas              inactive       Veritas related information
 vmware               excluded       VMWare related information
 vsftpd               excluded       FTP server related information
 x11                  excluded       X related information
 xen                  excluded       Xen related information
 xinetd               excluded       xinetd information
 yum                  excluded       yum information

At the very least I think we can expect our users to know what distro they are running on (we print its name in the banner message! :-). I suggest we drop all of this crap and start aiming for a maximum of 42 chars in the Plugin docstring - this is what we need to stick to to not have any extra line breaks on a standard 80x25 terminal.

It looks much nicer:

# sosreport --list-plugins --profile=storage

sosreport (version 3.2)

plugin autofs does not install, skipping: invalid syntax (autofs.py, line 67)
plugin dhcp does not install, skipping: invalid syntax (dhcp.py, line 41)
The following plugins are currently enabled:

 ata                  ATA and IDE related information (including PATA and SATA)
 block                Block device related information
 devicemapper         device-mapper related information
 dmraid               dmraid related information
 fcoe                 fcoe related information
 filesys              information on filesystems
 gluster              gluster related information
 iscsi                iscsi-initiator related information Red Hat based distributions
 lvm2                 lvm2 related information
 md                   MD subsystem information
 megacli              Information for devices which use the MegaRAID Unified device driver
 multipath            device-mapper multipath information
 nfs                  NFS related information
 scsi                 hardware related information
 xfs                  information on the XFS filesystem

The following plugins are currently disabled:

 abrt                 excluded       ABRT log dump
 acpid                excluded       acpid related information
 activemq             excluded       ActiveMQ related information
 anaconda             excluded       Anaconda / Installation information
 anacron              excluded       capture scheduled jobs information
 apache               excluded       Apache related information
 auditd               excluded       Auditd related information
 boot                 excluded       Bootloader information
 ceph                 inactive       information on CEPH
 cgroups              excluded       Red Hat specific cgroup subsystem information
 cluster              excluded       cluster suite and GFS related information
 cobbler              excluded       cobbler related information
 corosync             excluded       corosync information
 cron                 excluded       Crontab information
 certificatesystem    excluded       Red Hat Certificate System and Dogtag
 ctdb                 inactive       Samba CTDB related information
 cups                 excluded       printing related information (cups)
 dbus                 excluded       dbus information
 distupgrade          excluded       Distribution upgrade data
 docker               excluded       Docker information
 dovecot              excluded       dovecot server related information
 directoryserver      excluded       Directory Server information
 emc                  inactive       EMC related information
 firewalld            excluded       FirewallD information
 foreman              excluded       Foreman project related information
 gdm                  excluded       gdm related information
 general              excluded       Basic system information
 grub                 excluded       Grub information
 grub2                excluded       Bootloader information
 haproxy              excluded       HAProxy information
 hardware             excluded       hardware related information
 hpasm                excluded       HP Advanced Server Management
 hardwaretestsuite    excluded       Red Hat Hardware Test Suite related information
 i18n                 excluded       Internationalization related information
 infiniband           excluded       Infiniband related information
 ipa                  excluded       IPA diagnostic information
 ipsec                excluded       ipsec related information
 ipvs                 excluded       Ipvs information
 iscsitarget          inactive       iscsi-target related information
 java                 excluded       basic java information
 katello              excluded       Katello project related information
 kdump                excluded       Kdump related information
 keepalived           excluded       Keepalived information
 kernel               excluded       kernel related information
 kernelrt             excluded       Information specific to the realtime kernel
 krb5                 excluded       Kerberos related information
 kvm                  excluded       KVM related information
 ldap                 excluded       LDAP related information
 libraries            excluded       information on shared libraries
 libvirt              excluded       libvirt-related information
 lilo                 excluded       Lilo information
 logrotate            excluded       logrotate configuration files and debug info
 logs                 excluded       Basic system information
 lsbrelease           excluded       Linux Standard Base information
 memory               excluded       memory usage information
 mongodb              excluded       MongoDB related information
 mrggrid              excluded       MRG GRID related information
 mrgmessg             excluded       MRG Messaging related information
 mysql                excluded       MySQL and MariaDB information
 named                excluded       named related information
 networking           excluded       network related information
 nfsserver            inactive       NFS server-related information
 nis                  excluded       NIS related information
 nscd                 excluded       NSCD related information
 ntp                  excluded       NTP related information
 oddjob               excluded       oddjob related information
 openhpi              excluded       OpenHPI related information
 openshift            excluded       Openshift related information
 openssl              excluded       openssl related information
 openstack_ceilometer excluded       OpenStackCeilometer related information.
 openstack_cinder     excluded       OpenStack related information
 openstack_glance     excluded       OpenStackGlance related information.
 openstack_heat       excluded       OpenStackHeat related information.
 openstack_horizon    excluded       OpenStack Horizon related information
 openstack_keystone   excluded       OpenStack Keystone related information
 neutron              excluded       OpenStack Neutron related information
 openstack_nova       excluded       OpenStack nova related information
 openstack_swift      excluded       OpenStackSwift related information.
 openswan             excluded       ipsec related information
 openvswitch          excluded       OpenVSwitch on Ubuntu/Debian related information
 ovirt                excluded       oVirt Engine related information
 ovirt_hosted_engine  excluded       oVirt Hosted Engine related information
 pam                  excluded       PAM related information
 pci                  excluded       PCI device related information
 pcp                  excluded       Collect Performance Co-Pilot data
 postfix              excluded       mail server related information
 postgresql           excluded       PostgreSQL related information
 powerpc              excluded       IBM Power System related information
 ppp                  excluded       ppp, wvdial and rp-pppoe related information
 process              excluded       process information
 processor            excluded       CPU information
 psacct               excluded       Process accounting related information
 pxe                  excluded       PXE related information
 python               excluded       Python_Version information.
 qpid                 excluded       Messaging related information
 quagga               excluded       quagga related information
 rabbitmq             excluded       rabbitmq related information
 radius               excluded       radius related information on Red Hat distributions
 rhevm                excluded       RHEV-Manager related information
 rhui                 excluded       Red Hat Update Infrastructure for Cloud Providers data
 rpm                  excluded       RPM information
 s390                 excluded       s390 related information
 samba                excluded       Samba related information
 sanlock              excluded       sanlock-related information
 sar                  excluded       Collect system activity reporter data
 satellite            excluded       RHN Satellite and Spacewalk related information
 selinux              excluded       selinux related information
 sendmail             excluded       sendmail information
 smartcard            excluded       Smart Card related information
 snmp                 excluded       snmp related information
 soundcard            excluded       Sound card information
 squid                excluded       squid Red Hat related information
 ssh                  excluded       ssh-related information
 sssd                 excluded       sssd-related Diagnostic Information
 startup              excluded       startup information
 sunrpc               inactive       Sun RPC related information
 system               excluded       core system related information
 systemd              excluded       Information on systemd and related subsystems
 systemtap            excluded       SystemTap information
 sysvipc              excluded       SysV IPC related information
 test                 excluded       Test plugin
 tftpserver           excluded       tftpserver related information
 tomcat               excluded       Tomcat related information
 tuned                excluded       Tuned related information
 udev                 excluded       Udev related information
 upstart              excluded       Information on the Upstart init system
 usb                  excluded       USB device related information
 veritas              inactive       Veritas related information
 vmware               excluded       VMWare related information
 vsftpd               excluded       FTP server related information
 x11                  excluded       X related information
 xen                  excluded       Xen related information
 xinetd               excluded       xinetd information
 yum                  excluded       yum information

The following plugin options are available:

 dmraid.metadata           off             capture dmraid device metadata
 filesys.lsof              off             gathers information on all open files
 filesys.dumpe2fs          off             dump filesystem information
 lvm2.lvmdump              off             collect an lvmdump tarball
 lvm2.lvmdump-am           off             attempt to collect an lvmdump with advanced options and raw metadata collection
 xfs.logprint              off             gathers the log information
bmr-cymru commented 10 years ago

This also means dropping sub-class docstrings - this is fine as we've had the code for some time to go fetch the superclass docstring in the case that a leaf class does not define it.

bmr-cymru commented 10 years ago

Fixed in commit 9bfe802:

commit 9bfe802436f5707b38bfbcf83795ee0629939542
Author: Bryn M. Reeves <bmr@redhat.com>
Date:   Sun Sep 14 20:05:55 2014 +0100

    [plugins] improve plugin class docstrings

    Plugin class docstrings should be a brief (42 characters or less)
    description of the component the plugin supports. This is needed
    since the class docstring is displayed in the table of enabled
    plugins when running 'sosreport --list-plugins'.

    Class docstrings should not describe the distribution a particular
    class runs on; this is redundant since only plugins tagges with a
    class matching the running policy will be displayed.

    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>