Rancid clogin error

Using CentOS 7 with Rancid configured. I'm using Rancid to get my Cisco switches configuration, but seems that Rancid isn't able to get my configs. The output of my logs: starting: Seg Out 8 18:4...

Using CentOS 7 with Rancid configured.

I’m using Rancid to get my Cisco switches configuration, but seems that Rancid isn’t able to get my configs. The output of my logs:

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

My .cloginrc file:

add user *.net {admin}
add password *.net {PASSWORD_REMOVED} {PASSWORD_REMOVED}
add autoenable *.net            1
add method *.net ssh
add userprompt *.net  {"User Name:"}

When I tried to run /usr/local/rancid/bin/clogin sw-it-dist-4.cbr.net it looks like the enable command is missing:

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>

What I’m doing wrong?

For example, if I run the clogin command manually I’m able to see my configuration:

[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
(...)

But if I run the /usr/local/rancid/bin/rancid-run I have this error:

[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
!

I don’t understand what I’m missing…


Edit:

Thank you for your reply.

I’ve changed the autoenable option, and changed the hostname to .net.wit.

My .cloginrc file:

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:"}

Now if I run this command /usr/local/rancid/bin/clogin -f /home/rancid/.cloginrc sw-it-dist-4.cbr.net.wit I have this output:

[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#

But if run the /usr/local/rancid/bin/rancid-run in my logs I have this:

[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

What I’m doing wrong this time?

I have configured a hp switch on Rancid. i have no problems when am able to clogin and hlogin into the switch.when i run the rancid and check my logs when i check my logs i get the following output. I also need to check my config files.where do i check that.kindly help me on this.

These are the outputs of my log files:


Trying to get all of the configs.
unknown router manufacturer for 10.2.0.13: hp1
unknown router manufacturer for 10.2.0.200: ibm
10.2.0.13 clogin error: Error: TIMEOUT reached
10.2.0.13: missed cmd(s): show tech transceivers,show module,show config status,show system-information,show system information,show stack,show version,show flash,write term,show config files
10.2.0.13: End of run not found
;
=====================================
Getting missed routers: round 1.
unknown router manufacturer for 10.2.0.200: ibm
unknown router manufacturer for 10.2.0.13: hp1
10.2.0.13 clogin error: Error: TIMEOUT reached
10.2.0.13: missed cmd(s): show tech transceivers,show module,show config status,show system-information,show system information,show stack,show version,show flash,write term,show config files
10.2.0.13: End of run not found
;
=====================================
Getting missed routers: round 2.
unknown router manufacturer for 10.2.0.200: ibm
unknown router manufacturer for 10.2.0.13: hp1
10.2.0.13 clogin error: Error: TIMEOUT reached
10.2.0.13: missed cmd(s): show tech transceivers,show module,show config status,show system-information,show system information,show stack,show version,show flash,write term,show config files
10.2.0.13: End of run not found
;
=====================================
Getting missed routers: round 3.
unknown router manufacturer for 10.2.0.200: ibm
unknown router manufacturer for 10.2.0.13: hp1
10.2.0.13 clogin error: Error: TIMEOUT reached
10.2.0.13: missed cmd(s): show tech transceivers,show module,show config status,show system-information,show system information,show stack,show version,show flash,write term,show config files
10.2.0.13: End of run not found
;
=====================================
Getting missed routers: round 4.
unknown router manufacturer for 10.2.0.200: ibm
unknown router manufacturer for 10.2.0.13: hp1
10.2.0.13 clogin error: Error: TIMEOUT reached
10.2.0.13: missed cmd(s): show tech transceivers,show module,show config status,show system-information,show system information,show stack,show version,show flash,write term,show config files
10.2.0.13: End of run not found
;
=====================================
Getting missed routers: round 5.
unknown router manufacturer for 10.2.0.200: ibm
unknown router manufacturer for 10.2.0.13: hp1
10.2.0.13 clogin error: Error: TIMEOUT reached
10.2.0.13: missed cmd(s): show tech transceivers,show module,show config status,show system-information,show system information,show stack,show version,show flash,write term,show config files
10.2.0.13: End of run not found
;

cvs diff: Diffing .
cvs diff: Diffing configs
cvs commit: Examining .
cvs commit: Examining configs
/usr/local/rancid/bin/control_rancid: 503: /usr/local/rancid/bin/control_rancid: sendmail: not found

ending: Mon Feb 3 14:32:35 EST 2014

Я установил Rancid в своей системе Ubuntu 14.04 для пары устройств, которые все работают нормально, за исключением всех устройств типа ‘foundry’ (Brocade) . Каждый час задание cron выполняет прогорклый запуск от имени прогоркшего пользователя. Я тестировал как flogin , так и бинарные сценарии входа в систему clogin .

flogin

Вот что я вижу в каждом журнале:

<switch>: End of run not found 0 || 0
<switch> flogin error: Error: TIMEOUT reached
<switch>: missed cmd(s): show version,show flash,show module,write term,show running-config,show chassis
<switch>: End of run not found

Мой файл .clogin выглядит как нормально:

rancid@ubuntu14.04:~$ cat /home/rancid/.cloginrc 
add autoenable * 1
add method * ssh
add user * rancid
add password * Jg278edd.fisd%1y

SSH-соединение с коммутаторами обычным способом работает нормально. Но запуск скрипта flogin вручную дает мне следующее:

rancid@ubuntu14.04:/var/lib/rancid/bin$ ./flogin -c 'show version' <switch>
s0.nikhef.nl
spawn ssh -c 3des -x -l rancid s0.nikhef.nl
rancid@s0.nikhef.nl's password: 
SSH@s0.nikhef.nl>
Error: TIMEOUT reached

Для входа в систему требуется около 10 секунд, и после этого кажется, что он не выполняет команду, указанную мной после флага -c. И еще через 10-20 секунд он выходит после того, как достигнет значения TIMEOUT Rancid.

clogin

Этот скрипт отлично работает … (но он не переходит в режим exec, игнорирует автоматическое включение 1) ..

rancid@ubuntu14.04:/var/lib/rancid/bin$ ./clogin -c 'show version' <switch>
<switch>
spawn ssh -c 3des -x -l rancid <switch>
rancid@<switch>'s password: 
SSH@<switch>>
SSH@<switch>>terminal length 0
Invalid input -> terminal length 0
Type ? for a list
SSH@<switch>>terminal width 132
Invalid input -> terminal width 132
Type ? for a list
SSH@<switch>>show version
 SW: Version 04.2.00b Copyright (c) 1996-2010 Brocade Communications Systems, 
...

SSH@<switch>>exitConnection to <switch> closed by remote host.
Connection to <switch> closed.

Итак, я подумал, почему бы не заменить код flogin на код clogin и все такое быть в порядке, правда? Ручной тест подтвердил это, но выполнение прогорклого запуска не привело к получению конфигураций, а просто показывает это в журналах:

<switch>: End of run not found 0 || 0
<switch>: missed cmd(s): show chassis,show running-config,write term,show flash,show version,show module
<switch>: End of run not found

Что осталось отладить?

Was able to get v1.0.0 installed, getting the same error.

Here is the zenrancid command I’m running, below that is log output from the rancid log file.

[zenoss@opsview logs]$ zenrancid run —device=10.20.0.251 -v 20
2013-09-03 16:28:11,925 INFO zen.zenrancid: call init
2013-09-03 16:28:11,927 INFO zen.zenrancid: main_loop started in rancidd
2013-09-03 16:28:12,141 INFO zen.zenrancid: Starting Rancid for device 10.20.0.251
2013-09-03 16:28:12,822 INFO zen.rancidd: Daemon rancidd shutting down

[zenoss@opsview logs]$

starting: Tue Sep 3 16:25:22 MDT 2013

Trying to get all of the configs.
10.20.0.251 clogin error: Error: missing close-bracket
10.20.0.251: missed cmd(s): dir /all slavedisk2:,show rsp chassis-info,show capture,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr chassis,dir /all sec-nvram:,show di
ag chassis-info,dir /all disk2:,show running-config view full,dir /all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all disk0:,show install active,show bootvar,d
ir /all slaveslot0:,dir /all sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir /all sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir /all hard
diskb:,show variables boot,show boot,show inventory raw,dir /all slavedisk1:,show env all,show module,show shun,show controllers,show diagbus,more system:running-config,dir /
all slavedisk0:,show debug,show idprom backplane,dir /all bootflash:,dir /all sup-bootdisk:,dir /all sec-slot0:,dir /all sec-disk1:,write term,show vtp status,dir /all sup-bo
otflash:,dir /all slot2:,dir /all harddisk:,dir /all slot0:,dir /all sup-microcode:,show vlan,dir /all slavebootflash:,show controllers cbus,dir /all slaveslot1:,dir /all nvr
am:,show version,show vlan-switch,show redundancy secondary,show running-config,show c7200,dir /all slot1:
10.20.0.251: End of run not found

!

Getting missed routers: round 1.
10.20.0.251 clogin error: Error: missing close-bracket
10.20.0.251: missed cmd(s): dir /all slavedisk2:,show rsp chassis-info,show capture,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr chassis,dir /all sec-nvram:,show di
ag chassis-info,dir /all disk2:,show running-config view full,dir /all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all disk0:,show install active,show bootvar,d
ir /all slaveslot0:,dir /all sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir /all sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir /all hard
diskb:,show variables boot,show boot,show inventory raw,dir /all slavedisk1:,show env all,show module,show shun,show controllers,show diagbus,more system:running-config,dir /
all slavedisk0:,show debug,show idprom backplane,dir /all bootflash:,dir /all sup-bootdisk:,dir /all sec-slot0:,dir /all sec-disk1:,write term,show vtp status,dir /all sup-bo
otflash:,dir /all slot2:,dir /all harddisk:,dir /all slot0:,dir /all sup-microcode:,show vlan,dir /all slavebootflash:,show controllers cbus,dir /all slaveslot1:,dir /all nvr
am:,show version,show vlan-switch,show redundancy secondary,show running-config,show c7200,dir /all slot1:
10.20.0.251: End of run not found

!

Getting missed routers: round 2.
10.20.0.251 clogin error: Error: missing close-bracket
10.20.0.251: missed cmd(s): dir /all slavedisk2:,show rsp chassis-info,show capture,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr chassis,dir /all sec-nvram:,show di
ag chassis-info,dir /all disk2:,show running-config view full,dir /all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all disk0:,show install active,show bootvar,d
ir /all slaveslot0:,dir /all sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir /all sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir /all hard
diskb:,show variables boot,show boot,show inventory raw,dir /all slavedisk1:,show env all,show module,show shun,show controllers,show diagbus,more system:running-config,dir /
all slavedisk0:,show debug,show idprom backplane,dir /all bootflash:,dir /all sup-bootdisk:,dir /all sec-slot0:,dir /all sec-disk1:,write term,show vtp status,dir /all sup-bo
otflash:,dir /all slot2:,dir /all harddisk:,dir /all slot0:,dir /all sup-microcode:,show vlan,dir /all slavebootflash:,show controllers cbus,dir /all slaveslot1:,dir /all nvr
am:,show version,show vlan-switch,show redundancy secondary,show running-config,show c7200,dir /all slot1:
10.20.0.251: End of run not found

!

Getting missed routers: round 3.
10.20.0.251 clogin error: Error: missing close-bracket
10.20.0.251: missed cmd(s): dir /all slavedisk2:,show rsp chassis-info,show capture,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr chassis,dir /all sec-nvram:,show di
ag chassis-info,dir /all disk2:,show running-config view full,dir /all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all disk0:,show install active,show bootvar,d
ir /all slaveslot0:,dir /all sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir /all sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir /all hard
diskb:,show variables boot,show boot,show inventory raw,dir /all slavedisk1:,show env all,show module,show shun,show controllers,show diagbus,more system:running-config,dir /
all slavedisk0:,show debug,show idprom backplane,dir /all bootflash:,dir /all sup-bootdisk:,dir /all sec-slot0:,dir /all sec-disk1:,write term,show vtp status,dir /all sup-bo
otflash:,dir /all slot2:,dir /all harddisk:,dir /all slot0:,dir /all sup-microcode:,show vlan,dir /all slavebootflash:,show controllers cbus,dir /all slaveslot1:,dir /all nvr
am:,show version,show vlan-switch,show redundancy secondary,show running-config,show c7200,dir /all slot1:
10.20.0.251: End of run not found

!

Getting missed routers: round 4.
10.20.0.251 clogin error: Error: missing close-bracket
10.20.0.251: missed cmd(s): dir /all slavedisk2:,show rsp chassis-info,show capture,dir /all sec-slot2:,show diag,dir /all disk1:,show gsr chassis,dir /all sec-nvram:,show di
ag chassis-info,dir /all disk2:,show running-config view full,dir /all sec-bootflash:,show spe version,dir /all slaveslot2:,dir /all disk0:,show install active,show bootvar,d
ir /all slaveslot0:,dir /all sec-slot1:,dir /all harddiska:,dir /all slavenvram:,show flash,dir /all sec-disk2:,dir /all slavesup-bootflash:,dir /all sec-disk0:,dir /all hard
diskb:,show variables boot,show boot,show inventory raw,dir /all slavedisk1:,show env all,show module,show shun,show controllers,show diagbus,more system:running-config,dir /
all slavedisk0:,show debug,show idprom backplane,dir /all bootflash:,dir /all sup-bootdisk:,dir /all sec-slot0:,dir /all sec-disk1:,write term,show vtp status,dir /all sup-bo
otflash:,dir /all slot2:,dir /all harddisk:,dir /all slot0:,dir /all sup-microcode:,show vlan,dir /all slavebootflash:,show controllers cbus,dir /all slaveslot1:,dir /all nvr
am:,show version,show vlan-switch,show redundancy secondary,show running-config,show c7200,dir /all slot1:
10.20.0.251: End of run not found
!

ending: Tue Sep 3 16:25:22 MDT 2013

Понравилась статья? Поделить с друзьями:
  • R session aborted r encountered a fatal error
  • Quixel bridge error could not send data over port 13081
  • Query parse error
  • Qt session management error could not open network socket
  • Qt designer как изменить фон