sosreport / sos

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

[sosreport] Confusing output with --profile and an invalid profile name #733

Closed pmoravec closed 8 years ago

pmoravec commented 8 years ago

When providing an invalid profile name, list of profiles is printed. But with empty list of plugins (in particular with list of enabled plugins, cf. output of sosreport --batch --profile networ,packagemanager vs. sosreport --batch --profile networ). That confusingly suggests sosreport does not have plugins (associated with the profiles).

In this situation, rather the output of sosreport --list-plugins / sosreport --list-profiles should be provided.

(btw. on my system, both --list-[plugins|profiles] provides the same output - is that expected i general?)

bmr-cymru commented 8 years ago

I'm a bit unclear on the problem here. In the original bug report it sounded like the reporter was expecting to see plugins listed for each profile in the output - that was never what was intended for an unknown profile:

# sosreport --batch --profile qux

sosreport (version 3.2)

Unknown or inactive profile(s) provided: qux
The following profiles are available:

 boot            
 cluster         
 debug           
 desktop         
 hardware        
 identity        
 java            
 kernel          
 mail            
 memory          
 mrg             
 network         
 nfs             
 openshift       
 openstack       
 packagemanager  
 performance     
 sap             
 security        
 services        
 storage         
 sysmgmt         
 system          
 virt            
 webserver       

 25 profiles, 0 plugins

This is all described in the man page:

       -l, --list-plugins
              List all available plugins and their options. Plug-ins that would not be
              enabled by the current configuration are listed separately.
       --list-profiles
              Display a list of available profiles and the plugins that they enable.

There is a bug here - it's silly to print , 0 plugins for this case - there are zero plugins available since no plugin is a member of the non-existent profile specified. We should just not output the 2nd part of the message for this case.

I don't think we should attempt to print plugin lists in this case anyway - the idea is to give a reasonably terse list of profiles for the user to chose from.

(btw. on my system, both --list-[plugins|profiles] provides the same output - is that expected i general?)

They shouldn't. On my RHEL7 boxes (sos-3.2-35.el7) I see:

# sosreport --list-plugins

sosreport (version 3.2)

The following plugins are currently enabled:

 abrt                 Automatic Bug Reporting Tool
 acpid                ACPI daemon information
 anaconda             Anaconda installer
 anacron              Anacron job scheduling service
 apache               Apache http daemon
 ata                  ATA and IDE information
 auditd               Audit daemon information
 autofs               Autofs on-demand automounter
 block                Block device information
 boot                 Bootloader information
 ceph                 CEPH distributed storage
 cgroups              Control groups subsystem
 chrony               Chrony clock (for Network time protocol)
 cluster              Red Hat Cluster High Availability and GFS2
 corosync             Corosync cluster engine
 cron                 Cron job scheduler
 certificatesystem    Certificate System and Dogtag
 ctdb                 Samba Clustered TDB
 dbus                 D-Bus message bus
 devicemapper         device-mapper framework
 devices              devices specific commands
 dmraid               dmraid software RAID
 directoryserver      Directory Server
 etcd                 etcd plugin
 filesys              Local file systems
 firewalld            Firewall daemon
 foreman              Foreman/Satellite 6 systems management
 gdm                  GNOME display manager
 general              general system information
 grub2                GRUB2 bootloader
 haproxy              HAProxy load balancer
 hardware             General hardware information
 hardwaretestsuite    Red Hat Hardware Test Suite
 i18n                 Internationalization
 ipa                  Identity, policy, audit
 ipvs                 Linux IP virtual server
 java                 Java runtime
 kdump                Kdump crash dumps
 kernel               Linux kernel
 keyutils             Kernel key ring
 kpatch               Kpatch information
 krb5                 Kerberos authentication
 kubernetes           Kubernetes plugin
 last                 login information
 ldap                 LDAP configuration
 libraries            Dynamic shared libraries
 libvirt              libvirt virtualization API
 logrotate            LogRotate service
 logs                 System logs
 lsbrelease           Linux standard base
 lvm2                 LVM2 volume manager
 md                   MD RAID subsystem
 megacli              LSI MegaRAID devices
 memory               Memory configuration and use
 mrggrid              MRG GRID engine
 mrgmessg             MRG Messaging subsystem
 multipath            Device-mapper multipath tools
 mysql                MySQL and MariaDB RDBMS
 networking           network and device configuration
 nfs                  Network file system information
 nis                  Network information service
 ntp                  Network time protocol
 oddjob               OddJob task scheduler
 openhpi              Open Hardware Platform Interface
 openshift            Openshift node and broker
 openssl              openssl related information
 openswan             Openswan IPsec
 pam                  Pluggable Authentication Modules
 pci                  PCI devices
 postfix              Postfix smtp server
 postgresql           PostgreSQL RDBMS
 ppp                  Point-to-point protocol
 process              process information
 processor            CPU information
 psacct               Process accounting information
 puppet               Puppet service
 python               Python runtime
 rpm                  RPM Package Manager
 samba                Samba Windows interoperability
 sapnw                SAP NetWeaver
 sar                  System Activity Reporter
 scsi                 SCSI devices
 selinux              SELinux access control
 services             System services
 snmp                 Simple network management protocol
 soundcard            Sound devices
 ssh                  Secure shell service
 sssd                 System security service daemon
 system               core system information
 systemd              System management daemon
 systemtap            SystemTap dynamic instrumentation
 sysvipc              SysV IPC
 teamd                Network interface teaming
 timeout              Timeout test plugin
 tomcat               Apache Tomcat server
 tuned                Tuned system tuning daemon
 udev                 udev dynamic device management
 usb                  USB devices
 vhostmd              vhostmd virtualization metrics collection
 x11                  X windowing system
 xen                  Xen virtualization
 xfs                  XFS filesystem
 yum                  yum information

The following plugins are currently disabled:

 activemq             inactive       ActiveMQ message broker
 cobbler              inactive       Cobbler installation server
 cups                 inactive       CUPS IPP print service
 dhcp                 inactive       DHCP daemon
 distupgrade          inactive       Distribution upgrade data
 docker               inactive       Docker containers
 dovecot              inactive       dovecot server related information
 fcoe                 inactive       Fibre Channel over Ethernet
 gluster              inactive       GlusterFS storage
 grub                 inactive       GRUB bootloader
 hpasm                inactive       HP Advanced Server Management
 infiniband           inactive       Infiniband data
 iprconfig            inactive       IBM Power RAID storage adapter configuration information
 ipsec                inactive       Internet protocol security
 iscsi                inactive       iSCSI initiator
 iscsitarget          inactive       iSCSI target
 keepalived           inactive       Keepalived routing server
 kernelrt             inactive       Realtime kernel variant
 kimchi               inactive       kimchi-related information
 kvm                  inactive       Kernel virtual machine
 lilo                 inactive       Lilo bootloader
 mongodb              inactive       MongoDB document database
 mpt                  inactive       LSI Message Passing Technology
 named                inactive       BIND named server
 navicli              inactive       EMC Navicli
 nfsserver            inactive       NFS server information
 nscd                 inactive       Name service caching daemon
 numa                 inactive       NUMA state and configuration
 openstack_ceilometer inactive       Openstack Ceilometer
 openstack_cinder     inactive       OpenStack cinder
 openstack_glance     inactive       OpenStack Glance
 openstack_heat       inactive       OpenStack Heat
 openstack_horizon    inactive       OpenStack Horizon
 openstack_keystone   inactive       OpenStack Keystone
 openstack_neutron    inactive       OpenStack Networking
 openstack_nova       inactive       OpenStack Nova
 openstack_sahara     inactive       OpenStack sahara related information for Red Hat distributions.
 openstack_swift      inactive       OpenStack Swift
 openstack_trove      inactive       OpenStack Trove
 openvswitch          inactive       OpenVSwitch networking
 ovirt                inactive       oVirt Engine
 ovirt_hosted_engine  inactive       oVirt Hosted Engine
 pcp                  inactive       Performance Co-Pilot data
 powerpath            inactive       EMC PowerPath
 powerpc              inactive       IBM Power systems
 ptp                  inactive       Precision time protocol
 pxe                  inactive       PXE service
 qpid                 inactive       Qpid messaging
 quagga               inactive       Quagga routing service
 rabbitmq             inactive       RabbitMQ messaging service
 radius               inactive       RADIUS service information
 rhui                 inactive       Red Hat Update Infrastructure
 s390                 inactive       IBM S/390
 sanlock              inactive       SANlock daemon
 saphana              inactive       SAP HANA
 satellite            inactive       RHN Satellite and Spacewalk
 sendmail             inactive       sendmail service
 smartcard            inactive       PKCS#11 smart cards
 squid                inactive       Squid caching proxy
 ssmtp                inactive       sSMTP information
 sunrpc               inactive       Sun RPC service
 symcli               inactive       EMC Symcli
 tftpserver           inactive       TFTP server
 upstart              inactive       Upstart init system
 vendor_binaries      optional       Find non rpm packages and binaries present on system
 veritas              inactive       Veritas software
 virsh                inactive       client for libvirt virtualization API
 vmware               inactive       VMWare client information
 vsftpd               inactive       Vsftpd server
 xinetd               inactive       xinetd information

The following plugin options are available:

 abrt.backtraces           off             collect backtraces for every report
 apache.log                off             gathers all apache logs
 boot.all-images           off             collect lsinitrd for all images
 ceph.log                  off             gathers all ceph logs
 cluster.gfs2lockdump      off             gather output of gfs2 lockdumps
 cluster.crm_from          off             specify the start time for crm_report
 cluster.lockdump          off             gather dlm lockdumps
 cluster.crm_scrub         on              enable password scrubbing for crm_report
 dmraid.metadata           off             capture dmraid device metadata
 filesys.lsof              off             gathers information on all open files
 filesys.dumpe2fs          off             dump filesystem information
 kubernetes.podslog        off             capture logs for pods
 libraries.ldconfigv       off             collect verbose ldconfig output
 logs.log_days             3               the number of days logs to collect
 lvm2.lvmdump              off             collect an lvmdump tarball
 lvm2.lvmdump-am           off             attempt to collect an lvmdump with advanced options and raw metadata collection
 mysql.dbuser              mysql           username for database dumps
 mysql.dbpass              off             password for database dumps (password visible in process listings)
 mysql.dbdump              off             collect a database dump
 networking.traceroute     off             collects a traceroute to www.example.com
 openshift.broker          off             Gathers broker specific files
 openshift.node            off             Gathers node specific files
 openswan.ipsec-barf       off             collect the output of the ipsec barf command
 postgresql.pghome         /var/lib/pgsql  PostgreSQL server home directory.
 postgresql.username       postgres        username for pg_dump
 postgresql.password       off             password for pg_dump (password visible in process listings)
 postgresql.dbname                         database name to dump for pg_dump
 postgresql.dbhost                         database hostname/IP (do not use unix socket)
 postgresql.dbport         5432            database server port number
 psacct.all                off             collect all process accounting files
 rpm.rpmq                  on              queries for package information via rpm -q
 rpm.rpmva                 off             runs a verify on all packages
 sar.all_sar               off             gather all system activity records
 selinux.fixfiles          off             Print incorrect file context labels
 selinux.list              off             List objects and their context
 services.servicestatus    off             get a status of all running services
 xfs.logprint              off             gathers the log information
 yum.yumlist               off             list repositories and packages
 yum.yumdebug              off             gather yum debugging data

 Profiles: boot, cluster, debug, desktop, hardware, identity, java, 
           kernel, mail, memory, mrg, network, nfs, openshift, 
           openstack, packagemanager, performance, sap, security, 
           services, storage, sysmgmt, system, virt, webserver

 25 profiles, 103 plugins

vs.:

# sosreport --list-profiles

sosreport (version 3.2)

The following profiles are available:

 boot            boot, devices, grub2, services, systemd, udev
 cluster         cluster, corosync, ctdb, ipvs
 debug           abrt, hardwaretestsuite, kdump, systemtap
 desktop         gdm, soundcard, x11
 hardware        acpid, ata, block, devices, dmraid, hardware, kernel, 
                 logs, megacli, memory, multipath, networking, openhpi, 
                 pci, processor, scsi, soundcard, teamd, udev, usb, x11
 identity        certificatesystem, directoryserver, ipa, krb5, ldap, 
                 nis, pam, ssh, sssd
 java            java, tomcat
 kernel          kernel, keyutils, system
 mail            postfix
 memory          memory, processor
 mrg             mrggrid, mrgmessg
 network         firewalld, ipvs, networking, nfs, openssl, openswan, 
                 ppp, teamd
 nfs             autofs, nfs
 openshift       apache, openshift, selinux
 openstack       
 packagemanager  rpm, yum
 performance     sar, systemtap, tuned
 sap             sapnw, vhostmd
 security        auditd, certificatesystem, keyutils, openssl, openswan, 
                 pam, selinux, ssh, sssd
 services        chrony, mysql, nis, ntp, oddjob, postfix, postgresql, 
                 puppet, samba, ssh, sssd, systemd, sysvipc, tomcat
 storage         ata, autofs, block, ceph, ctdb, devicemapper, dmraid, 
                 filesys, keyutils, lvm2, md, megacli, multipath, nfs, 
                 scsi, xfs
 sysmgmt         foreman, general, ldap, oddjob, snmp, yum
 system          abrt, anaconda, anacron, auditd, boot, cgroups, chrony, 
                 cron, dbus, devices, general, hardware, i18n, kdump, 
                 kernel, keyutils, krb5, last, ldap, libraries, libvirt, 
                 logrotate, logs, lsbrelease, megacli, memory, 
                 multipath, networking, ntp, openhpi, pam, pci, ppp, 
                 process, processor, psacct, python, rpm, sar, selinux, 
                 services, snmp, system, systemd, sysvipc, tuned, udev, 
                 vhostmd, yum
 virt            ceph, libvirt, openshift, vhostmd, xen
 webserver       apache, haproxy, java, tomcat

 25 profiles, 103 plugins

So --list-plugins gives:

Where --list-profiles gives:

bmr-cymru commented 8 years ago

So that's a very long explanation for why I'm intending to fix the , 0 plugins message but nothing else for this issue :-)