使用配置了 Rancid 的 CentOS 7。
我正在使用 Rancid 获取我的 Cisco 交换机配置,但似乎 Rancid 无法获取我的配置。我的日志输出:
starting: Seg Out 8 18:47:17 WEST 2018
Trying to get all of the configs.
sw-it-dist-4.cbr.net: missed cmd(s): all commands
sw-it-dist-4.cbr.net: End of run not found
sw-it-dist-4.cbr.net: clogin error: Error: Couldn't login
我的.cloginrc
文件:
add user *.net {admin}
add password *.net {PASSWORD_REMOVED} {PASSWORD_REMOVED}
add autoenable *.net 1
add method *.net ssh
add userprompt *.net {"User Name:"}
当我尝试运行时/usr/local/rancid/bin/clogin sw-it-dist-4.cbr.net
,似乎enable
缺少该命令:
rancid@it-tests logs]$ /usr/local/rancid/bin/clogin sw-it-dist-4.cbr.net
sw-it-dist-4.cbr.net
spawn ssh -x -l admin sw-it-dist-4.cbr.net
Password:
-----------------------------------------------------------------------------
=============================================================================
== UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED!!! ==
== ==
== You must have explicit, authorized permission to access or configure ==
== this device. Unauthorized attempts and actions to access or use of ==
== this system may result in civil and/or criminal penalties.
== All activities performed on this device are logged and monitored. ==
=============================================================================
-----------------------------------------------------------------------------
sw-it-dist-4>
sw-it-dist-4>
我做错了什么?
例如,如果我clogin
手动运行命令,我可以看到我的配置:
[rancid@it-tests rancid]$ /usr/local/rancid/bin/clogin -c "show runn" sw-dc-tor-1.cbr.net.wit
sw-dc-tor-1.cbr.net.wit
spawn ssh -x -l admin sw-dc-tor-1.cbr.net.wit
Password:
sw-dc-tor-1>enable
Password required, but none set
Password:
sw-dc-tor-1#
sw-dc-tor-1#terminal length 0
sw-dc-tor-1#terminal width 132
sw-dc-tor-1#show runn
Building configuration...
Current configuration : 10393 bytes
!
! Last configuration change at 13:56:17 UTC Thu Sep 27 2018 by admin
! NVRAM config last updated at 13:46:16 UTC Thu Sep 27 2018 by admin
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
(...)
但是如果我运行/usr/local/rancid/bin/rancid-run
我有这个错误:
[rancid@it-tests logs]$ tailf Switches.20181009.114630
=====================================
Getting missed routers: round 1.
sw-it-tor-1.cbr.net.wit: missed cmd(s): all commands
sw-it-tor-1.cbr.net.wit: End of run not found
sw-it-tor-1.cbr.net.wit clogin error: Error: Couldn't login
!
=====================================
Getting missed routers: round 2.
sw-it-tor-1.cbr.net.wit: missed cmd(s): all commands
sw-it-tor-1.cbr.net.wit: End of run not found
sw-it-tor-1.cbr.net.wit clogin error: Error: Couldn't login
!
我不明白我错过了什么......
编辑:
感谢你的回复。
我已经更改了autoenable
选项,并将其更改hostname
为.net.wit.
我的.cloginrc
文件:
add user *.net.wit {admin}
add password *.net.wit {PASSWORD_REMOVED} {PASSWORD_REMOVED}
add autoenable * 0
add method *.net.wit ssh
add userprompt *.net.wit {"User Name:"}
现在,如果我运行此命令,/usr/local/rancid/bin/clogin -f /home/rancid/.cloginrc sw-it-dist-4.cbr.net.wit
我将得到以下输出:
[rancid@it-tests root]$ /usr/local/rancid/bin/clogin -f /home/rancid/.cloginrc sw-it-dist-4.cbr.net.wit
sw-it-dist-4.cbr.net.wit
spawn ssh -x -l admin sw-it-dist-4.cbr.net.wit
Password:
-------------------------------------------------------------
===================================
UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED!!!
===================================
-------------------------------------------------------------
sw-it-dist-4>enable
Password:
sw-it-dist-4#
但是如果/usr/local/rancid/bin/rancid-run
在我的日志中运行我有这个:
[rancid@it-tests logs]$ tailf Switches.20181012.112810
Trying to get all of the configs.
sw-it-dist-4.cbr.net.wit: missed cmd(s): all commands
sw-it-dist-4.cbr.net.wit: End of run not found
sw-it-dist-4.cbr.net.wit clogin error: Error: Couldn't login
这次我做错了什么?