b***p 发帖数: 700 | 1 就是login router,给paswd,config啊,get output
先谢了
我想自己写个tool之类的,debug ios router之类的 |
c*a 发帖数: 806 | 2 pexpect?
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 就是login router,给paswd,config啊,get output : 先谢了 : 我想自己写个tool之类的,debug ios router之类的
|
b***p 发帖数: 700 | 3 谢谢,我试试
【在 c*a 的大作中提到】![](/moin_static193/solenoid/img/up.png) : pexpect?
|
y*********n 发帖数: 95 | 4 http://www.shrubbery.net/rancid/
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 就是login router,给paswd,config啊,get output : 先谢了 : 我想自己写个tool之类的,debug ios router之类的
|
b***p 发帖数: 700 | 5 就是login router,给paswd,config啊,get output
先谢了
我想自己写个tool之类的,debug ios router之类的 |
c*a 发帖数: 806 | 6 pexpect?
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 就是login router,给paswd,config啊,get output : 先谢了 : 我想自己写个tool之类的,debug ios router之类的
|
b***p 发帖数: 700 | 7 谢谢,我试试
【在 c*a 的大作中提到】![](/moin_static193/solenoid/img/up.png) : pexpect?
|
y*********n 发帖数: 95 | 8 http://www.shrubbery.net/rancid/
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 就是login router,给paswd,config啊,get output : 先谢了 : 我想自己写个tool之类的,debug ios router之类的
|
s*****g 发帖数: 1055 | 9 It is probably not a good idea to use raw "pexpect", you will end up
spending too much time to deal with low level expect buffering, exception
catching and pattern matching, especially when you have a mixed vendor
environment, python module "paramiko"/"netmiko" works much better, just
search github.
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 谢谢,我试试
|
b***p 发帖数: 700 | 10 还真巧,上ing这个author Kirk online course
【在 s*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : It is probably not a good idea to use raw "pexpect", you will end up : spending too much time to deal with low level expect buffering, exception : catching and pattern matching, especially when you have a mixed vendor : environment, python module "paramiko"/"netmiko" works much better, just : search github.
|
|
|
c*a 发帖数: 806 | 11 Good suggestion. But still like pexpect to have the flexibility, esp. with
jump host in between.
【在 s*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : It is probably not a good idea to use raw "pexpect", you will end up : spending too much time to deal with low level expect buffering, exception : catching and pattern matching, especially when you have a mixed vendor : environment, python module "paramiko"/"netmiko" works much better, just : search github.
|
z**r 发帖数: 17771 | 12 我以前都是用shell script,做一些简单的get output之类的活。也用TCL写过一些。
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 就是login router,给paswd,config啊,get output : 先谢了 : 我想自己写个tool之类的,debug ios router之类的
|
b***p 发帖数: 700 | 13 "paramiko"/"netmiko"
这个只support ssh,不支持telnet和console,的确是奇怪
【在 s*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : It is probably not a good idea to use raw "pexpect", you will end up : spending too much time to deal with low level expect buffering, exception : catching and pattern matching, especially when you have a mixed vendor : environment, python module "paramiko"/"netmiko" works much better, just : search github.
|
s*****g 发帖数: 1055 | 14 You have no reason to support telnet in your network, problem with console
is that you may need multiple authentications (first authenticate with
console server, second authentication with device itself), you should only
need console during rare situations, ie device bringup/software upgrade etc.
Production network device management should go through inband or outband
network connections via ssh, snmp, netconf etc.
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : "paramiko"/"netmiko" : 这个只support ssh,不支持telnet和console,的确是奇怪
|
b***p 发帖数: 700 | 15 The world is not perfect. If you need to monitor standby management module,
or a glass room like route servers, or maybe a quick show command or testing
, you need telnet/console.
at least i know, in some tire-1 sp network, they still use telnet to access
routers.
etc.
【在 s*****g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : You have no reason to support telnet in your network, problem with console : is that you may need multiple authentications (first authenticate with : console server, second authentication with device itself), you should only : need console during rare situations, ie device bringup/software upgrade etc. : Production network device management should go through inband or outband : network connections via ssh, snmp, netconf etc.
|
c*a 发帖数: 806 | 16 many countries do not allow ssh, after US decided not to export encryption
software
,
testing
access
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : The world is not perfect. If you need to monitor standby management module, : or a glass room like route servers, or maybe a quick show command or testing : , you need telnet/console. : at least i know, in some tire-1 sp network, they still use telnet to access : routers. : : etc.
|
n**********l 发帖数: 271 | |
b***p 发帖数: 700 | 18 pyconsole
rtr1 = PyConsole(connection='ssh -l admin 192.168.1.54',
password='password', enable_password='password')
# Cisco IOS 12.2
rtr2 = PyConsole(connection='telnet 192.168.1.23',
user='admin', password='password', enable_password='
password')
# Linux Ubuntu 14.0
linux1 = PyConsole(connection='ssh -l super 192.168.1.102',
os='linux', password='PassWord')
output1 = rtr2.run_commands("show int brief | inc Up")
supports ssh/telnet/console |
c*a 发帖数: 806 | 19 not bad, AOL?
【在 n**********l 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Trigger : https://trigger.readthedocs.org/en/latest/
|
c*a 发帖数: 806 | 20 what's this?
Your own class extending pexpect?
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : pyconsole : rtr1 = PyConsole(connection='ssh -l admin 192.168.1.54', : password='password', enable_password='password') : # Cisco IOS 12.2 : rtr2 = PyConsole(connection='telnet 192.168.1.23', : user='admin', password='password', enable_password=' : password') : # Linux Ubuntu 14.0 : linux1 = PyConsole(connection='ssh -l super 192.168.1.102', : os='linux', password='PassWord')
|
|
|
I********x 发帖数: 858 | 21 In modern network telnet is banned because of security concerns. SSH is the
main method to access networking devices remotely.
For Cisco IOS, I am using Python Paramiko(SSH) to access CLI and get the txt
output.
Cisco IOS is not very native with Python and the output is purely txt. It is
very annoying to parse interested values from the output if you want to do
any further analysis.
【在 b***p 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 就是login router,给paswd,config啊,get output : 先谢了 : 我想自己写个tool之类的,debug ios router之类的
|
P**a 发帖数: 1267 | 22 Pexpect只能在Linux下,win下面有好的解决方案吗?
长期以来都是用Tcl/Expect的。 |
P**a 发帖数: 1267 | 23 还有就是Python 的regexp用起来太不方便了。 |
n**********l 发帖数: 271 | 24 i had a hell of time getting rancid to work with different IOS devices |
c*a 发帖数: 806 | 25 Juniper has PyEZ
https://techwiki.juniper.net/Automation_Scripting/010_Getting_Started_and_
Reference/Junos_PyEZ
Cisco 有没有类似的?
【在 n**********l 的大作中提到】![](/moin_static193/solenoid/img/up.png) : i had a hell of time getting rancid to work with different IOS devices
|