title: Paramiko exec_command with multiple commands on Cisco router not providing any output
body: <pre><code>login_user = 'xyz'
  login_pass = 'xyz'
  ssh = paramiko.SSHClient()
  ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False, timeout=5)
  print "success loggedin"
  stdin, stdout, stderr = ssh.exec_command("term len 0 ; show int desc | i Tu ; show ip interface brief | in Tunnel ; show ip bgp vpnv4 vrf AWS summary | i 169.25 ; show ip route vrf AWS bgp")
  all_output = stdout.read()
  print all_output
  </code></pre>
  
  <p>Above is my code snippet, passing just one command prints the results just fine, however with multiple commands as above, it does not work (no output). The device being logged onto is a Cisco ASR1006 - Does it have anything to do with the device?</p>
  
  <p>Any help is much appreciated!</p>
  
  <hr>
  
  <p>Since multiple commands didn't work, I'm using below code with multiple exec_command, but this this takes about 30-40 secs each execution..
  ssh.connect needed for each command execution?</p>
  
  <pre><code>ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show int desc | i Tu')
  vpc_ints = stdout.read()
  ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show ip interface brief | in Tunnel')
  vpc_peers = stdout.read()
  ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show ip bgp vpnv4 vrf AWS summary | i 169.25')
  vpc_bgp_routes = stdout.read()
  ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show ip route vrf AWS bgp')
  ip_routes_list = stdout.read()
  </code></pre>
  
  <hr>
  
  <p>As suggested in comments, I have also tried to call <code>exec_command</code> multiple times over one connection:</p>
  
  <pre><code>ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show int desc | i Tu')
  vpc_ints = stdout.read()
  #ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show ip interface brief | in Tunnel')
  vpc_peers = stdout.read()
  #ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show ip bgp vpnv4 vrf AWS summary | i 169.25')
  vpc_bgp_routes = stdout.read()
  #ssh.connect(device, username=login_user, password=login_pass, look_for_keys=False)
  stdin, stdout, stderr = ssh.exec_command('show ip route vrf AWS bgp')
  ip_routes_list = stdout.read()
  ssh.close()
  </code></pre>
  
  <p>But that's failing with:</p>
  
  <pre class="lang-none prettyprint-override"><code>File "C:\Python27\myvpndashboard\myvpnapp\tunnel_summary.py", line 179, in dataset_build
  cisco_show(device)
  File "C:\Python27\myvpndashboard\myvpnapp\tunnel_summary.py", line 36, in cisco_show
  stdin, stdout, stderr = ssh.exec_command('show ip interface brief | in Tunnel')
  File "C:\Users\sduraisami\Envs\myvpndashboard\lib\site-packages\paramiko\client.py", line 472, in exec_command
  chan = self._transport.open_session(timeout=timeout)
  File "C:\Users\sduraisami\Envs\myvpndashboard\lib\site-packages\paramiko\transport.py", line 765, in open_session
  timeout=timeout)
  File "C:\Users\sduraisami\Envs\myvpndashboard\lib\site-packages\paramiko\transport.py", line 889, in open_channel
  raise e
  EOFError
  </code></pre>