RHEL sosreport简介

sosreport对很多RedHat爱好者来说应该并不陌生! 它是一款在RedHat Linux下帮你收集系统信息打成一个tar包的工具,你可以将这个tar包发给供应商来定位问题.

当你给RedHat开个case时, 他们会第一时间找你要 sosreport. 本文中我们会演示如何生成 sosreport 以及如何阅读 sosreport.

如果 sosreport 包并未安装,你会看到如下错误:

root@kerneltalks # sosreport
-bash: sosreport: command not found

使用yum安装 sos 包. 你可以按照 这里 说明的安装步骤来安装. 以下是安装日志供你参考.

root@kerneltalks # yum install sos
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package sos.noarch 0:3.4-6.el7 will be installed
--> Processing Dependency: bzip2 for package: sos-3.4-6.el7.noarch
--> Running transaction check
---> Package bzip2.x86_64 0:1.0.6-13.el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================
=====================
Package Arch Version
Repository Size
===================================================================================================================================================
=====================
Installing:
sos noarch 3.4-6.el7 rhui-REGION-rhel-server-releases
381 k
Installing for dependencies:
bzip2 x86_64 1.0.6-13.el7 rhui-REGION-rhel-server-releases
52 k Transaction Summary
===================================================================================================================================================
=====================
Install 1 Package (+1 Dependent package) Total download size: 433 k
Installed size: 1.4 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): sos-3.4-6.el7.noarch.rpm |
381 kB 00:00:00
(2/2): bzip2-1.0.6-13.el7.x86_64.rpm |
52 kB 00:00:00
--------------------------------------------------------------------------------------------------------------------------------------------------
----------------------
Total 610 kB/s |
433 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : bzip2-1.0.6-13.el7.x86_64
1/2
Installing : sos-3.4-6.el7.noarch
2/2
Verifying : sos-3.4-6.el7.noarch
1/2
Verifying : bzip2-1.0.6-13.el7.x86_64
2/2 Installed:
sos.noarch 0:3.4-6.el7 Dependency Installed:
bzip2.x86_64 0:1.0.6-13.el7 Complete!

如何生成 sosreport

你只需要运行 sosreport 命令就能生成 sosreport 了. 它默认将报告放在 /var/tmp 中,因此你需要保证 /var 挂载点中有足够的空闲空间.

输出文件遵照 sosreport-name.caseID-yyyymmddhhmmss.tar.xz 这样的命名规则,其中 –

  1. name 就是你提供的名称,默认为主机名
  2. caseID 如果你没有提供则为空
  3. 日期格式为 yyyymmdd
  4. 时间格式为 hhmmss

这是一个压缩过的tar包. 运行sosreport命令后,它会要你输入名称以及case ID,然后开始执行模块收集所有的系统信息并保存道tar包中.

root@kerneltalks # sosreport

sosreport (version 3.4)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications. An archive containing the collected information will be generated in
/var/tmp/sos.iNadXY and may be provided to a Red Hat support
representative. Any information provided to Red Hat will be treated in accordance with
the published support policies at: https://access.redhat.com/support/ 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 [kerneltalks]: Shrikant Lavhate
Please enter the case id that you are generating this report for []: 12345678 Setting up archive ...
Setting up plugins ...
Running plugins. Please wait ... Running 74/74: yum... er...
Creating compressed archive... Your sosreport has been generated and saved in:
/var/tmp/sosreport-ShrikantLavhate.12345678-20171105171210.tar.xz The checksum is: 502b698f6052964ca1c2d348ea7e67a4 Please send this file to your support representative.

命令还会输出结果文件的验证码. 这有助于对方验证文件的完整性.

root@kerneltalks # ll /var/tmp/sosreport-ShrikantLavhate.12345678-20171105171210.tar.xz
-rw-------. 1 root root 8519732 Nov 5 17:12 /var/tmp/sosreport-ShrikantLavhate.12345678-20171105171210.tar.xz

如何阅读 sosreport

生成的报告是一个tar包. 你可以可以自己 un-tar  这个tar包,然后自己阅读里面的内容.

root@kerneltalks # tar xvf /var/tmp/sosreport-ShrikantLavhate.12345678-20171105171210.tar.xz

解压tar包后,你会看到一个以tar包同名的目录. 其中有好多文件和子目录.

root@kerneltalks # ls -lrt sosreport-ShrikantLavhate.12345678-20171105171210
total 16
drwxr-xr-x. 5 root root 42 Jul 11 15:57 usr
dr-xr-xr-x. 3 root root 19 Jul 11 16:07 boot
dr-xr-xr-x. 10 root root 4096 Nov 5 12:19 proc
dr-xr-xr-x. 10 root root 112 Nov 5 12:19 sys
drwxr-xr-x. 4 root root 28 Nov 5 12:19 var
drwxr-xr-x. 2 root root 18 Nov 5 12:19 dev
dr-xr-xr-x. 7 root root 78 Nov 5 12:24 lib
dr-xr-x---. 2 root root 29 Nov 5 16:23 root
drwxr-xr-x. 34 root root 4096 Nov 5 17:08 etc
lrwxrwxrwx. 1 root root 29 Nov 5 17:12 mount -> sos_commands/filesys/mount_-l
lrwxrwxrwx. 1 root root 27 Nov 5 17:12 df -> sos_commands/filesys/df_-al
lrwxrwxrwx. 1 root root 27 Nov 5 17:12 uptime -> sos_commands/general/uptime
lrwxrwxrwx. 1 root root 28 Nov 5 17:12 uname -> sos_commands/kernel/uname_-a
drwx------. 3 root root 18 Nov 5 17:12 sos_strings
lrwxrwxrwx. 1 root root 25 Nov 5 17:12 lsmod -> sos_commands/kernel/lsmod
lrwxrwxrwx. 1 root root 45 Nov 5 17:12 java -> sos_commands/java/alternatives_--display_java
lrwxrwxrwx. 1 root root 29 Nov 5 17:12 hostname -> sos_commands/general/hostname
lrwxrwxrwx. 1 root root 31 Nov 5 17:12 dmidecode -> sos_commands/hardware/dmidecode
lrwxrwxrwx. 1 root root 25 Nov 5 17:12 date -> sos_commands/general/date
lrwxrwxrwx. 1 root root 32 Nov 5 17:12 route -> sos_commands/networking/route_-n
lrwxrwxrwx. 1 root root 30 Nov 5 17:12 ps -> sos_commands/process/ps_auxwww
lrwxrwxrwx. 1 root root 41 Nov 5 17:12 netstat -> sos_commands/networking/netstat_-W_-neopa
lrwxrwxrwx. 1 root root 22 Nov 5 17:12 last -> sos_commands/last/last
lrwxrwxrwx. 1 root root 34 Nov 5 17:12 ip_addr -> sos_commands/networking/ip_-o_addr
lrwxrwxrwx. 1 root root 24 Nov 5 17:12 free -> sos_commands/memory/free
lrwxrwxrwx. 1 root root 130 Nov 5 17:12 installed-rpms -> sos_commands/rpm/sh_-c_rpm_--nodigest_-qa_--qf_NAME_-_VERSION_-_RELEASE_
._ARCH_INSTALLTIME_date_awk_-F_printf_-59s_s_n_1_2_sort_-f
lrwxrwxrwx. 1 root root 38 Nov 5 17:12 chkconfig -> sos_commands/services/chkconfig_--list
-rw-r--r--. 1 root root 1481 Nov 5 17:12 version.txt
drwx------. 2 root root 37 Nov 5 17:12 sos_reports
drwx------. 2 root root 35 Nov 5 17:12 sos_logs
drwx------. 43 root root 4096 Nov 5 17:12 sos_commands
drwxr-xr-x. 3 root root 19 Nov 5 17:12 run

在 sos_reports 目录中你会看到 sos.txt 和 sos.html 文件.

在 sos.txt 文件中,你可以看到所有加载了的插件,执行过的命令,被sosreport拷贝的文件. 在 sos.html 文件中所有这些内容都通过超链接连接到目录中的原始内容. 这样你可以你可以直接查看脚本命令的输出结果和拷贝过的文件.

sosreport 探测到的任何警告都会在这些文件的开始位置高亮显示出来.

本文基于3.4版的 sosreport. 如果你的版本不同,那么可能信息会有少许的差异.

RHEL sosreport的更多相关文章

  1. 使用sosreport命令生成诊断包

    [RHEL]-7-常用系统状态检测命令 引言 这篇文章介绍RHEL中最常用的几个系统状态检测命令,包括:网络状态.内存.主机名及其架构.系统负载及其用户登录状态等. 文章目录 0×1.查看网络状态 0 ...

  2. xsos:一个在Linux上阅读SOSReport的工具

    xsos:一个在Linux上阅读SOSReport的工具 时间 2019-05-23 14:36:29  51CTO 原文  http://os.51cto.com/art/201905/596889 ...

  3. Linux:将rhel yum 切换到centos yum

    Red Hat Enterprise Linux Server(RHEL) yum安装软件时This system is not registered with RHN. RHN support wi ...

  4. Configure a bridged network interface for KVM using RHEL 5.4 or later?

    environment Red Hat Enterprise Linux 5.4 or later Red Hat Enterprise Linux 6.0 or later KVM virtual ...

  5. 在CentOS或RHEL上安装Nux Dextop仓库

    介绍 Nux Dextop是类似CentOS.RHEL.ScientificLinux的第三方RPM仓库(比如:Ardour,Shutter等等).目前,Nux Dextop对CentOS/RHEL ...

  6. 1-linux系统管理(一)之安装RHEL 6.4

    linux系统管理之安装RHEL 6.4 进入安装界面 这里选择跳过 点击下一步 选择安装语言 选择键盘 选择系统储存方式 选择是否格式化储存设备 给安装的系统一个计算机名 选择时区 给root一个密 ...

  7. CentOS 7 (RHEL 7)服务管理命令的变化

    CentOS 7 (RHEL 7)带来了新的服务管理命令,为了保持兼容原有的命令仍可以使用,以下是新旧命令的对照. 启动.停止.重启.重载.检查服务:6: service httpd start|st ...

  8. RHEL 6.3 详细安装教程

    以前刚接触linux时,什么都不懂,为了学习,在电脑上安装双系统(原系统为Win7),吃过不少苦头,在网上搜教程,很多都是语焉不详,导致安装过程中战战兢兢.最近朋友面试运维,面试官有考他对linux安 ...

  9. RHEL 5.7 Yum配置本地源[Errno 2] No such file or directory

    在Red Hat Enterprise Linux Server release 5.7 上配置YUM本地源时,遇到了"Errno 5] OSError: [Errno 2] No such ...

随机推荐

  1. limanmanExp数据库审计设计思路与重要代码

    目的 在代码审计的时候经常会想看看某个访问会触发哪些数据库操作.目前已知的数据库审计有多家大型厂商的设备,还有seay源码审计系统中的数据库监控1.0 但是.开源的已知的就只有seay源码审计系统中的 ...

  2. 使用SignalR ASP.NET Core来简单实现一个后台实时推送数据给Echarts展示图表的功能

    什么是 SignalR ASP.NET Core ASP.NET Core SignalR 是一种开放源代码库,可简化将实时 web 功能添加到应用程序的功能. 实时 web 功能使服务器端代码可以立 ...

  3. [Fundamental of Power Electronics]-PART I-3.稳态等效电路建模,损耗和效率-3.1 直流变压器模型

    3.1 直流变压器模型 如图3.1所示,任何开关变换器都包含三个部分:功率输入,功率输出以及控制输入.输入功率按控制输入进行特定的功率变换输出到负载.理想情况下,这些功能将以100%的效率完成,因此 ...

  4. lms框架分布式事务使用简介

    lms框架的分布式事务解决方案采用的TCC事务模型.在开发过程中参考和借鉴了hmily.使用AOP的编程思想,在rpc通信过程中通过拦截器的方式对全局事务或是分支事务进行管理和协调. 本文通过lms. ...

  5. 【软件推荐】使用Cmder替换Windows自带的控制台

    安装地址 进入cmder官网,下载相应版本. 如果本地已经安装了git,可以选择mini版本. 将 λ 替换为 $ 当前cmder默认的提示符是λ,看上去总是有点不习惯. 打开cmder目录下的ven ...

  6. 2020-BUAA OO-面向对象设计与构造-HW11中对ageVar采用缓存优化的等价性证明(包括溢出情况)

    HW11中对ageVar采用缓存优化的等价性证明(包括溢出情况) 概要 我们知道,第三次作业里age上限变为2000,而如果缓存年龄的平方和,2000*2000*800 > 2147483647 ...

  7. 迷宫问题(BFS)

    给定一个n* m大小的迷宫,其中* 代表不可通过的墙壁,而"."代表平地,S表示起点,T代表终点.移动过程中,如果当前位置是(x, y)(下标从0开始),且每次只能前往上下左右.( ...

  8. Java(41-55)【 流程控制语句】

    1. 2.练习题if语句的使用 3.选择语句 4. 5.循环结构 6.continue和break

  9. Object.assign()和解构赋值:给对象赋值的两种方法

    一.Object.assign()方法给对象赋值 Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象分配到目标对象.它将返回目标对象. 拷贝的是属性值 如果目标对象中的属性 ...

  10. RedHat 7.6 安装 Mysql 8.0.17

    # 查看是否安装mysql rpm -qa | grep -i mysql # 如果有,需要卸载旧版本Mysql及相关依赖包 rpm -e MySQL-client-*** # 查看开机启动服务列表状 ...