I'm using paramiko for performing esxtop command on my VMware ESXI. To receive the output i try to write the file in a text file . the problem is that i'm not getting the proper output from the script.
Steps performed:
1. Login through ssh_client.
2.`stdin,stdout,stderr = ssh_client.exec_command("TERM=xterm esxtop" , get_pty=True)`
#TERM=xterm is to set Environment variable to set the proper listing out esxtop command
3.with open("output.txt", "w") as infile:
for line in iter(stdout.readline, ""):
infile.write(line)
# Writing the output to the output.txt file.
The problem is that i'm not getting Complete output and it looks like this error:
125236 125236 esxtop.96492 1 81.97 76.35 0.00 10.56 ^[[K^M
it is not showing output after ^[[K^M.
Can anyone suggest me a solution for this. Thanks in advance. Arshpreet