zoukankan      html  css  js  c++  java
  • sosreport -a --report

    sosreport命令

     

    sosreport是一个类型于supportconfig 的工具,sosreport是python编写的一个工具,适用于centos(和redhat一样,包名为sos)、ubuntu(其下包名为sosreport)等大多数版本的linux 。sosreport在github上的托管页面为:https://github.com/sosreport/sos ,而且默认在很多系统的源里都已经集成有。如果使用的是正版redhat,在出现系统问题,寻求官方支持时,官方一般也会通过sosreport将收集的信息进行分析查看。需要注意的是在一些老的redhat发行版中叫sysreport ------ 如redhat4.5之前的版本中。

    一、sosreport的安装

    在默认使用linux发行版的源进行安装时,由于在不同的系统上包名称也会有差异,所以使用的命令也不同,如redhat和ubuntu平台的安装如下:

    //    redhat/centos下的安装
    # yum -y insatll sos
    //    ubuntu下的安装
    # sudo apt-get install sosreport

    二、sosreport用法

    可以使用sosreport --helpman sosreport 获取使用帮助手册,如下:

    [root@QQ ~]# sosreport --help
    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
      -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)
      -a, --alloptions      enable all options for loaded plugins
      --batch               batch mode - do not prompt interactively
      --build               keep sos tree available and dont package results
      -v, --verbose         increase verbosity
      --quiet               only print fatal errors
      --debug               enable interactive debugging using the python debugger
      --ticket-number=TICKET_NUMBER
                            specify ticket number
      --name=CUSTOMER_NAME  specify report name
      --config-file=CONFIG_FILE
                            specify alternate configuration file
      --tmp-dir=TMP_DIR     specify alternate temporary directory
      --report              Enable HTML/XML reporting
      --profile             turn on profiling
      -z COMPRESSION_TYPE, --compression-type=COMPRESSION_TYPE
                            compression technology to use [auto, zip, gzip, bzip2,
                            xz] (default=auto)
    Some examples:
     enable cluster plugin only and collect dlm lockdumps:
       # sosreport -o cluster -k cluster.lockdump
     disable memory and samba plugins, turn off rpm -Va collection:
       # sosreport -n memory,samba -k rpm.rpmva=off

    上面也列出了具体操作的示例。其中-l 参数会列出当前enable和disable的所有服务插件及当前available的所有插件。

    [root@QQ log]# sosreport -a --report
    sosreport (version 3.0)
    This command will collect diagnostic and configuration information from
    this CentOS Linux system and installed applications.
    An archive containing the collected information will be generated in
    /var/tmp and may be provided to a CentOS support representative.
    Any information provided to CentOS will be treated in accordance with
    the published support policies at:
      https://www.centos.org/
    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 [361way.com]:
    Please enter the case number that you are generating this report for:
     Running plugins. Please wait ...
      Running 68/68: yum...
    Creating compressed archive...
    Your sosreport has been generated and saved in:
      /var/tmp/sosreport-361way.com-20140912204339.tar.xz
    The checksum is: eaf5b2cbb1e9be68d41be5e5a60a61b6
    Please send this file to your support representative.
    

    如上所示,我使用-A 启用所有的模块,--report是开启所有的结果以html /xml 的格式一个总的报告。生成的包需要通过下面的命令进行解包。

    # xz -d ***.tar.xz
    # tar -xvf  ***.tar
    或直接使用下面的命令一步完成解压
    tar xvJf  ***.tar.xz

    在解包后的sos_reports 目录会有report的结果sos.html文件生成,同时会有sos.txt文件生成,该文件内列出了具体执行的命令及copy 文件的一些信息。html 打开的内容如下:

  • 相关阅读:
    前端工具webpack4.0各个击破——html部分
    云下IDC和云上VPC如何高速稳定互联?——云专线接入方案
    程序猿必备!最简单的颈椎操
    16节课搞懂大数据,视频教程限时免费领取
    【DevCloud · 敏捷智库】如何玩转每日站会?
    华为云实时数据处理“三剑客”
    一统江湖的大前端React.js-从开发者到工程师
    关于【微服务】,你必须了解这些
    【鲲鹏来了】华为云鲲鹏弹性云服务器 KC1一文全掌握(5)
    【昇腾学院】昇腾AI处理器软件栈--框架管理器(Framework)离线模型生成
  • 原文地址:https://www.cnblogs.com/xuanbjut/p/11605492.html
Copyright © 2011-2022 走看看