位置: 编程技术 - 正文

Linux中安装sosreport和supportconfig来收集系统信息(linux中安装vim命令)

编辑:rootadmin

推荐整理分享Linux中安装sosreport和supportconfig来收集系统信息(linux中安装vim命令),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:linux中安装vim命令,linux中安装软件可使用,linux中安装命令,linux中安装软件包的命令,linux中安装gcc,linux中安装windows,linux中安装软件可使用哪些方式,linux中安装软件可使用哪些方式,内容如对您有帮助,希望把文章链接给更多的朋友!

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

一、sosreport的安装

在默认使用linux发行版的源进行安装时,由于在不同的系统上包名称也会有差异,所以使用的命令也不同,如redhat和ubuntu平台的安装如下:复制代码代码如下:// redhat/centos下的安装# yum -y insatll sos// ubuntu下的安装# sudo apt-get install sosreport二、sosreport用法

可以使用sosreport --help或man sosreport 获取使用帮助手册,如下:复制代码代码如下:[root@way ~]# sosreport --helpUsage: 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@way log]# sosreport -a --reportsosreport (version 3.0)This command will collect diagnostic and configuration information fromthis 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 withthe published support policies at: generated archive may contain data considered sensitive and itscontent should be reviewed by the originating organization before beingpassed 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 [way.com]:Please enter the case number that you are generating this report for: Running plugins. Please wait ... Running /: yum...Creating compressed archive...Your sosreport has been generated and saved in: /var/tmp/sosreport-way.com-.tar.xzThe checksum is: eaf5b2cbb1e9bedbe5e5aab6Please 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 文件的一些信息。

由于页面较大,这里只截出了最上面的部分,列出了所有的收集模块,下面alerts 给出了报警模块的信息。再往下就是具体到每一个模块的信息。

三、sosreport配置文件

sosreport的配置文件是/etc/sos.conf ,默认内容如下:复制代码代码如下:[root@way ~]# cat /etc/sos.conf[general]#ftp_upload_url = = /usr/share/sos/rhsupport.pub#gpg_recipient = support@redhat.comsmtp_server = None[plugins] //此处可以设置默认enable和disable的模块#disable = rpm, selinux, dovecot[tunables] //可调参数#rpm.rpmva = off#general.syslogsize = 从配置文件上可以看出,sosreport同样将收集的结果上传到server 上,可以通过man sos.conf 查看配置文件的帮助信息,不过man给出的并没有太多信息,想在了解更多的信息可以查看 sosreport在github上的wiki页 。

四、sosreport总结

相于supportconfig,由于sosreport是由python语言进行编写的,所以其在功能扩展上更有优势,但由于在不同的发行版本上的python版本不同,在进行功能扩展时,对不同版本间的异常处理相对麻烦。而supportconfig由于是shell 语言编写的一个工具,对版本的依赖相对少些 ,但对一些工具的依赖相对多些 ,如在获取进程相关的信息时,shell 需要将ps 工具或处理proc的结果,而sosreport则可以直接import psutil 模块,两者之间的区别,归根到底就是shell 和python的区别。

Linux中安装sosreport和supportconfig来收集系统信息(linux中安装vim命令)

supportconfig一、supportconfig的安装

可以通过yast进行安装,也可以通过zypper命令进行安装,安装命令如下:

直接使用源进行安装复制代码代码如下:#zypper install supportutils也可以将rpm包下载下来使用yast进行安装或者在yast的管理界面里查找安装复制代码代码如下:#yast install supportutils-xxx.rpm注:根据系统的版本不同,包名也可能是supportconfig 。

安装完成后可以使用rpm -ql supportutils 查看包中具体包含的文件信息,如下:复制代码代码如下:# rpm -ql supportutils/etc/schealth.conf/etc/supportconfig.conf/sbin/chkbin/sbin/supportconfig/usr/bin/schealth/usr/share/man/man5/supportconfig.conf.5.gz/usr/share/man/man8/chkbin.8.gz/usr/share/man/man8/supportconfig.8.gz注:上面的结果是在 suse sp1企业版上的测试的结果,在opensuse 上目录结构会略有不同,其上使用的是新版本的supportconfig。

二、supportconfig用法

以下是supportconfig的帮助输出复制代码代码如下:# supportconfig -h============================================================================= Support Utilities - Supportconfig Script Version: 2.- Script Date: ============================================================================= Usage: supportconfig [OPTION [OPTION ...]] -h This screen -A Activates all supportconfig functions with additional logging and full rpm verification. -B <string> Custom tar ball file name element -C Creates a new default /etc/supportconfig.conf -D Use defaults; ignore /etc/supportconfig.conf -E <string> Contact email address -F Display available supportconfig feature keywords (case-sensitive) used with -i and -x -G <gpg_uid> The GPG recipient's user ID used to encrypt the supportconfig tarball -H <number> Limit number of included HA Policy engine files -I <number> Default log file line count -L Create a full file listing from '/' -M <string> Contact terminal ID -N <string> Contact name -O <string> Contact company name -P <string> Contact phone number -Q Run in silent mode -R <path> Log output directory -S <number> Limit number of included SAR files -T <seconds> Binary execution timeout -U <URI string> Sets upload target URL and initiates an upload, supported services include: ftp, scp, http, https -M <string> Contact store ID -X <number> Max system logs line count -a Upload the tar ball to the specified alternate target VAR_OPTION_UPLOAD_ALT -b Screen buffer mode -d Exclude detailed disk info and scans -e Search root file system for eDirectory instances; -L implied. Be patient. -f From directory. Don't collect report files, just use files in that directory. -g Use gzip instead of the default bzip2 compression. -i <keyword list> Include keywords. A comma separated list of feature keywords that specify which features to include. Use -F to see a list of valid keywords. -l Gathers additional rotated logs -m Only gather a minimum amount of info: basic env, basic health, hardware, rpm, messages, y2logs -o Toggle listed features on or off -p Disable all plugins -q Add a uuid to the tar ball filename to ensure uniqueness -r <srnum> Includes the Novell digit service request number when uploading the tar ball to Novell -s Include full SLP service lists -t Target directory. Just save log files here, do not create tarball. -u Upload the tar ball to the specified VAR_OPTION_UPLOAD_TARGET. -v Performs an rpm -V for each installed rpm NOTE: This takes a long time to complete -x <keyword list> Exclude keywords. A comma separated list of feature keywords that specify which features to exclude. Use -F to see a list of valid keywords. -y Only gather the minimum y2log files. Use Ctrl- to try and skip a function that is hanging.----------------------------------------------------------------------------- NOTE: This tool will create a tar ball in the /var/log directory. Please attach the log file tar ball to your open Service. Request at the following URL: <a href=" If you cannot attach the tar ball to the SR, then email it to the engineer. Please submit bug fixes or comments via: <a href=" Support Utilities - Supportconfig Script Version: 2.- Script Date: =============================================================================默认supportconfig或supportconfig -A执行后会将收集后的结果打包为一个nts_主机名_日期.tbz 文件,同时会生成一个以该文件名加.md5后缀的文件。

三、supportconfig常用示例

1、supportconfig -A 收集所有日志复制代码代码如下:# supportconfig============================================================================= Support Utilities - Supportconfig Script Version: 2.- Script Date: =============================================================================Gathering system information Data Directory: /var/log/nts_way.com__ Basic Server Health Check... Done RPM Database... Done Basic Environment... Done Basic Health Report... Done System Modules... Done Memory Details... Done Disk I/O... Done YaST Files... Done Auditing... Done Crash Info... Done NTP... Done PROC... Done Boot Files... Done SLERT... Skipped Updates... Done SMT... Skipped Novell eDirectory... Please Wait... Skipped Novell LUM... Skipped Novell NCP... Skipped Novell NSS... Skipped Novell DFS... Skipped Novell SMS... Skipped Novell NCS... Skipped Novell AFP... Skipped Novell CIFS... Skipped Novell iManager... Skipped HA Cluster... Skipped OCFS2... Skipped DRBD... Skipped PAM... Done LDAP... Done CIMOM... Done Open Files... Done Environment... Done ETC... Done SYSCONFIG... Done SYSFS... Done System Daemons... Done CRON... Done AT... Done UDEV... Done LVM... Please Wait... Base Detail Done EVMS... Skipped Software Raid... Done Multipathing... Done Networking... Done Web... Done InfiniBand... Done DNS... Done DHCP... Done SLP... Done SSH... Done iSCSI... Done Samba... Done NFS... Done AUTOFS... Done SAR Files... Done AppArmor... Done Xen... Done KVM... Done X... Done Printing... Done SMART Disks... Excluded Hardware... Please Wait... Done File System List... Skipped Supportability Analysis... Please Wait... Done System Logs... DoneCreating Tar Ball==[ DONE ]=================================================================== Log file tar ball: /var/log/nts_way.com__.tbz Log file size: 4.0M Log file md5sum: bcdacafacda1da7d7 Please attach the log file tar ball to your open Service Request at the following URL: <a href=" You can also upload the tar ball to <a href=" or just use supportconfig -ur <srnum>, to upload the tar ball automatically. If you cannot attach the tar ball to the SR, then email it to the engineer.=============================================================================其他常用用法:复制代码代码如下://以最小选项搜集所需的信息# supportconfig -m//在输出中包含附加的联系人信息# supportconfig -E <a href="mailto:tux@example.org">tux@example.org</a> -N "Tux Penguin" -O "Penguin Inc." ...//要查看完整的功能列表# supportconfig -F//仅收集某个模块的用法,如LVM相的信息# supportconfig -i LVM//-x 的功能与-i刚好相反,是排除某个模块不收集# supportconfig -x LVM//使用-U url 可以将收集的结果上传到服务器上,直接的服务有ftp, scp, http, https,如:# supportconfig -A -U <a href=" 常用的supportconfig选项 部分 。supportconfig收集的系统健康报告:复制代码代码如下:# supportconfig -A# cd /var/log# tar jxvf nts_way.com__.tbz# more basic-health-report.txt#==[ Command ]======================================## /usr/bin/schealth -q######################################################################Supportconfig Health Check Report Tool v1.-5Date Checked: // ::######################################################################Health Check Files [ Green ]Processes Waiting for Run Queue [ Green ]Kernel Taint Status [ Red ] Kernel Tainted: > 0CPU Utilization [ Green ]Interrupts Per Second [ Green ]Context Switches Per Second [ Green ]Free Memory and Disk Swapping [ Green ]Used Disk Space [ Green ]Uninterruptible Processes [ Green ]Zombie Processes [ Green ]######################################################################Status: Red FlagChecked: /var/log/nts_way.com__/basic-health-check.txtReport: /var/log/nts_way.com__/basic-health-report.txt######################################################################上面的报告中,我们发现kernel Tainted 状态为red ,该处是通过cat /proc/sys/kernel/tainted 进行判断的,如果值不为0,则是内核受到污染 ,显的值不同,具体可以参看/usr/src/linux/Documentation/sysctl/kernel 文件(具体的值不一样,代表的意义也不一样)。报红是由于加载了非系统官方或非开源的模块所致( Unsupported modules loaded)。

四、supportconfig配置文件

supportconfig的默认配置文件是 /etc/supportconfig.conf ,其默认内容如下:复制代码代码如下:# cat /etc/supportconfig.conf##################################### Default Options####################################OPTION_AFP=1OPTION_APPARMOR=1OPTION_AUDIT=1OPTION_AUTOFS=1OPTION_BOOT=1OPTION_CHKCONFIG=1OPTION_CIFS=1OPTION_CIMOM=1OPTION_CRASH=1OPTION_CRON=1OPTION_DFS=1OPTION_DHCP=1OPTION_DISK=1OPTION_DNS=1OPTION_EDIR=1OPTION_ENV=1OPTION_ETC=1OPTION_EVMS=1OPTION_HA=1OPTION_HCREPORT=1OPTION_IB=1OPTION_ISCSI=1OPTION_LDAP=1OPTION_LUM=1OPTION_LVM=1OPTION_MEM=1OPTION_MOD=1OPTION_MPIO=1OPTION_NCP=1OPTION_NCS=1OPTION_NET=1OPTION_NFS=1OPTION_NSS=1OPTION_NTP=1OPTION_OCFS2=1OPTION_OFILES=1OPTION_PAM=1OPTION_PRINT=1OPTION_PROC=1OPTION_SAM=1OPTION_SAR=1OPTION_SLERT=1OPTION_SLP=1OPTION_SMART=0OPTION_SMB=1OPTION_SMS=1OPTION_SMT=1OPTION_SRAID=1OPTION_SSH=1OPTION_SYSCONFIG=1OPTION_SYSFS=1OPTION_UDEV=1OPTION_UP=1OPTION_UPD=1OPTION_WEB=1OPTION_X=1OPTION_XEN=1ADD_OPTION_EDIR=0ADD_OPTION_FSLIST=0ADD_OPTION_LOGS=0ADD_OPTION_MINDISK=0ADD_OPTION_MINYAST=0ADD_OPTION_RPMV=0ADD_OPTION_SLP=0VAR_OPTION_BIN_TIMEOUT_SEC=VAR_OPTION_CONTACT_COMPANY=""VAR_OPTION_CONTACT_EMAIL=""VAR_OPTION_CONTACT_NAME=""VAR_OPTION_CONTACT_PHONE=""VAR_OPTION_CONTACT_STOREID=""VAR_OPTION_CONTACT_TERMINALID=""VAR_OPTION_CUSTOM_ARCH=""VAR_OPTION_GPG_UID=""VAR_OPTION_LINE_COUNT=VAR_OPTION_LOG_DIRS="/var/log /tmp"VAR_OPTION_MSG_MAXSIZE=VAR_OPTION_PENGINE_FILES_LIMIT=VAR_OPTION_SAR_FILES_LIMIT=VAR_OPTION_SBM=0VAR_OPTION_SILENT=0VAR_OPTION_UNIQUE_FILE=0VAR_OPTION_UPLOAD_ALT=' 编写的一个功能十分强大的工具,具体可以通过vim /sbin/supportconfig 查看 。同时,由于linux命令上的通用性,我们甚至可以很简单的进行修改后将其移植到其他linux 发行版上。不过显然这是没必要的,因为还有一个比较通的用的开源工具sosreport和其作用差不多,而其适用性更强,后面会单独列一篇做一个总结。

Linux命令提示符如何按照自己的习惯修改? 原本的[root@localhost]$看久了难免让人厌倦。如果按自己的习惯修改,既能看着舒服,又能提高逼格。下面小编就为大家详细介绍Linux命令提示符如何按照

Linux下基本的文件和目录管理命令学习教程 .代表此层目录..代表上一层目录-代表前一个工作目录~代表目前用户身份所在的中文件夹~account代表account这个用户的主文件夹(account是个账号名称)cd:切

快速浏览Linux下基本的用户和用户组管理命令 Linux是个多用户多任务的分时操作系统,所有一个要使用系统资源的用户都必须先向系统管理员申请一个账号,然后以这个账号的身份进入系统。用户的

标签: linux中安装vim命令

本文链接地址:https://www.jiuchutong.com/biancheng/353358.html 转载请保留说明!

上一篇:Linux环境中远程开启ssh端口和更改ssh用户根目录(linux远程界面)

下一篇:Linux命令提示符如何按照自己的习惯修改?(linux命令提示符不见了)

  • 汇算清缴补交所得税会计分录小企业会计政策
  • 金税四期对企业和个人的影响
  • 外地多预交的税款申报时该怎么填写?
  • 投资利税率包括所得税吗
  • 折旧费计算主要有几种方法?分别有什么特点?
  • 递延收益的核算
  • 工程会计和工业会计进销项区别是什么
  • 高新技术企业职工人数如何确定
  • 公司 捐赠
  • 合同签了发票开了钱没给怎么办
  • 金税盘和报税盘图片
  • 工会经费由谁审批
  • 分公司注销未分配利润转给总部,总部如何做账
  • 兼职费用计税标准是多少
  • 哪些资产减值损失可以 转回,哪些不能?
  • 电子产品企业用电量大吗
  • 收到赞助费要交税吗
  • 材料采购费用的是
  • 删除文件需要管理员权限无法添加怎么办
  • 如何刷新手机
  • 个人开票给公司有什么风险
  • 超标的业务招待费属于什么差异
  • 什么是票据权利?票据权利的内容有哪些
  • 电脑管家使用教程
  • 电脑管家浏览器保护怎么取消
  • quicktimeplayer.exe - quicktimeplayer是什么进程 有什么用
  • php获取远程文件数据
  • 最薄的索尼微单
  • 委托加工业务的组成计税价格
  • 工会筹备金计税依据
  • php执行linux命令无效
  • 增值税加计扣除比例
  • 怎么编制资金平衡表格
  • yolo算法百度百科
  • mount.nfs an incorrect mount
  • es6新增了什么
  • 保险佣金个人所得税怎么申报
  • 装饰公司的开票范围
  • 资本公积的项目有哪些
  • 资产负债表的负债项目显示了企业所负担债务的
  • 衡量税收负担通常用()
  • 跨季度的发票可以冲红吗
  • sql2005服务无法启动sql安装方法
  • 先给发票后付款做账
  • 中级财务会计报告心得体会
  • 个体工商户营业执照申请流程
  • 委外研发费用如何入账
  • 应交税费期末余额在借方怎样处理
  • 公司地址的变更需要哪些资料和手续
  • 未担保余值举例
  • 企业发生坏账损失时,在当期确认坏账损失
  • 进口关税,增值税,消费税
  • 房屋销售预收如何交税
  • 财务会计是学什么课程
  • 多个客户账款明细
  • mysql 授权命令
  • ubuntu sudo apt-get install
  • xampp3.2.4安装教程与配置
  • win8还能用吗
  • iis设置mime
  • 进程lsass.exe
  • 微信开发者软件
  • rftray.exe - rftray是什么进程 有什么用
  • win8怎样设置将文件保存到d盘
  • [置顶] clauvio,Twitter小老鼠
  • opengl绘制三维图形代码
  • jQuery插件能输出到控制台
  • CalledFromWrongThreadException: Only the original thread that created a view
  • android解析
  • mongoose模块有什么用途
  • 基于python语言
  • python计算文件大小
  • jquery操作select元素和option的实例代码
  • unity检测tag
  • 税务局分局副局长什么级别的干部
  • 上海餐饮增值税
  • 税收制度的核心是税法
  • 税务函调回来几天可以退税
  • 镇江市税务局官网
  • 国税网查发票真伪
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设