您好,登錄后才能下訂單哦!
這期內容當中小編將會給大家帶來有關如何解決ESXi 主機上最重要的調試工具esxtop輸出滿屏亂碼的問題,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
VMware vSphere 6.7中,允許登錄 SSH登錄ESXi主機后,我試著運行了一下esxtop,沒有看到類似Linux top相似的結果,卻看到滿屏幕的亂碼。如下:
no termcap entry for a `xterm-256color' terminal"(PDH-CSV 4.0) (UTC)(0)", "\\172.localdomain\Memory\Memory Overcommit (1 Minute Avg)", "\\172.localdomain\Memory\Memory Overcommit (5 Minute Avg)", "\\172.localdomain\Memory\Memory Overcommit (15 Minute Avg)", "\\172.localdomain\Physical Cpu Load\Cpu Load (1 Minute Avg)", "\\172.localdomain\Physical Cpu Load\Cpu Load (5 Minute Avg)", "\\172.localdomain\Physical Cpu Load\Cpu Load (15 Minute Avg)", "\\172.localdomain\Physical Cpu(0)\% Processor Time", "\\172.localdomain\Physical Cpu(1)\% Processor Time", "\\172.localdomain\Physical Cpu(_Total)\% Processor Time", "\\172.localdomain\Physical Cpu(0)\% Util Time", "\\172.localdomain\Physical Cpu(1)\% Util Time", "\\172.localdomain\Physical Cpu(_Total)\% Util Time", "\\172.localdomain\Memory\Machine MBytes"," \\172.localdomain\Memory\Kernel MBytes", "\\172.localdomain\Memory\NonKernel MBytes", "\\172.localdomain\Memory\Free MBytes", "\\172.localdomain\Memory\Kernel Managed MBytes", "\\172.localdomain\Memory\Kernel MinFree MBytes", "\\172.localdomain\Memory\Kernel Reserved MBytes", "\\172.localdomain\Memory\Kernel Unreserved MBytes", "\\172.localdomain\Memory\Kernel State", "\\172.localdomain\Memory\PShare Shared MBytes", "\\172.localdomain\Memory\PShare Common MBytes", "\\172.localdomain\Memory\PShare Savings MBytes", "\\172.localdomain\Memory\Swap Used MBytes", "\\172.localdomain\Memory\Swap Target MBytes", "\\172.localdomain\Memory\Swap MBytes Read/sec", "\\172.localdomain\Memory\Swap MBytes Write/sec", "\\172.localdomain\Memory\Total Compressed MBytes", "\\172.localdomain\Memory\Total Saved By Compression MBytes", "\\172.localdomain\Memory\Memctl Current MBytes", "\\172.localdomain\Memory\Memctl Target MBytes", "\\172.localdomain\Memory\Memctl Max MBytes", "\\172.localdomain\Power\Power Usage Now Watts", "\\172.localdomain\Power\Power Usage Cap Watts", "\\172.localdomain\VSAN\Enabled?", "\\172.localdomain\Group Cpu(1:system)\Members", "\\172.localdomain\Group Cpu(1:system)\% Used", "\\172.localdomain\Group Cpu(1:system)\% Run", "\\172.localdomain\Group Cpu(1:system)\% System", "\\172.localdomain\Group Cpu(1:system)\% Wait", "\\172.localdomain\Group Cpu(1:system)\% Ready", "\\172.localdomain\Group Cpu(1:system)\% Idle", "\\172.localdomain\Group Cpu(1:system)\% Overlap", "\\172.localdomain\Group Cpu(1:system)\% CoStop", "\\172.localdomain\Group Cpu(1:system)\% Max Limited", "\\172.localdomain\Group Cpu(1:system)\% Swap Wait", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% Used", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% Run", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% System", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% Wait", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% VmWait", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% Ready", "\\172.localdomain\Vcpu(1:system:2097153:idle1)\% Idle",
本來vSphere還得依靠它來查看系統信息呢,esxtop卻亂成一團,這可如何是好?去網上搜一搜,居然也有人經歷過相同的遭遇,VMware官網上有解決方法,如下:
[root@172:~] echo $TERM xterm-256color
第1行中的no termcap entry for a `xterm-256color' terminal就是告訴我們:對于xterm-256color這種控制終端,在本機的數據庫里沒有找到,所以就顯示不出來正確的格式。既然不支持,就找一個能支持的終端吧。
[root@172:~] find /usr/share/terminfo/ -type f /usr/share/terminfo/v/vt102 /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /usr/share/terminfo/l/linux /usr/share/terminfo/a/ansi
看吧,terminfo數據里能被ESXi主機支持的控制終端有5個,隨便選一個來試試。
# TERM=XTERM esxtop
設為第2種xterm。馬上就好了!另外幾種,也都可以。問題暫時解決了。要是下一次登錄,又不能顯示,怎么辦?
那就在/etc/bashrc里添加這個TERM變量。不行,沒有這個文件。/etc/profile倒是有,不過是只讀的,root也沒有權限修改。倒是有個/etc/profile.local的權限是1644,root是用戶,可以修改。打開來看,里面有一句說:
This file is not used when UEFI secure boot is enabled.
意思是說,要是使用UEFI安全啟動,這個文件就廢了。不管那么多了,修改一下,在里面添加這么兩句:
TERM=xterm
export $TERM
然后,再引用一下這個文件。
# source /etc/profile.local
測試一下。先把TERM設為別的變量。
# TERM=test # source /etc/profile.local # echo $TERM
顯示的是xterm。下次vSphere重新啟動的時候,會讀這個文件嗎?我還沒有試過。
上述就是小編為大家分享的如何解決ESXi 主機上最重要的調試工具esxtop輸出滿屏亂碼的問題了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。