mikrotik_routeros incomplete output
See original GitHub issueHi, I’m working on automating a mixture of devices and ran into issues. Using a minimal testscript I found the mikrotik to behave differently. I tried:
def testcmd(ipaddr, devicetype, MyCmd):
DeviceInfo = {
'device_type': devicetype,
'host': ipaddr,
'username': "admin",
'password': "admin",
'global_cmd_verify':False
}
net_connect = ConnectHandler(**DeviceInfo)
output = net_connect.send_command(MyCmd)
net_connect.disconnect()
print("{" + output + "}\n")
testcmd("192.168.73.20", "mikrotik_routeros", "export")
testcmd("192.168.37.30", "hp_procurve", "sh run")
which gave an incomplete result for routeros (yes, tried against multiple devices)
{port
# sep/23/2020 15:12:36 by RouterOS 6.46.7 # # model = RB750Gr3 /interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik /ip hotspot profile set [ find default=yes ] html-directory=flash/hotspot }
{ Running configuration:
; J9019B Configuration Editor; Created on release #Q.11.74
hostname “ProCurve Switch 2510B-24” snmp-server contact “helpdesk” snmp-server location “Lab” trunk 23-24 Trk1 LACP vlan 1 name “DEFAULT_VLAN” untagged 1-22,25-26,Trk1 ip address dhcp-bootp exit ip authorized-managers 192.168.1.0 255.255.255.0 aaa authentication login privilege-mode aaa authentication console login radius local aaa authentication telnet login radius local aaa authentication telnet enable radius local aaa authentication web login radius local aaa authentication ssh login radius local aaa authentication ssh enable radius local radius-server timeout 2 spanning-tree spanning-tree Trk1 priority 4 ip ssh password manager password operator }
Next step I tried:
def testcmd(ipaddr, devicetype, MyCmd):
DeviceInfo = {
'device_type': devicetype,
'host': ipaddr,
'username': "admin",
'password': "admin",
'global_cmd_verify':False
}
net_connect = ConnectHandler(**DeviceInfo)
if devicetype == "mikrotik_routeros":
output = net_connect.send_command_timing(MyCmd)
else:
output = net_connect.send_command(MyCmd)
net_connect.disconnect()
print("{" + output + "}\n")
testcmd("192.168.73.20", "mikrotik_routeros", "export")
testcmd("192.168.37.30", "hp_procurve", "sh run")
which gave the result I expected in the first place
{# sep/23/2020 15:13:33 by RouterOS 6.46.7 # # model = RB750Gr3 /interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik /ip hotspot profile set [ find default=yes ] html-directory=flash/hotspot /ip neighbor discovery-settings set discover-interface-list=!dynamic /ip dhcp-client add disabled=no interface=ether5 /ip service set telnet disabled=yes set ftp disabled=yes set api disabled=yes set api-ssl disabled=yes /ip ssh set forwarding-enabled=remote strong-crypto=yes /snmp set enabled=yes /system clock set time-zone-name=Europe/Stockholm /system logging add action=remote topics=critical add action=remote topics=error add action=remote topics=info add action=remote topics=warning /system routerboard settings set silent-boot=yes /tool graphing interface add /tool graphing queue add /tool graphing resource add /tool romon set enabled=yes /user aaa set use-radius=yes
}
{ Running configuration:
; J9019B Configuration Editor; Created on release #Q.11.74
hostname “ProCurve Switch 2510B-24” snmp-server contact “helpdesk” snmp-server location “Lab” trunk 23-24 Trk1 LACP vlan 1 name “DEFAULT_VLAN” untagged 1-22,25-26,Trk1 ip address dhcp-bootp exit ip authorized-managers 192.168.1.0 255.255.255.0 aaa authentication login privilege-mode aaa authentication console login radius local aaa authentication telnet login radius local aaa authentication telnet enable radius local aaa authentication web login radius local aaa authentication ssh login radius local aaa authentication ssh enable radius local radius-server timeout 2 spanning-tree spanning-tree Trk1 priority 4 ip ssh password manager password operator }
Is this expected? a bug? programmer error? Any suggestions or ideas?
//Tonny
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top GitHub Comments
Keeping an eye out for the next update. Still cant get a good output from my MT router with the changes above and in other threads. Getting partial output from commands.
should be fixed in this PR:
https://github.com/ktbyers/netmiko/pull/2362