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.
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
  sending packet onto dummy network device but receiving echo sabuzaki 2 1,439 Feb-12-2023, 10:31 AM
Last Post: Vadanane
  netmiko: print out specific line matches with 'Cisco IOS Software' in sh ver output sabrina 1 3,405 Nov-28-2022, 10:05 AM
Last Post: carstenlp
  performance in network host of manager in multiprocessing rmaleki 2 1,898 Mar-07-2022, 08:26 AM
Last Post: rmaleki
  Connect to device without paramiko/netmiko modules kang18 3 3,035 Jun-05-2020, 10:54 AM
Last Post: Larz60+
  Netmiko timing out after sending command c7borg 0 9,463 Mar-25-2020, 04:53 PM
Last Post: c7borg
  netmiko connecting to arista devices. dan1962 0 4,110 Feb-07-2020, 09:23 PM
Last Post: dan1962
  how virtual and host can communicate? looney99 0 2,070 Nov-28-2019, 09:08 PM
Last Post: looney99
  virtual host and real network communicate looney99 3 2,852 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 3,417 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