溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

linux中如何使用Sosreport

發(fā)布時間:2021-10-28 17:16:25 來源:億速云 閱讀:436 作者:小新 欄目:系統(tǒng)運(yùn)維

這篇文章將為大家詳細(xì)講解有關(guān)linux中如何使用Sosreport,小編覺得挺實(shí)用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

Sosreport  :一個可擴(kuò)展、可移植的支持?jǐn)?shù)據(jù)收集工具。它是一個從類 Unix  操作系統(tǒng)中收集系統(tǒng)配置詳細(xì)信息和診斷信息的工具。當(dāng)用戶提出支持服務(wù)單時,他/她必須運(yùn)行此工具并將由 Sosreport 工具生成的結(jié)果報告發(fā)送給  Red Hat 支持人員。然后,執(zhí)行人員將根據(jù)報告進(jìn)行初步分析,并嘗試找出系統(tǒng)中的問題。不僅在 RHEL 系統(tǒng)上,你可以在任何類 Unix  操作系統(tǒng)上使用它來收集系統(tǒng)日志和其他調(diào)試信息。

安裝 Sosreport

Sosreport 在 Red Hat 官方系統(tǒng)倉庫中,因此你可以使用 Yum 或 DNF 包管理器安裝它,如下所示。

$ sudo yum install sos

要么,

$ sudo dnf install sos

在 Debian、Ubuntu 和 Linux Mint 上運(yùn)行:

$ sudo apt install sosreport

用法

安裝后,運(yùn)行以下命令以收集系統(tǒng)配置詳細(xì)信息和其他診斷信息。

$ sudo sosreport

系統(tǒng)將要求你輸入系統(tǒng)的一些詳細(xì)信息,例如系統(tǒng)名稱、案例 ID 等。相應(yīng)地輸入詳細(xì)信息,然后按回車鍵生成報告。如果你不想更改任何內(nèi)容并使用默認(rèn)值,只需按回車鍵即可。

我的 CentOS 7 服務(wù)器的示例輸出:

sosreport (version 3.5) 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/sos.DiJXi7 and may be provided to a CentOS supportrepresentative. Any information provided to CentOS will be treated in accordance withthe published support policies at: https://wiki.centos.org/ The 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 [server.ostechnix.local]:Please enter the case id that you are generating this report for []: Setting up archive ...Setting up plugins ...Running plugins. Please wait ... Running 73/73: yum...Creating compressed archive... Your sosreport has been generated and saved in:/var/tmp/sosreport-server.ostechnix.local-20180628171844.tar.xz The checksum is: 8f08f99a1702184ec13a497eff5ce334 Please send this file to your support representative.

如果你不希望系統(tǒng)提示你輸入此類詳細(xì)信息,請如下使用批處理模式。

$ sudo sosreport --batch

正如你在上面的輸出中所看到的,生成了一個歸檔報告并保存在 /var/tmp/sos.DiJXi7 中。在 RHEL 6/CentOS 6 中,報告將在 /tmp 中生成。你現(xiàn)在可以將此報告發(fā)送給你的支持人員,以便他可以進(jìn)行初步分析并找出問題所在。

你可能會擔(dān)心或想知道報告中的內(nèi)容。如果是這樣,你可以通過運(yùn)行以下命令來查看它:

$ sudo tar -tf /var/tmp/sosreport-server.ostechnix.local-20180628171844.tar.xz

要么,

$ sudo vim /var/tmp/sosreport-server.ostechnix.local-20180628171844.tar.xz

請注意,上述命令不會解壓存檔,而只顯示存檔中的文件和文件夾列表。如果要查看存檔中文件的實(shí)際內(nèi)容,請首先使用以下命令解壓存檔:

$ sudo tar -xf /var/tmp/sosreport-server.ostechnix.local-20180628171844.tar.xz

存檔的所有內(nèi)容都將解壓當(dāng)前工作目錄中 ssosreport-server.ostechnix.local-20180628171844/ 目錄中。進(jìn)入目錄并使用 cat 命令或任何其他文本瀏覽器查看文件內(nèi)容:

$ cd sosreport-server.ostechnix.local-20180628171844/ $ cat uptime17:19:02 up 1:03, 2 users, load average: 0.50, 0.17, 0.10

有關(guān) Sosreport 的更多詳細(xì)信息,請參閱手冊頁。

$ man sosreport

關(guān)于“l(fā)inux中如何使用Sosreport”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI