In VMware vSphere 6.7, after SSH is allowed to log in to the ESXi host, I tried to run esxtop. I didn't see the similar results of Linux top, but I saw the full screen garbled code. As follows:

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",

Originally, vSphere had to rely on it to view system information, but esxtop was in a mess. What should I do? To search online, some people have experienced the same experience. There are solutions on VMware's official website, as follows:

Step 1: check the settings of terminal variables

[root@172:~] echo $TERM
xterm-256color

The no termcap entry for a 'xterm-256color' terminal in line 1 tells us that the control terminal of xterm-256color is not found in the local database, so the correct format cannot be displayed. Since it's not supported, find a terminal that can support it.

Step 2 find the format supported by ESXi host

[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

Look, there are 5 control terminals in terminfo data that can be supported by ESXi host. Choose any one to try.

Step 3 set the terminal format

# TERM=XTERM esxtop

Set to the second xterm. Right away. Other kinds, also OK. The problem has been solved for the time being. What if the next login fails to display?

Then add the TERM variable to / etc/bashrc. No, there is no such document. /etc/profile is available, but it is read-only, and root does not have permission to modify it. The permissions of / etc/profile.local are 1644. Root is the user and can be modified. Open it, there is a saying:

This file is not used when UEFI secure boot is enabled.

This means that if UEFI is used for safe startup, this file will be discarded. No matter how much, revise it and add two sentences:

TERM=xterm

export $TERM

Then, refer to the file again.

# source /etc/profile.local

Test it. First, set TERM to another variable.

# TERM=test
# source /etc/profile.local
# echo $TERM

It shows xterm. Will this file be read the next time vSphere restarts? I haven't tried yet.

 

Reference: https://kb.vmware.com/s/article/2001448