linux中supportconfig安装与使用方法

SEO研究中心 SEO研究中心提供免费SEO公开课

由于工作原因,平时需要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-qlsupportutils
  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. SupportUtilities-Supportconfig
  4. ScriptVersion:2.25-197
  5. ScriptDate:20100402
  6. =============================================================================
  7. Usage:supportconfig[OPTION[OPTION...]]
  8. -hThisscreen
  9. -AActivatesallsupportconfigfunctionswithadditionalloggingandfull
  10. rpmverification.
  11. -B<string>Customtarballfilenameelement
  12. -CCreatesanewdefault/etc/supportconfig.conf
  13. -DUsedefaults;ignore/etc/supportconfig.conf
  14. -E<string>Contactemailaddress
  15. -FDisplayavailablesupportconfigfeaturekeywords(case-sensitive)used
  16. with-iand-x
  17. -G<gpg_uid>TheGPGrecipient'suserIDusedtoencryptthesupportconfigtarball
  18. -H<number>LimitnumberofincludedHAPolicyenginefiles
  19. -I<number>Defaultlogfilelinecount
  20. -LCreateafullfilelistingfrom'/'
  21. -M<string>ContactterminalID
  22. -N<string>Contactname
  23. -O<string>Contactcompanyname
  24. -P<string>Contactphonenumber
  25. -QRuninsilentmode
  26. -R<path>Logoutputdirectory
  27. -S<number>LimitnumberofincludedSARfiles
  28. -T<seconds>Binaryexecutiontimeout
  29. -U<URIstring>SetsuploadtargetURLandinitiatesanupload,supported
  30. servicesinclude:ftp,scp,http,https
  31. -M<string>ContactstoreID
  32. -X<number>Maxsystemlogslinecount
  33. -aUploadthetarballtothespecifiedalternatetargetVAR_OPTION_UPLOAD_ALT
  34. -bScreenbuffermode
  35. -dExcludedetaileddiskinfoandscans
  36. -eSearchrootfilesystemforeDirectoryinstances;-Limplied.Bepatient.
  37. -fFromdirectory.Don'tcollectreportfiles,justusefilesinthat
  38. directory.
  39. -gUsegzipinsteadofthedefaultbzip2compression.
  40. -i<keywordlist>
  41. Includekeywords.Acommaseparatedlistoffeaturekeywordsthatspecify
  42. whichfeaturestoinclude.Use-Ftoseealistofvalidkeywords.
  43. -lGathersadditionalrotatedlogs
  44. -mOnlygatheraminimumamountofinfo:basicenv,basichealth,hardware,
  45. rpm,messages,y2logs
  46. -oTogglelistedfeaturesonoroff
  47. -pDisableallplugins
  48. -qAddauuidtothetarballfilenametoensureuniqueness
  49. -r<srnum>
  50. IncludestheNovell11digitservicerequestnumberwhenuploading
  51. thetarballtoNovell
  52. -sIncludefullSLPservicelists
  53. -tTargetdirectory.Justsavelogfileshere,donotcreatetarball.
  54. -uUploadthetarballtothespecifiedVAR_OPTION_UPLOAD_TARGET.
  55. -vPerformsanrpm-VforeachinstalledrpmNOTE:Thistakesalongtime
  56. tocomplete
  57. -x<keywordlist>
  58. Excludekeywords.Acommaseparatedlistoffeaturekeywordsthatspecify
  59. whichfeaturestoexclude.Use-Ftoseealistofvalidkeywords.
  60. -yOnlygathertheminimumy2logfiles.
  61. UseCtrl-totryandskipafunctionthatishanging.
  62. -----------------------------------------------------------------------------
  63. NOTE:
  64. Thistoolwillcreateatarballinthe/var/logdirectory.Pleaseattach
  65. thelogfiletarballtoyouropenService.RequestatthefollowingURL:
  66. https://secure-support.novell.com/eService_enu
  67. IfyoucannotattachthetarballtotheSR,thenemailittotheengineer.
  68. Pleasesubmitbugfixesorcommentsvia:
  69. http://en.opensuse.org/Supportutils#Reporting_Bugs
  70. =============================================================================
  71. SupportUtilities-Supportconfig
  72. ScriptVersion:2.25-197
  73. ScriptDate:20100402
  74. =============================================================================

默认supportconfig或supportconfig -A执行后会将收集后的结果打包为一个nts_主机名_日期.tbz 文件,同时会生成一个以该文件名加.md5后缀的文件.

三、supportconfig常用示例

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

  1. #supportconfig
  2. =============================================================================
  3. SupportUtilities-Supportconfig
  4. ScriptVersion:2.25-290
  5. ScriptDate:20110714
  6. =============================================================================
  7. Gatheringsysteminformation
  8. DataDirectory:/var/log/nts_361way.com_140825_1504
  9. BasicServerHealthCheck...Done
  10. RPMDatabase...Done
  11. BasicEnvironment...Done
  12. BasicHealthReport...Done
  13. SystemModules...Done
  14. MemoryDetails...Done
  15. DiskI/O...Done
  16. YaSTFiles...Done
  17. Auditing...Done
  18. CrashInfo...Done
  19. NTP...Done
  20. PROC...Done
  21. BootFiles...Done
  22. SLERT...Skipped
  23. Updates...Done
  24. SMT...Skipped
  25. NovelleDirectory...PleaseWait...Skipped
  26. NovellLUM...Skipped
  27. NovellNCP...Skipped
  28. NovellNSS...Skipped
  29. NovellDFS...Skipped
  30. NovellSMS...Skipped
  31. NovellNCS...Skipped
  32. NovellAFP...Skipped
  33. NovellCIFS...Skipped
  34. NovelliManager...Skipped
  35. HACluster...Skipped
  36. OCFS2...Skipped
  37. DRBD...Skipped
  38. PAM...Done
  39. LDAP...Done
  40. CIMOM...Done
  41. OpenFiles...Done
  42. Environment...Done
  43. ETC...Done
  44. SYSCONFIG...Done
  45. SYSFS...Done
  46. SystemDaemons...Done
  47. CRON...Done
  48. AT...Done
  49. UDEV...Done
  50. LVM...PleaseWait...BaseDetailDone
  51. EVMS...Skipped
  52. SoftwareRaid...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. SARFiles...Done
  66. AppArmor...Done
  67. Xen...Done
  68. KVM...Done
  69. X...Done
  70. Printing...Done
  71. SMARTDisks...Excluded
  72. Hardware...PleaseWait...Done
  73. FileSystemList...Skipped
  74. SupportabilityAnalysis...PleaseWait...Done
  75. SystemLogs...Done
  76. CreatingTarBall
  77. ==[DONE]===================================================================
  78. Logfiletarball:/var/log/nts_361way.com_140825_1504.tbz
  79. Logfilesize:4.0M
  80. Logfilemd5sum:484b111cda54ca04419facd82a1da7d7
  81. PleaseattachthelogfiletarballtoyouropenServiceRequestatthe
  82. followingURL:
  83. https://secure-support.novell.com/eService_enu
  84. Youcanalsouploadthetarballtoftp.novell.com/incoming,orjustuse
  85. supportconfig-ur<srnum>,touploadthetarballautomatically.
  86. IfyoucannotattachthetarballtotheSR,thenemailittotheengineer.
  87. =============================================================================

其他常用用法:

  1. //以最小选项搜集所需的信息
  2. #supportconfig-m
  3. //在输出中包含附加的联系人信息
  4. #supportconfig-Etux@example.org-N"TuxPenguin"-O"PenguinInc."...
  5. //要查看完整的功能列表
  6. #supportconfig-F
  7. //仅收集某个模块的用法,如LVM相的信息
  8. #supportconfig-iLVM
  9. //-x的功能与-i刚好相反,是排除某个模块不收集
  10. #supportconfig-xLVM
  11. //使用-Uurl可以将收集的结果上传到服务器上,直接的服务有ftp,scp,http,https,如:
  12. #supportconfig-A-Uhttp://www.361way.com/files/

具体可以参看官方的常用的supportconfig选项部分,supportconfig收集的系统健康报告,代码如下:

  1. #supportconfig-A
  2. #cd/var/log
  3. #tarjxvfnts_361way.com_140825_1504.tbz
  4. #morebasic-health-report.txt
  5. #==[Command]======================================#
  6. #/usr/bin/schealth-q
  7. ######################################################################
  8. SupportconfigHealthCheckReportToolv1.00-5
  9. DateChecked:09/12/1404:40:37
  10. ######################################################################
  11. HealthCheckFiles[Green]
  12. ProcessesWaitingforRunQueue[Green]
  13. KernelTaintStatus[Red]
  14. KernelTainted:64>0
  15. CPUUtilization[Green]
  16. InterruptsPerSecond[Green]
  17. ContextSwitchesPerSecond[Green]
  18. FreeMemoryandDiskSwapping[Green]
  19. UsedDiskSpace[Green]
  20. UninterruptibleProcesses[Green]
  21. ZombieProcesses[Green]
  22. ######################################################################
  23. Status:RedFlag
  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. #DefaultOptions
  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 //phpfensi.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和其作用差不多,而其适用性更强,后面会单独列一篇做一个总结.

相关广告
  • linux中supportconfig安装与使用方法 linux中supportconfig安装与使用方法 linux中supportconfig安装与使用方法
相关阅读

linux中supportconfig安装与使用方法

2019/10/10 17:47:16 | 谷歌SEO算法 | 友情链接作弊