Python Forum

Full Version: Netmiko Program ssh from the Jumpssh ( host -> Jumphost -> Network Device
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
You need to provide the full stack trace, not just a small part of it.
@ micseydel. what does it mean full stack trace ?
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)