Python Forum
Netmiko Program ssh from the Jumpssh ( host -> Jumphost -> Network Device
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Netmiko Program ssh from the Jumpssh ( host -> Jumphost -> Network Device
#1
I am getting error like below
TypeError: 'TerminalServerSSH' object is not callable
from netmiko import ConnectHandler
from getpass import getpass
from jumpssh import SSHSession
device = {
    'device_type': 'terminal_server',
    'host': '192.168.64.5',
    'username': 'admin',
    'password': getpass(),
    'ssh_config_file': './ssh_config',
}
ESW1 = {
    'device_type': 'cisco_ios',
    'host': '192.92.34.61',
    'username': 'cisco',
    'password': getpass(),
    'ssh_config_file': './ssh_config',
}
net_connect = ConnectHandler(**device)
remote_connect = net_connect(**ESW1).open()
output = remote_connect.send_command("show ip int brief | in up")
print(output)
Reply
#2
You need to provide the full stack trace, not just a small part of it.
Feel like you're not getting the answers you want? Checkout the help/rules for things like what to include/not include in a post, how to use code tags, how to ask smart questions, and more.

Pro-tip - there's an inverse correlation between the number of lines of code posted and my enthusiasm for helping with a question :)
Reply
#3
@ micseydel. what does it mean full stack trace ?
Reply
#4
This is my code and works for me,
I use it to connect to my 7x50 Nokia Router/Alcatel through Jump Server

from netmiko import ConnectHandler
from jumpssh import SSHSession

targetnode = {
'device_type': 'alcatel_sros',
'ip': 'targed_node',
'username': 'admin',
'password': 'admin',
'port': 22,
}

jh_session = SSHSession('jumpserver_ip','jumpserver_user',password='jumpserver_passwd').open()
remote_connect = ConnectHandler(**targetnode)
output = remote_connect.send_command("show router interface")
print(output)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Connect to device without paramiko/netmiko modules kang18 3 640 Jun-05-2020, 10:54 AM
Last Post: Larz60+
  netmiko: print out specific line matches with 'Cisco IOS Software' in sh ver output sabrina 0 539 Apr-20-2020, 05:52 AM
Last Post: sabrina
  connect via ssh to a remote host and run a command locally bartibog 0 407 Apr-16-2020, 02:30 PM
Last Post: bartibog
  Netmiko timing out after sending command c7borg 0 2,609 Mar-25-2020, 04:53 PM
Last Post: c7borg
  netmiko connecting to arista devices. dan1962 0 920 Feb-07-2020, 09:23 PM
Last Post: dan1962
  how virtual and host can communicate? looney99 0 607 Nov-28-2019, 09:08 PM
Last Post: looney99
  virtual host and real network communicate looney99 3 857 Nov-20-2019, 12:27 PM
Last Post: ChislaineWijdeven
  Copy data from 1 blk device in machine A to another blk device in machine B AbhishekV 2 1,394 Feb-01-2018, 11:40 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020