1

Can someone please help in finding whats wrong with this code. Its not display anything

import paramiko

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(
paramiko.AutoAddPolicy())

ssh.connect('135.279.151.56', username='raft',  password='raft01')
stdin, stdout, stderr = ssh.exec_command('top')

print stdout.readlines()

ssh.close()
user2211059
  • 43
  • 1
  • 4

1 Answers1

0

try 'top -b -n1' It should work for you.

-b is for working in batch mode. No inputs are accepted and top quits after -n number iterations that is 1 here

user2211059
  • 43
  • 1
  • 4