ESXi Shell – Fixing esxtop Output via SSH

Team evoila
17. December 2012
Reading time: 2 min

Being a big fan of command lines, I usually enable SSH on all of my ESXi hosts. I use SSH for all kinds of things: to quickly perform some VM related operation, do some configuration, check resource usage etc. etc. Using esxtop from the ESXi Shell (not resxtop from vMA), I found esxtop behaving a bit odd. This is what I get:

no termcap entry for a `screen-bce' terminal"(PDH-CSV 4.0) (UTC)(0)"," Overcommit (1 Minute Avg)","
idMemoryMemory Overcommit (5 Minute Avg)"," Overcommit (15 Minute Avg)"," Cpu LoadCpu
 Load (1 Minute Avg)"," Cpu LoadCpu Load (5 Minute Avg)"," Cpu LoadCpu Load (15 Minute Avg)
"," Cpu(0)% Processor Time"," Cpu(1)% Processor Time",

Esxtop will continue to print tons of lines like this. Is that case, press CTRL-C to exit. I found out this issue is caused by the value of the TERM environment variable as set by default:

~ # echo $TERM
~ #

Changing that value to xterm fixes the behavior of esxtop. There are few ways to do this:

Valid only for that specific command:

~ # TERM=xterm esxtop

Valid for the duration of the SSH session:

~ # export TERM=xterm
~ # esxtop

Most likely there is a way to set this value for every newly created SSH session, too, but I don’t feel well about messing with configuration like that in ESXi Shell.

Hope that helps!

EDIT: Calling dcui from an SSH session results in the same issue using OpenSSH client. The solution is the same as with esxtop:

$ TERM=xterm dcui

EDIT:  Same issue and fix when openitng a text file in vi.