国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

linux中supportconfig安裝與使用方法

2024-08-27 23:58:34
字體:
來源:轉載
供稿:網友

由于工作原因,平時需要suse的工程師做二線技術支持,除了經常會提交kdump分析的結果給suse 工程師定位根因,而在沒有kdump生成時,經常會用的指令就是supportconfig收集系統信息,其收集內容基本涵蓋了內核、模塊、系統、服務等幾乎所有我們能想到的信息,另外還會出一份簡單的health check報告,其除了適用于suse企業版外,同樣在opensuse上也可以使用,本篇就結合現網使用的場景對supportconfig命令做一個簡單的概括.

一、supportconfig的安裝

可以通過yast進行安裝,也可以通過zypper命令進行安裝,安裝命令如下.

直接使用源進行安裝,代碼如下:#zypper install supportutils

也可以將rpm包下載下來使用yast進行安裝或者在yast的管理界面里查找安裝:

#yast install supportutils-xxx.rpm

注:根據系統的版本不同,包名也可能是supportconfig.

安裝完成后可以使用rpm -ql supportutils 查看包中具體包含的文件信息,如下:

  1. # rpm -ql supportutils 
  2. /etc/schealth.conf 
  3. /etc/supportconfig.conf 
  4. /sbin/chkbin 
  5. /sbin/supportconfig 
  6. /usr/bin/schealth 
  7. /usr/share/man/man5/supportconfig.conf.5.gz 
  8. /usr/share/man/man8/chkbin.8.gz 
  9. /usr/share/man/man8/supportconfig.8.gz 

注:上面的結果是在 suse11 sp1企業版上的測試的結果,在opensuse 13上目錄結構會略有不同,其上使用的是新版本的supportconfig.

二、supportconfig用法

以下是supportconfig的幫助輸出,代碼如下:

  1. # supportconfig -h 
  2. ============================================================================= 
  3.                      Support Utilities - Supportconfig 
  4.                           Script Version: 2.25-197 
  5.                           Script Date: 2010 04 02 
  6. ============================================================================= 
  7.  Usage: supportconfig [OPTION [OPTION ...]] 
  8.   -h This screen 
  9.   -A Activates all supportconfig functions with additional logging and full 
  10.      rpm verification. 
  11.   -B <string> Custom tar ball file name element 
  12.   -C Creates a new default /etc/supportconfig.conf 
  13.   -D Use defaults; ignore  /etc/supportconfig.conf 
  14.   -E <string> Contact email address 
  15.   -F Display available supportconfig feature keywords (case-sensitive) used 
  16.      with -i and -x 
  17.   -G <gpg_uid> The GPG recipient's user ID used to encrypt the supportconfig tarball 
  18.   -H <number> Limit number of included HA Policy engine files 
  19.   -I <number> Default log file line count 
  20.   -L Create a full file listing from '/' 
  21.   -M <string> Contact terminal ID 
  22.   -N <string> Contact name 
  23.   -O <string> Contact company name 
  24.   -P <string> Contact phone number 
  25.   -Q Run in silent mode 
  26.   -R <path> Log output directory 
  27.   -S <number> Limit number of included SAR files 
  28.   -T <seconds> Binary execution timeout 
  29.   -U <URI string> Sets upload target URL and initiates an upload, supported 
  30.                   services include: ftp, scp, http, https 
  31.   -M <string> Contact store ID 
  32.   -X <number> Max system logs line count 
  33.   -a Upload the tar ball to the specified alternate target VAR_OPTION_UPLOAD_ALT 
  34.   -b Screen buffer mode 
  35.   -d Exclude detailed disk info and scans 
  36.   -e Search root file system for eDirectory instances; -L implied. Be patient. 
  37.   -f From directory. Don't collect report files, just use files in that 
  38.      directory. 
  39.   -g Use gzip instead of the default bzip2 compression. 
  40.   -i <keyword list> 
  41.      Include keywords. A comma separated list of feature keywords that specify 
  42.      which features to include. Use -F to see a list of valid keywords. 
  43.   -l Gathers additional rotated logs 
  44.   -m Only gather a minimum amount of info: basic env, basic health, hardware, 
  45.      rpm, messages, y2logs 
  46.   -o Toggle listed features on or off 
  47.   -p Disable all plugins 
  48.   -q Add a uuid to the tar ball filename to ensure uniqueness 
  49.   -r <srnum> 
  50.      Includes the Novell 11 digit service request number when uploading 
  51.      the tar ball to Novell 
  52.   -s Include full SLP service lists 
  53.   -t Target directory. Just save log files here, do not create tarball. 
  54.   -u Upload the tar ball to the specified VAR_OPTION_UPLOAD_TARGET. 
  55.   -v Performs an rpm -V for each installed rpm  NOTE: This takes a long time 
  56.      to complete 
  57.   -x <keyword list> 
  58.      Exclude keywords. A comma separated list of feature keywords that specify 
  59.      which features to exclude. Use -F to see a list of valid keywords. 
  60.   -y Only gather the minimum y2log files. 
  61.   Use Ctrl- to try and skip a function that is hanging. 
  62. ----------------------------------------------------------------------------- 
  63.   NOTE: 
  64.   This tool will create a tar ball in the /var/log directory. Please attach 
  65.   the log file tar ball to your open Service.  Request at the following URL: 
  66. https://secure-support.novell.com/eService_enu 
  67.   If you cannot attach the tar ball to the SR, then email it to the engineer. 
  68.   Please submit bug fixes or comments via: 
  69. http://en.opensuse.org/Supportutils#Reporting_Bugs 
  70. ============================================================================= 
  71.                      Support Utilities - Supportconfig 
  72.                           Script Version: 2.25-197 
  73.                           Script Date: 2010 04 02 
  74. ============================================================================= 

默認supportconfig或supportconfig -A執行后會將收集后的結果打包為一個nts_主機名_日期.tbz 文件,同時會生成一個以該文件名加.md5后綴的文件.

三、supportconfig常用示例

1、supportconfig -A 收集所有日志,代碼如下:

  1. # supportconfig 
  2. ============================================================================= 
  3.                      Support Utilities - Supportconfig 
  4.                           Script Version: 2.25-290 
  5.                           Script Date: 2011 07 14 
  6. ============================================================================= 
  7. Gathering system information 
  8.   Data Directory:    /var/log/nts_361way.com_140825_1504 
  9.   Basic Server Health Check...                 Done 
  10.   RPM Database...                              Done 
  11.   Basic Environment...                         Done 
  12.   Basic Health Report...                       Done 
  13.   System Modules...                            Done 
  14.   Memory Details...                            Done 
  15.   Disk I/O...                                  Done 
  16.   YaST Files...                                Done 
  17.   Auditing...                                  Done 
  18.   Crash Info...                                Done 
  19.   NTP...                                       Done 
  20.   PROC...                                      Done 
  21.   Boot Files...                                Done 
  22.   SLERT...                                     Skipped 
  23.   Updates...                                   Done 
  24.   SMT...                                       Skipped 
  25.   Novell eDirectory...                         Please Wait... Skipped 
  26.   Novell LUM...                                Skipped 
  27.   Novell NCP...                                Skipped 
  28.   Novell NSS...                                Skipped 
  29.   Novell DFS...                                Skipped 
  30.   Novell SMS...                                Skipped 
  31.   Novell NCS...                                Skipped 
  32.   Novell AFP...                                Skipped 
  33.   Novell CIFS...                               Skipped 
  34.   Novell iManager...                           Skipped 
  35.   HA Cluster...                                Skipped 
  36.   OCFS2...                                     Skipped 
  37.   DRBD...                                      Skipped 
  38.   PAM...                                       Done 
  39.   LDAP...                                      Done 
  40.   CIMOM...                                     Done 
  41.   Open Files...                                Done 
  42.   Environment...                               Done 
  43.   ETC...                                       Done 
  44.   SYSCONFIG...                                 Done 
  45.   SYSFS...                                     Done 
  46.   System Daemons...                            Done 
  47.   CRON...                                      Done 
  48.   AT...                                        Done 
  49.   UDEV...                                      Done 
  50.   LVM...                                       Please Wait... Base Detail Done 
  51.   EVMS...                                      Skipped 
  52.   Software Raid...                             Done 
  53.   Multipathing...                              Done 
  54.   Networking...                                Done 
  55.   Web...                                       Done 
  56.   InfiniBand...                                Done 
  57.   DNS...                                       Done 
  58.   DHCP...                                      Done 
  59.   SLP...                                       Done 
  60.   SSH...                                       Done 
  61.   iSCSI...                                     Done 
  62.   Samba...                                     Done 
  63.   NFS...                                       Done 
  64.   AUTOFS...                                    Done 
  65.   SAR Files...                                 Done 
  66.   AppArmor...                                  Done 
  67.   Xen...                                       Done 
  68.   KVM...                                       Done 
  69.   X...                                         Done 
  70.   Printing...                                  Done 
  71.   SMART Disks...                               Excluded 
  72.   Hardware...                                  Please Wait... Done 
  73.   File System List...                          Skipped 
  74.   Supportability Analysis...                   Please Wait... Done 
  75.   System Logs...                               Done 
  76. Creating Tar Ball 
  77. ==[ DONE ]=================================================================== 
  78.   Log file tar ball: /var/log/nts_361way.com_140825_1504.tbz 
  79.   Log file size:     4.0M 
  80.   Log file md5sum:   484b111cda54ca04419facd82a1da7d7 
  81.   Please attach the log file tar ball to your open Service Request at the 
  82.   following URL: 
  83. https://secure-support.novell.com/eService_enu 
  84.   You can also upload the tar ball to ftp.novell.com/incoming, or just use 
  85.   supportconfig -ur <srnum>, to upload the tar ball automatically. 
  86.   If you cannot attach the tar ball to the SR, then email it to the engineer. 
  87. ============================================================================= 

其他常用用法:

  1. //以最小選項搜集所需的信息 
  2. # supportconfig -m 
  3. //在輸出中包含附加的聯系人信息 
  4. # supportconfig -E tux@example.org -N "Tux Penguin" -O "Penguin Inc." ... 
  5. //要查看完整的功能列表 
  6. # supportconfig -F 
  7. //僅收集某個模塊的用法,如LVM相的信息 
  8. # supportconfig -i LVM 
  9. //-x 的功能與-i剛好相反,是排除某個模塊不收集 
  10. # supportconfig -x LVM 
  11. //使用-U url 可以將收集的結果上傳到服務器上,直接的服務有ftp, scp, http, https,如: 
  12. # supportconfig -A -U http://www.361way.com/files/ 

具體可以參看官方的常用的supportconfig選項部分,supportconfig收集的系統健康報告,代碼如下:

  1. # supportconfig -A 
  2. # cd /var/log 
  3. # tar jxvf nts_361way.com_140825_1504.tbz 
  4. # more basic-health-report.txt 
  5. #==[ Command ]======================================# 
  6. # /usr/bin/schealth -q 
  7. ###################################################################### 
  8. Supportconfig Health Check Report Tool v1.00-5 
  9. Date Checked: 09/12/14 04:40:37 
  10. ###################################################################### 
  11. Health Check Files                                         [  Green  ] 
  12. Processes Waiting for Run Queue                            [  Green  ] 
  13. Kernel Taint Status                                        [   Red   ] 
  14.  Kernel Tainted: 64 > 0 
  15. CPU Utilization                                            [  Green  ] 
  16. Interrupts Per Second                                      [  Green  ] 
  17. Context Switches Per Second                                [  Green  ] 
  18. Free Memory and Disk Swapping                              [  Green  ] 
  19. Used Disk Space                                            [  Green  ] 
  20. Uninterruptible Processes                                  [  Green  ] 
  21. Zombie Processes                                           [  Green  ] 
  22. ###################################################################### 
  23. Status:   Red Flag 
  24. Checked:  /var/log/nts_361way.com_140825_1504/basic-health-check.txt 
  25. Report:   /var/log/nts_361way.com_140825_1504/basic-health-report.txt 
  26. ###################################################################### 

上面的報告中,我們發現kernel Tainted 狀態為red,該處是通過cat  /proc/sys/kernel/tainted 進行判斷的,如果值不為0,則是內核受到污染,顯的值不同,具體可以參看/usr/src/linux/Documentation/sysctl/kernel 文件,具體的值不一樣,代表的意義也不一樣,64報紅是由于加載了非系統官方或非開源的模塊所致,Unsupported modules loaded.

四、supportconfig配置文件

supportconfig的默認配置文件是 /etc/supportconfig.conf,其默認內容如下:

  1. # cat /etc/supportconfig.conf 
  2. #################################### 
  3. Default Options 
  4. #################################### 
  5. OPTION_AFP=1 
  6. OPTION_APPARMOR=1 
  7. OPTION_AUDIT=1 
  8. OPTION_AUTOFS=1 
  9. OPTION_BOOT=1 
  10. OPTION_CHKCONFIG=1 
  11. OPTION_CIFS=1 
  12. OPTION_CIMOM=1 
  13. OPTION_CRASH=1 
  14. OPTION_CRON=1 
  15. OPTION_DFS=1 
  16. OPTION_DHCP=1 
  17. OPTION_DISK=1 
  18. OPTION_DNS=1 
  19. OPTION_EDIR=1 
  20. OPTION_ENV=1 
  21. OPTION_ETC=1 
  22. OPTION_EVMS=1 
  23. OPTION_HA=1 
  24. OPTION_HCREPORT=1 
  25. OPTION_IB=1 
  26. OPTION_ISCSI=1 
  27. OPTION_LDAP=1 
  28. OPTION_LUM=1 
  29. OPTION_LVM=1 
  30. OPTION_MEM=1 
  31. OPTION_MOD=1 
  32. OPTION_MPIO=1 
  33. OPTION_NCP=1 
  34. OPTION_NCS=1 
  35. OPTION_NET=1 
  36. OPTION_NFS=1 
  37. OPTION_NSS=1 
  38. OPTION_NTP=1 
  39. OPTION_OCFS2=1 
  40. OPTION_OFILES=1 
  41. OPTION_PAM=1 
  42. OPTION_PRINT=1 
  43. OPTION_PROC=1 
  44. OPTION_SAM=1 
  45. OPTION_SAR=1 
  46. OPTION_SLERT=1 
  47. OPTION_SLP=1 
  48. OPTION_SMART=0 
  49. OPTION_SMB=1 
  50. OPTION_SMS=1 
  51. OPTION_SMT=1 
  52. OPTION_SRAID=1 
  53. OPTION_SSH=1 
  54. OPTION_SYSCONFIG=1 
  55. OPTION_SYSFS=1 
  56. OPTION_UDEV=1 
  57. OPTION_UP=1 
  58. OPTION_UPD=1 
  59. OPTION_WEB=1 
  60. OPTION_X=1 
  61. OPTION_XEN=1 
  62. ADD_OPTION_EDIR=0 
  63. ADD_OPTION_FSLIST=0 
  64. ADD_OPTION_LOGS=0 
  65. ADD_OPTION_MINDISK=0 
  66. ADD_OPTION_MINYAST=0 
  67. ADD_OPTION_RPMV=0 
  68. ADD_OPTION_SLP=0 
  69. VAR_OPTION_BIN_TIMEOUT_SEC=300 
  70. VAR_OPTION_CONTACT_COMPANY="" 
  71. VAR_OPTION_CONTACT_EMAIL="" 
  72. VAR_OPTION_CONTACT_NAME="" 
  73. VAR_OPTION_CONTACT_PHONE="" 
  74. VAR_OPTION_CONTACT_STOREID="" 
  75. VAR_OPTION_CONTACT_TERMINALID="" 
  76. VAR_OPTION_CUSTOM_ARCH="" 
  77. VAR_OPTION_GPG_UID="" 
  78. VAR_OPTION_LINE_COUNT=500 
  79. VAR_OPTION_LOG_DIRS="/var/log /tmp" 
  80. VAR_OPTION_MSG_MAXSIZE=500000 
  81. VAR_OPTION_PENGINE_FILES_LIMIT=250 
  82. VAR_OPTION_SAR_FILES_LIMIT=30 
  83. VAR_OPTION_SBM=0 
  84. VAR_OPTION_SILENT=0 //Vevb.com
  85. VAR_OPTION_UNIQUE_FILE=0 
  86. VAR_OPTION_UPLOAD_ALT='https://secure-www.novell.com/upload?appname=supportconfig&file={tarball}' 
  87. VAR_OPTION_UPLOAD_TARGET='ftp://ftp.novell.com/incoming' 

配置文件中列出了默認收集的模塊信息,公司信息、郵件、電話及上傳的服務器目錄等.

五、supportconfig總結

supportconfig是使用shell 編寫的一個功能十分強大的工具,具體可以通過vim /sbin/supportconfig 查看,同時,由于linux命令上的通用性,我們甚至可以很簡單的進行修改后將其移植到其他linux 發行版上,不過顯然這是沒必要的,因為還有一個比較通的用的開源工具sosreport和其作用差不多,而其適用性更強,后面會單獨列一篇做一個總結.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 南川市| 新河县| 卢龙县| 正宁县| 黔西县| 宁蒗| 银川市| 绥中县| 黔南| 固阳县| 涞源县| 旺苍县| 长岭县| 云南省| 黎城县| 德化县| 安陆市| 霍邱县| 云林县| 达州市| 盱眙县| 大竹县| 平利县| 娱乐| 什邡市| 临夏市| 商都县| 当雄县| 石台县| 南充市| 胶州市| 郓城县| 炎陵县| 嘉禾县| 新竹县| 泰兴市| 昌乐县| 太湖县| 太白县| 社旗县| 大洼县|