2

Below is my driver information where I need to pull the data(Firmware Version) using ssh script as show below.

ncmdvstk:~ $ ssh admin@153.88.127.21
Password:

MSM760 V. 5.3.6.18-01-9124
(C) 2010 Hewlett-Packard Development Company, L.P.

CLI> enable
CLI# show system info
 [CPU info]   [Mem in  fo]
Firmware Version: 5.3.6.18-01-9124         Load 1min:       0.34   Total RAM:  9 

This is the program I am using to read all the data first in "data" variable, so that later i can split n get info i need but where as no data it's printing in print data:

ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('153.88.127.21', username='admin',password='catfish')

stdin, stdout, stderr = ssh.exec_command("enable")
stdin.write('show system info \n')
data = stdout.read() 
print data 

Please correct me on getting the data.

aculich
  • 14,545
  • 9
  • 64
  • 71
vinod reddy
  • 133
  • 1
  • 2
  • 12

1 Answers1

0

You need to add a call to stdin.flush() after the stdin.write() otherwise the input you're sending will stay buffered.

aculich
  • 14,545
  • 9
  • 64
  • 71