Linux系統(tǒng)如何安裝和使用shell編寫的工具supportconfig

supportconfig作為Linux系統(tǒng)shell編寫的工具,其功能是非常強(qiáng)大的,但還是有很多人對supportconfig工具不了解,不知如何使用supportconfig工具,下面小編就簡單的給大家介紹下Linux安裝使用supportconfig的方法。
一、supportconfig的安裝
可以通過yast進(jìn)行安裝,也可以通過zypper命令進(jìn)行安裝,安裝命令如下:
直接使用源進(jìn)行安裝
代碼如下
#zypper install supportutils
也可以將rpm包下載下來使用yast進(jìn)行安裝或者在yast的管理界面里查找安裝
#yast install supportutils-xxx.rpm
注:根據(jù)系統(tǒng)的版本不同,包名也可能是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
注:上面的結(jié)果是在 suse11 sp1企業(yè)版上的測試的結(jié)果,在opensuse 13上目錄結(jié)構(gòu)會略有不同,其上使用的是新版本的supportconfig。
二、supportconfig用法
以下是supportconfig的幫助輸出
代碼如下
# supportconfig -h
=============================================================================
Support Utilities - Supportconfig
Script Version: 2.25-197
Script Date: 2010 04 02
=============================================================================
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 11 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:
https://secure-support.novell.com/eService_enu
If you cannot attach the tar ball to the SR, then email it to the engineer.
Please submit bug fixes or comments via:
http://en.opensuse.org/Supportutils#Reporting_Bugs
=============================================================================
Support Utilities - Supportconfig
Script Version: 2.25-197
Script Date: 2010 04 02
=============================================================================
默認(rèn)supportconfig或supportconfig -A執(zhí)行后會將收集后的結(jié)果打包為一個nts_主機(jī)名_日期.tbz 文件,同時會生成一個以該文件名加.md5后綴的文件。
上一頁1234下一頁共4頁
三、supportconfig常用示例
1、supportconfig -A 收集所有日志
代碼如下
# supportconfig
=============================================================================
Support Utilities - Supportconfig
Script Version: 2.25-290
Script Date: 2011 07 14
=============================================================================
Gathering system information
Data Directory: /var/log/nts_361way.com_140825_1504
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.。。 Done
Creating Tar Ball
==[ DONE ]===================================================================
Log file tar ball: /var/log/nts_361way.com_140825_1504.tbz
Log file size: 4.0M
Log file md5sum: 484b111cda54ca04419facd82a1da7d7
Please attach the log file tar ball to your open Service Request at the
following URL:
https://secure-support.novell.com/eService_enu
You can also upload the tar ball to ftp.novell.com/incoming, 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
//在輸出中包含附加的聯(lián)系人信息
# supportconfig -E tux@example.org -N “Tux Penguin” -O “Penguin Inc.” 。。。
//要查看完整的功能列表
# supportconfig -F
//僅收集某個模塊的用法,如LVM相的信息
# supportconfig -i LVM
//-x 的功能與-i剛好相反,是排除某個模塊不收集
# supportconfig -x LVM
//使用-U url 可以將收集的結(jié)果上傳到服務(wù)器上,直接的服務(wù)有ftp, scp, http, https,如:
# supportconfig -A -U http://www.361way.com/files/
具體可以參看官方的 常用的supportconfig選項 部分 。
supportconfig收集的系統(tǒng)健康報告:
代碼如下
# supportconfig -A
# cd /var/log
# tar jxvf nts_361way.com_140825_1504.tbz
# more basic-health-report.txt
#==[ Command ]======================================#
# /usr/bin/schealth -q
######################################################################
Supportconfig Health Check Report Tool v1.00-5
Date Checked: 09/12/14 04:40:37
######################################################################
Health Check Files [ Green ]
Processes Waiting for Run Queue [ Green ]
Kernel Taint Status [ Red ]
Kernel Tainted: 64 》 0
CPU 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 Flag
Checked: /var/log/nts_361way.com_140825_1504/basic-health-check.txt
Report: /var/log/nts_361way.com_140825_1504/basic-health-report.txt
######################################################################
上面的報告中,我們發(fā)現(xiàn)kernel Tainted 狀態(tài)為red ,該處是通過cat /proc/sys/kernel/tainted 進(jìn)行判斷的,如果值不為0,則是內(nèi)核受到污染 ,顯的值不同,具體可以參看/usr/src/linux/Documentation/sysctl/kernel 文件(具體的值不一樣,代表的意義也不一樣)。64報紅是由于加載了非系統(tǒng)官方或非開源的模塊所致( Unsupported modules loaded)。
四、supportconfig配置文件
supportconfig的默認(rèn)配置文件是 /etc/supportconfig.conf ,其默認(rèn)內(nèi)容如下:
代碼如下
# cat /etc/supportconfig.conf
####################################
# Default Options
####################################
OPTION_AFP=1
OPTION_APPARMOR=1
OPTION_AUDIT=1
OPTION_AUTOFS=1
OPTION_BOOT=1
OPTION_CHKCONFIG=1
OPTION_CIFS=1
OPTION_CIMOM=1
OPTION_CRASH=1
OPTION_CRON=1
OPTION_DFS=1
OPTION_DHCP=1
OPTION_DISK=1
OPTION_DNS=1
OPTION_EDIR=1
OPTION_ENV=1
OPTION_ETC=1
OPTION_EVMS=1
OPTION_HA=1
OPTION_HCREPORT=1
OPTION_IB=1
OPTION_ISCSI=1
OPTION_LDAP=1
OPTION_LUM=1
OPTION_LVM=1
OPTION_MEM=1
OPTION_MOD=1
OPTION_MPIO=1
OPTION_NCP=1
OPTION_NCS=1
OPTION_NET=1
OPTION_NFS=1
OPTION_NSS=1
OPTION_NTP=1
OPTION_OCFS2=1
OPTION_OFILES=1
OPTION_PAM=1
OPTION_PRINT=1
OPTION_PROC=1
OPTION_SAM=1
OPTION_SAR=1
OPTION_SLERT=1
OPTION_SLP=1
OPTION_SMART=0
OPTION_SMB=1
OPTION_SMS=1
OPTION_SMT=1
OPTION_SRAID=1
OPTION_SSH=1
OPTION_SYSCONFIG=1
OPTION_SYSFS=1
OPTION_UDEV=1
OPTION_UP=1
OPTION_UPD=1
OPTION_WEB=1
OPTION_X=1
OPTION_XEN=1
ADD_OPTION_EDIR=0
ADD_OPTION_FSLIST=0
ADD_OPTION_LOGS=0
ADD_OPTION_MINDISK=0
ADD_OPTION_MINYAST=0
ADD_OPTION_RPMV=0
ADD_OPTION_SLP=0
VAR_OPTION_BIN_TIMEOUT_SEC=300
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=500
VAR_OPTION_LOG_DIRS=“/var/log /tmp”
VAR_OPTION_MSG_MAXSIZE=500000
VAR_OPTION_PENGINE_FILES_LIMIT=250
VAR_OPTION_SAR_FILES_LIMIT=30
VAR_OPTION_SBM=0
VAR_OPTION_SILENT=0
VAR_OPTION_UNIQUE_FILE=0
VAR_OPTION_UPLOAD_ALT=‘https://secure-www.novell.com/upload?appname=supportconfig&file={tarball}’
VAR_OPTION_UPLOAD_TARGET=‘ftp://ftp.novell.com/incoming’
配置文件中列出了默認(rèn)收集的模塊信息,公司信息、郵件、電話及上傳的服務(wù)器目錄等。
五、supportconfig總結(jié)
supportconfig是使用shell 編寫的一個功能十分強(qiáng)大的工具,具體可以通過vim /sbin/supportconfig 查看 。同時,由于linux命令上的通用性,我們甚至可以很簡單的進(jìn)行修改后將其移植到其他linux 發(fā)行版上。不過顯然這是沒必要的,因為還有一個比較通的用的開源工具sosreport和其作用差不多,而其適用性更強(qiáng)。
supportconfig在Linux系統(tǒng)的安裝使用就介紹到這里了,supportconfig的用法還有很多,用戶可根據(jù)本文的方法舉一反三,掌握更多用法。
相關(guān)文章
Fedora Linux 42 穩(wěn)定版發(fā)布: 帶來大量新功能和軟件更新
Fedora 42昨日發(fā)布,這是 Red Hat 贊助開發(fā)的杰出前沿 Linux 發(fā)行版的最新版,包含大量新功能和軟件更新,使其成為 2025 年上半年發(fā)布的一款出色的 Linux 操作系統(tǒng)之一,內(nèi)2025-04-16如何在Linux查看硬盤信息? 查看Linux硬盤大小類型和硬件信息的5種方法
使用Linux系統(tǒng)的過程中,查看和了解硬盤信息是非常重要的工作,尤其是對于系統(tǒng)管理員而言,那么在Linux系統(tǒng)中如何查看硬盤信息?以下是具體內(nèi)容介紹2025-03-12如何在 Linux 中查看 CPU 詳細(xì)信息? 3招輕松查看CPU型號、核心數(shù)和溫度
在日常運維工作中,獲取 CPU 信息是系統(tǒng)運維管理員常見的工作內(nèi)容,無論是為了性能調(diào)優(yōu)、硬件升級還是僅僅滿足好奇心2025-03-11什么是 Arch Linux? 獨樹一幟的Arch Linux發(fā)行版分析
Arch Linux是為簡化,優(yōu)化,現(xiàn)代化,實用主義,用戶中心和多功能性而創(chuàng)建Linux發(fā)行版,究竟是什么讓 Arch 與眾不同?下面我們就來簡要解讀2025-02-19如何在Linux環(huán)境下制作 Win11裝機(jī)U盤?
一直用的linux辦公,想要將筆記本電腦從 Linux 系統(tǒng)切換回 Windows 11,我們可以制作一個win11裝機(jī)u盤,詳細(xì)如下2025-02-17Rsnapshot怎么用? 基于Rsync的強(qiáng)大Linux備份工具使用指南
Rsnapshot 不僅可以備份本地文件,還能通過 SSH 備份遠(yuǎn)程文件,接下來詳細(xì)介紹如何安裝、配置和使用 Rsnapshot,包括創(chuàng)建每小時、每天、每周和每月的本地備份,以及如何進(jìn)2025-02-06Linux Kernel 6.13發(fā)布:附更新內(nèi)容及新特性解讀
Linux 內(nèi)核 6.13 正式發(fā)布,新版本引入了惰性搶占支持,簡化內(nèi)核搶占邏輯,通過減少與調(diào)度器相關(guān)的調(diào)用次數(shù),讓內(nèi)核在運行時表現(xiàn)更優(yōu),從而提高效率2025-01-23五大特性引領(lǐng)創(chuàng)新! 深度操作系統(tǒng) deepin 25 Preview預(yù)覽版發(fā)布
今日,深度操作系統(tǒng)正式推出deepin 25 Preview版本,該版本集成了五大核心特性:磐石系統(tǒng)、全新DDE、Treeland窗口合成器、AI For OS以及Distrobox子系統(tǒng)2025-01-18Linux Mint Xia 22.1重磅發(fā)布: 重要更新一覽
Beta 版 Linux Mint“Xia” 22.1 發(fā)布,新版本基于 Ubuntu 24.04,內(nèi)核版本為 Linux 6.8,這次更新帶來了諸多優(yōu)化和改進(jìn),進(jìn)一步鞏固了 Mint 在 Linux 桌面操作系統(tǒng)領(lǐng)域的2025-01-16LinuxMint怎么安裝? Linux Mint22下載安裝圖文教程
Linux Mint22發(fā)布以后,有很多新功能,很多朋友想要下載并安裝,該怎么操作呢?下面我們就來看看詳細(xì)安裝指南2025-01-16