웹사이트 검색

Ubuntu 18.04 LTS에서 sosreport를 설치하고 사용하는 방법


이 페이지에서

  1. 요구 사항\n
  2. Sosreport 생성
  3. 특정 플러그인에 대한 sosreport 생성\n

SOS는 Unix 계열 운영 체제에서 시스템 구성 세부 정보 및 진단 정보를 수집하는 데 사용할 수 있는 무료 오픈 소스 데이터 수집 도구입니다. 시스템 구성 및 로그 정보를 수집하여 단일 파일로 보관하는 방식으로 작동합니다. 일반적으로 기술 지원 엔지니어가 시스템의 문제를 찾는 데 사용됩니다.

이 튜토리얼에서는 Ubuntu 18.04 서버에서 SOS를 사용하는 방법을 배웁니다.

요구 사항

  • Ubuntu 18.04를 실행하는 서버.\n
  • 루트 비밀번호가 서버에 설정됩니다.\n

소스 보고서 생성

기본적으로 SOS 도구는 Ubuntu 18.04 서버에서 사용할 수 있습니다. 따라서 서버에 설치할 필요가 없습니다.

시스템 구성 세부 정보 및 기타 진단 정보를 수집하려면 다음 명령을 실행하십시오.

sosreport

산출:

sosreport (version 3.5)

This command will collect system configuration and diagnostic
information from this Ubuntu system. An archive containing the collected
information will be generated in /tmp/sos.91hh07wb.

For more information on Ubuntu visit:

  http://www.ubuntu.com/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [ubuntu1804]: 
Please enter the case id that you are generating this report for []: 

 Setting up archive ...
 Setting up plugins ...
 Running plugins. Please wait ...

  Running 61/61: xfs...                 
Creating compressed archive...

Your sosreport has been generated and saved in:
  /tmp/sosreport-ubuntu1804-20190130103134.tar.xz

The checksum is: 180c9e539b00c626d84fc055df5fb864

Please send this file to your support representative.

위의 명령은 이 시스템에서 시스템 구성 및 진단 정보를 수집하여 /tmp 디렉토리에 저장합니다.

다음 명령을 실행하여 sosreport를 생성하고 다른 위치에 저장할 수도 있습니다.

sosreport --tmp-dir /opt

기본적으로 sosreport는 xz 형식으로 압축됩니다. 다음 명령을 사용하여 gzip에서 sosreport를 압축하려면:

sosreport --compression-type gzip

특정 플러그인에 대한 sosreport 생성

기본적으로 sosreport는 많은 플러그인과 함께 제공됩니다. 다음 명령을 사용하여 모든 플러그인을 나열할 수 있습니다.

sosreport -l

다음 출력이 표시되어야 합니다.

sosreport (version 3.5)

The following plugins are currently enabled:

 acpid                ACPI daemon information
 apache               Apache http daemon
 apparmor             Apparmor mandatory access control
 apport               Apport crash reporting tool
 apt                  APT - advanced packaging tool
 ata                  ATA and IDE information
 block                Block device information
 boot                 Bootloader information
 btrfs                Btrfs filesystem
 cgroups              Control groups subsystem
 cron                 Cron job scheduler
 crypto               System crypto services information
 date                 Basic system time information
 dbus                 D-Bus message bus
 devicemapper         device-mapper framework
 devices              devices specific commands
 dpkg                 Debian Package Management
 filesys              Local file systems
 hardware             General hardware information
 host                 Host information
 i18n                 Internationalization
 iscsi                iSCSI initiator
 java                 Java runtime
 kernel               Linux kernel
 last                 login information
 libraries            Dynamic shared libraries
 libvirt              libvirt virtualization API
 logrotate            LogRotate service
 logs                 System logs
 lvm2                 LVM2 volume manager
 lxd                  LXD is a containers hypervisor.
 md                   MD RAID subsystem
 memory               Memory configuration and use
 multipath            Device-mapper multipath tools
 mysql                MySQL and MariaDB RDBMS
 networking           network and device configuration
 openssl              openssl related information for Debian distributions
 pam                  Pluggable Authentication Modules
 pci                  PCI devices
 perl                 Perl runtime
 procenv              Process environment
 process              process information
 processor            CPU information
 release              Linux release information
 scsi                 SCSI devices
 services             System services
 snappy               Snap packages
 soundcard            Sound devices
 ssh                  Secure shell service
 system               core system information
 systemd              System management daemon
 sysvipc              SysV IPC
 ubuntu               Ubuntu specific information
 udev                 udev dynamic device management
 usb                  USB devices
 wireless             Wireless
 x11                  X windowing system
 xfs                  XFS filesystem

The following plugins are currently disabled:

 activemq             inactive       ActiveMQ message broker
 anacron              inactive       Anacron job scheduling service
 ansible              inactive       Ansible configuration management
 auditd               inactive       Audit daemon information
 autofs               inactive       Autofs on-demand automounter
 azure                inactive       Microsoft Azure client
 canonical_livepatch  inactive       Canonical Livepatch Service
 ceph                 inactive       CEPH distributed storage
 ceph_ansible         inactive       CEPH distributed storage - Ansible installer
 clear_containers     inactive       Intel(R) Clear Containers configuration
 cobbler              inactive       
 collectd             inactive       Collectd config collector
 conntrackd           inactive       conntrackd - netfilter connection tracking user-space daemon
 corosync             inactive       Corosync cluster engine
 ctdb                 inactive       Samba Clustered TDB
 cups                 inactive       CUPS IPP print service
 dhcp                 inactive       DHCP daemon
 dlm                  inactive       DLM (Distributed lock manager)
 dmraid               inactive       dmraid software RAID
 docker               inactive       Docker containers
 dovecot              inactive       dovecot server related information for Debian based distribution
 elastic              inactive       ElasticSearch service
 gdm                  inactive       GNOME display manager
 gfs2                 inactive       GFS2 (Global Filesystem 2)
 grub                 inactive       GRUB bootloader
 grub2                inactive       GRUB2 bootloader
 haproxy              inactive       HAProxy load balancer
 hpasm                inactive       HP Advanced Server Management
 infiniband           inactive       Infiniband data
 ipmitool             inactive       IpmiTool hardware information.
 iprconfig            inactive       IBM Power RAID storage adapter configuration information
 ipsec                inactive       Internet protocol security
 ipvs                 inactive       Linux IP virtual server
 iscsitarget          inactive       iSCSI target
 juju                 inactive       Juju orchestration tool
 kata_containers      inactive       Kata Containers configuration
 kdump                inactive       Kdump crash dumps
 kimchi               inactive       kimchi-related information
 krb5                 inactive       Kerberos authentication
 kvm                  inactive       Kernel virtual machine
 landscape            inactive       Ubuntu Landscape client
 ldap                 inactive       LDAP configuration
 lightdm              inactive       Light Display Manager
 lilo                 inactive       Lilo bootloader
 lstopo               inactive       lstopo / machine topology/numa node information
 maas                 inactive       Ubuntu Metal-As-A-Service
 memcached            inactive       memcached distributed memory caching system
 mongodb              inactive       MongoDB document database
 mpt                  inactive       LSI Message Passing Technology
 named                inactive       BIND named server
 networkmanager       inactive       NetworkManager service configuration
 nfs                  inactive       Network file system information
 nfsganesha           inactive       NFS-Ganesha file server information
 nis                  inactive       Network information service
 nodejs               inactive       Ubuntu/Debian require nodejs-legacy package in order to
    have a node executable
 npm                  inactive       Get info about available npm modules
 nscd                 inactive       Name service caching daemon
 nss                  inactive       Network Security Services configuration
 ntp                  inactive       Network time protocol
 numa                 inactive       NUMA state and configuration
 nvme                 inactive       Collect config and system information about NVMe devices
 omsa                 inactive       Dell OpenManage Server Administrator (OMSA)
 opencl               inactive       OpenCL
 opengl               inactive       OpenGL
 openstack_ansible    inactive       OpenStack-Ansible sos plugin.
 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_ironic     inactive       OpenStack Ironic
 openstack_keystone   inactive       OpenStack Keystone
 openstack_manila     inactive       OpenStackManila related information for Debian based distributions.
 openstack_neutron    inactive       OpenStack Networking
 openstack_nova       inactive       OpenStack Nova
 openstack_octavia    inactive       Openstack Octavia
 openstack_sahara     inactive       OpenStackSahara related information for Debian based distributions.
 openstack_swift      inactive       OpenStack Swift
 openstack_trove      inactive       OpenStack Trove
 openswan             inactive       Openswan IPsec
 openvswitch          inactive       OpenVSwitch networking
 os_net_config        inactive       OpenStack Net Config
 ovn_central          inactive       OVN Northd
 ovn_host             inactive       OVN Controller
 pacemaker            inactive       Pacemaker high-availability cluster resource manager
 pcp                  inactive       Performance Co-Pilot data
 postfix              inactive       Postfix smtp server
 postgresql           inactive       PostgreSQL RDBMS
 powerpc              inactive       IBM Power systems
 ppp                  inactive       Point-to-point protocol
 acct                 inactive       Process accounting information
 ptp                  inactive       Precision time protocol
 puppet               inactive       Puppet service
 pxe                  inactive       PXE service
 python               inactive       Python runtime
 rabbitmq             inactive       RabbitMQ messaging service
 radius               inactive       RADIUS service information
 s390                 inactive       IBM S/390
 salt                 inactive       Salt
 saltmaster           inactive       Salt Master
 samba                inactive       Samba Windows interoperability
 sar                  inactive       System Activity Reporter
 sas3ircu             inactive       SAS-3 Integrated RAID adapter information
 sendmail             inactive       sendmail service
 snmp                 inactive       Simple network management protocol
 squid                inactive       Squid caching proxy
 sssd                 inactive       System security service daemon
 storageconsole       inactive       Red Hat Storage Console
 sunrpc               inactive       Sun RPC service
 systemtap            inactive       SystemTap dynamic instrumentation
 targetcli            inactive       TargetCLI TCM/LIO configuration
 teamd                inactive       Network interface teaming
 unity                inactive       Unity
 upstart              inactive       Upstart init system
 virsh                inactive       client for libvirt virtualization API
 vulkan               inactive       Vulkan
 xinetd               inactive       xinetd information
 zfs                  inactive       ZFS filesystem

The following plugin options are available:

 apache.log                off             gathers all apache logs
 boot.all-images           off             collect lsinitrd for all images
 filesys.lsof              off             gathers information on all open files
 filesys.dumpe2fs          off             dump filesystem information
 filesys.frag              off             filesystem fragmentation status
 kernel.with-timer         off             gather /proc/timer* statistics
 libraries.ldconfigv       off             collect verbose ldconfig output
 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             collect a traceroute to www.example.com
 process.lsof-threads      off             gathers threads' open file info if supported
 services.servicestatus    off             get a status of all running services

 Profiles: boot, container, debug, desktop, hardware, identity, java, 
           kernel, memory, network, openshift, packagemanager, perl, 
           security, services, storage, sysmgmt, system, virt, 
           webserver

 20 profiles, 58 plugins

apache와 같은 특정 플러그인에 대해서만 sosreport를 생성하려면 다음 명령을 실행하십시오.

sosreport -o apache --batch

다음 출력이 표시되어야 합니다.

sosreport (version 3.5)

This command will collect system configuration and diagnostic
information from this Ubuntu system. An archive containing the collected
information will be generated in /tmp/sos.uwazci0o.

For more information on Ubuntu visit:

  http://www.ubuntu.com/

The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.

No changes will be made to system configuration.


 Setting up archive ...
 Setting up plugins ...
 Running plugins. Please wait ...

  Running 1/1: apache...        

Creating compressed archive...

Your sosreport has been generated and saved in:
  /tmp/sosreport-ubuntu1804-20190130103821.tar.xz

The checksum is: 27dea53416ae1fae56ad4448a5cf6189

Please send this file to your support representative.

위 명령은 Apache용 sosreport를 생성하고 /tmp/sosreport-ubuntu1804-20190130103821.tar.xz 파일에 저장합니다.

다음 명령을 사용하여 파일을 추출할 수 있습니다.

tar -xvf /tmp/sosreport-ubuntu1804-20190130103821.tar.xz

이제 다음 명령을 사용하여 디렉터리를 sosreport-ubuntu1804-20190130103821로 변경합니다.

cd sosreport-ubuntu1804-20190130103821

다음으로 다음 명령을 실행하여 sosreport에서 생성된 모든 파일을 나열합니다.

tree

산출:

.
??? etc
?   ??? apache2
?       ??? apache2.conf
?       ??? conf-available
?       ?   ??? charset.conf
?       ?   ??? javascript-common.conf
?       ?   ??? localized-error-pages.conf
?       ?   ??? other-vhosts-access-log.conf
?       ?   ??? security.conf
?       ?   ??? serve-cgi-bin.conf
?       ??? conf-enabled
?       ?   ??? charset.conf -> ../conf-available/charset.conf
?       ?   ??? localized-error-pages.conf -> ../conf-available/localized-error-pages.conf
?       ?   ??? other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf
?       ?   ??? security.conf -> ../conf-available/security.conf
?       ?   ??? serve-cgi-bin.conf -> ../conf-available/serve-cgi-bin.conf
?       ??? envvars
?       ??? magic
?       ??? mods-available
?       ?   ??? access_compat.load
?       ?   ??? actions.conf
?       ?   ??? actions.load
?       ?   ??? alias.conf
?       ?   ??? alias.load
?       ?   ??? allowmethods.load
?       ?   ??? asis.load
?       ?   ??? auth_basic.load
?       ?   ??? auth_digest.load
?       ?   ??? auth_form.load
?       ?   ??? authn_anon.load
?       ?   ??? authn_core.load
?       ?   ??? authn_dbd.load
?       ?   ??? authn_dbm.load
?       ?   ??? authn_file.load
?       ?   ??? authn_socache.load
?       ?   ??? authnz_fcgi.load
?       ?   ??? authnz_ldap.load
?       ?   ??? authz_core.load
?       ?   ??? authz_dbd.load
?       ?   ??? authz_dbm.load
?       ?   ??? authz_groupfile.load
?       ?   ??? authz_host.load
?       ?   ??? authz_owner.load
?       ?   ??? authz_user.load
?       ?   ??? autoindex.conf
?       ?   ??? autoindex.load
?       ?   ??? buffer.load
?       ?   ??? cache_disk.conf
?       ?   ??? cache_disk.load
?       ?   ??? cache.load
?       ?   ??? cache_socache.load
?       ?   ??? cern_meta.load
?       ?   ??? cgid.conf
?       ?   ??? cgid.load
?       ?   ??? cgi.load
?       ?   ??? charset_lite.load
?       ?   ??? data.load
?       ?   ??? dav_fs.conf
?       ?   ??? dav_fs.load
?       ?   ??? dav.load
?       ?   ??? dav_lock.load
?       ?   ??? dbd.load
?       ?   ??? deflate.conf
?       ?   ??? deflate.load
?       ?   ??? dialup.load
?       ?   ??? dir.conf
?       ?   ??? dir.load
?       ?   ??? dump_io.load
?       ?   ??? echo.load
?       ?   ??? env.load
?       ?   ??? expires.load
?       ?   ??? ext_filter.load
?       ?   ??? file_cache.load
?       ?   ??? filter.load
?       ?   ??? headers.load
?       ?   ??? heartbeat.load
?       ?   ??? heartmonitor.load
?       ?   ??? http2.load
?       ?   ??? ident.load
?       ?   ??? imagemap.load
?       ?   ??? include.load
?       ?   ??? info.conf
?       ?   ??? info.load
?       ?   ??? lbmethod_bybusyness.load
?       ?   ??? lbmethod_byrequests.load
?       ?   ??? lbmethod_bytraffic.load
?       ?   ??? lbmethod_heartbeat.load
?       ?   ??? ldap.conf
?       ?   ??? ldap.load
?       ?   ??? log_debug.load
?       ?   ??? log_forensic.load
?       ?   ??? lua.load
?       ?   ??? macro.load
?       ?   ??? mime.conf
?       ?   ??? mime.load
?       ?   ??? mime_magic.conf
?       ?   ??? mime_magic.load
?       ?   ??? mpm_event.conf
?       ?   ??? mpm_event.load
?       ?   ??? mpm_prefork.conf
?       ?   ??? mpm_prefork.load
?       ?   ??? mpm_worker.conf
?       ?   ??? mpm_worker.load
?       ?   ??? negotiation.conf
?       ?   ??? negotiation.load
?       ?   ??? proxy_ajp.load
?       ?   ??? proxy_balancer.conf
?       ?   ??? proxy_balancer.load
?       ?   ??? proxy.conf
?       ?   ??? proxy_connect.load
?       ?   ??? proxy_express.load
?       ?   ??? proxy_fcgi.load
?       ?   ??? proxy_fdpass.load
?       ?   ??? proxy_ftp.conf
?       ?   ??? proxy_ftp.load
?       ?   ??? proxy_hcheck.load
?       ?   ??? proxy_html.conf
?       ?   ??? proxy_html.load
?       ?   ??? proxy_http2.load
?       ?   ??? proxy_http.load
?       ?   ??? proxy.load
?       ?   ??? proxy_scgi.load
?       ?   ??? proxy_wstunnel.load
?       ?   ??? ratelimit.load
?       ?   ??? reflector.load
?       ?   ??? remoteip.load
?       ?   ??? reqtimeout.conf
?       ?   ??? reqtimeout.load
?       ?   ??? request.load
?       ?   ??? rewrite.load
?       ?   ??? sed.load
?       ?   ??? session_cookie.load
?       ?   ??? session_crypto.load
?       ?   ??? session_dbd.load
?       ?   ??? session.load
?       ?   ??? setenvif.conf
?       ?   ??? setenvif.load
?       ?   ??? slotmem_plain.load
?       ?   ??? slotmem_shm.load
?       ?   ??? socache_dbm.load
?       ?   ??? socache_memcache.load
?       ?   ??? socache_shmcb.load
?       ?   ??? speling.load
?       ?   ??? ssl.conf
?       ?   ??? ssl.load
?       ?   ??? status.conf
?       ?   ??? status.load
?       ?   ??? substitute.load
?       ?   ??? suexec.load
?       ?   ??? unique_id.load
?       ?   ??? userdir.conf
?       ?   ??? userdir.load
?       ?   ??? usertrack.load
?       ?   ??? vhost_alias.load
?       ?   ??? xml2enc.load
?       ??? mods-enabled
?       ?   ??? access_compat.load -> ../mods-available/access_compat.load
?       ?   ??? alias.conf -> ../mods-available/alias.conf
?       ?   ??? alias.load -> ../mods-available/alias.load
?       ?   ??? auth_basic.load -> ../mods-available/auth_basic.load
?       ?   ??? authn_core.load -> ../mods-available/authn_core.load
?       ?   ??? authn_file.load -> ../mods-available/authn_file.load
?       ?   ??? authz_core.load -> ../mods-available/authz_core.load
?       ?   ??? authz_host.load -> ../mods-available/authz_host.load
?       ?   ??? authz_user.load -> ../mods-available/authz_user.load
?       ?   ??? autoindex.conf -> ../mods-available/autoindex.conf
?       ?   ??? autoindex.load -> ../mods-available/autoindex.load
?       ?   ??? deflate.conf -> ../mods-available/deflate.conf
?       ?   ??? deflate.load -> ../mods-available/deflate.load
?       ?   ??? dir.conf -> ../mods-available/dir.conf
?       ?   ??? dir.load -> ../mods-available/dir.load
?       ?   ??? env.load -> ../mods-available/env.load
?       ?   ??? filter.load -> ../mods-available/filter.load
?       ?   ??? mime.conf -> ../mods-available/mime.conf
?       ?   ??? mime.load -> ../mods-available/mime.load
?       ?   ??? mpm_event.conf -> ../mods-available/mpm_event.conf
?       ?   ??? mpm_event.load -> ../mods-available/mpm_event.load
?       ?   ??? negotiation.conf -> ../mods-available/negotiation.conf
?       ?   ??? negotiation.load -> ../mods-available/negotiation.load
?       ?   ??? reqtimeout.conf -> ../mods-available/reqtimeout.conf
?       ?   ??? reqtimeout.load -> ../mods-available/reqtimeout.load
?       ?   ??? setenvif.conf -> ../mods-available/setenvif.conf
?       ?   ??? setenvif.load -> ../mods-available/setenvif.load
?       ?   ??? status.conf -> ../mods-available/status.conf
?       ?   ??? status.load -> ../mods-available/status.load
?       ??? ports.conf
?       ??? sites-available
?       ?   ??? 000-default.conf
?       ?   ??? default-ssl.conf
?       ??? sites-enabled
?           ??? 000-default.conf -> ../sites-available/000-default.conf
??? sos_commands
?   ??? apache
?       ??? apachectl_-M
??? sos_logs
?   ??? sos.log
?   ??? ui.log
??? sos_reports
?   ??? sos.html
?   ??? sos.txt
??? version.txt

12 directories, 189 files

다음 명령을 사용하여 sosreport 명령에서 사용할 수 있는 다양한 옵션을 볼 수도 있습니다.

sosreport -h

다음 출력이 표시되어야 합니다.

Usage: sosreport [options]

Options:
  -h, --help            show this help message and exit
  -l, --list-plugins    list plugins and available plugin options
  -n NOPLUGINS, --skip-plugins=NOPLUGINS
                        disable these plugins
  --experimental        enable experimental plugins
  -e ENABLEPLUGINS, --enable-plugins=ENABLEPLUGINS
                        enable these plugins
  -o ONLYPLUGINS, --only-plugins=ONLYPLUGINS
                        enable these plugins only
  -k PLUGOPTS, --plugin-option=PLUGOPTS
                        plugin options in plugname.option=value format (see
                        -l)
  --log-size=LOG_SIZE   set a limit on the size of collected logs (in MiB)
  -a, --alloptions      enable all options for loaded plugins
  --all-logs            collect all available logs regardless of size
  --batch               batch mode - do not prompt interactively
  --build               preserve the temporary directory and do not package
                        results
  -v, --verbose         increase verbosity
  --verify              perform data verification during collection
  --quiet               only print fatal errors
  --debug               enable interactive debugging using the python debugger
  --ticket-number=CASE_ID
                        specify ticket number
  --case-id=CASE_ID     specify case identifier
  -p PROFILES, --profile=PROFILES
                        enable plugins selected by the given profiles
  --list-profiles       display a list of available profiles and plugins that
                        they include
  --name=CUSTOMER_NAME  specify report name
  --config-file=CONFIG_FILE
                        specify alternate configuration file
  --tmp-dir=TMP_DIR     specify alternate temporary directory
  --no-report           disable HTML/XML reporting
  -s SYSROOT, --sysroot=SYSROOT
                        system root directory path (default='/')
  -c CHROOT, --chroot=CHROOT
                        chroot executed commands to SYSROOT [auto, always,
                        never] (default=auto)
  -z COMPRESSION_TYPE, --compression-type=COMPRESSION_TYPE
                        compression technology to use [auto, gzip, bzip2, xz]
                        (default=auto)

Some examples:

 enable dlm plugin only and collect dlm lockdumps:
   # sosreport -o dlm -k dlm.lockdump

 disable memory and samba plugins, turn off rpm -Va collection:
   # sosreport -n memory,samba -k rpm.rpmva=off

그게 다야. 이제 sosreport에 대한 충분한 지식을 갖추셨기를 바랍니다. 자세한 정보를 찾으려면 sosreport 매뉴얼 페이지를 참조하십시오.