match of the clogin -d o/p below.
Post by David YoungThanks for the assistance!
David
Post by john heasleyPost by David YoungHi all,
http://www.shrubbery.net/pipermail/rancid-discuss/2009-January/003614.html
It seems that running RANCID against an extreme switch puts it into an
"unsaved" state (maybe because of the clipaging?), and so while the
first run is successful, any subsequent runs fail because of the
asterisk in the prompt...
"expect -nobrace -re {* 300e48-x.([^#>\r\n]+)?[#>](\([^)\r\n]+\))?}
{} -re {[
^M]+} { exp_continue }"
this should work; it used to. we have one for testing but its not up yet.
send the o/p of clogin -d -s 'show version' host >log 2>&1. that should
identify the issue.
i'd first make sure that you're using expect >= 5.43 and rancid 2.3.3.
myswitch.local
spawn telnet myswitch.local
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {810}
expect: does "" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does "" (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does "" (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? no
"([Pp]assword|passwd):"? no
">"? no
"Login invalid"? no
Trying 192.168.23.12...
Connected to myswitch.local (192.168.23.12).
Escape character is '^]'.
expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n" (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n" (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? no
"([Pp]assword|passwd):"? no
">"? no
"Login invalid"? no
Copyright (C) 1999 by Extreme Networks
expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by Extreme Networks\r\r\nlogin: " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by Extreme Networks\r\r\nlogin: " (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by Extreme Networks\r\r\nlogin: " (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? yes
expect: set expect_out(0,string) "login:"
expect: set expect_out(1,string) "login"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "Trying 192.168.23.12...\r\r\nConnected to myswitch.local (192.168.23.12).\r\r\nEscape character is '^]'.\r\r\n\r\nCopyright (C) 1999 by Extreme Networks\r\r\nlogin:"
send: sending "admin\r" to { exp6 }
expect: continuing expect
expect: does " " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " " (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does " " (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? no
"([Pp]assword|passwd):"? no
">"? no
"Login invalid"? no
admin
expect: does " admin\r\npassword: " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " admin\r\npassword: " (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does " admin\r\npassword: " (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? no
"([Pp]assword|passwd):"? yes
expect: set expect_out(0,string) "password:"
expect: set expect_out(1,string) "password"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) " admin\r\npassword:"
send: sending "n5wf5nz#\r" to { exp6 }
expect: continuing expect
expect: does " " (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " " (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does " " (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? no
"([Pp]assword|passwd):"? no
">"? no
"Login invalid"? no
Press the <tab> key at any time for completions.
Don't forget to save your configuration change
expect: does " \r\n\r\nPress the <tab> key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match regular expression "(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " \r\n\r\nPress the <tab> key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match glob pattern "unknown host\r"? no
expect: does " \r\n\r\nPress the <tab> key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match glob pattern "Host is unreachable"? no
"No address associated with name"? no
"(Host key not found |The authenticity of host .* be established).*(yes/no)?"? no
"HOST IDENTIFICATION HAS CHANGED.* (yes/no)?"? no
"Offending key for .* (yes/no)?"? no
"(denied|Sorry)"? no
"Login failed"? no
"% (Bad passwords|Authentication failed)"? no
"Press any key to continue"? no
"Enter Selection: "? no
"Last login:"? no
"(Username|Login|login|user name|User):"? no
"([Pp]assword|passwd):"? no
">"? yes
expect: set expect_out(0,string) ">"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) " \r\n\r\nPress the <tab>"
send: sending "enable\r" to { exp6 }
expect: does " key at any time for completions.\r\nDon't forget to save your configuration change" (spawn_id exp6) match regular expression "(Username|Login|login|user name|User):"? no
"[Pp]assword:"? no
"#"? no
"(enable)"? no
"(denied|Sorry|Incorrect)"? no
"% Error in authentication"? no
"% Bad passwords"? no
s.
* switch2-na:1 #
expect: does " key at any time for completions.\r\nDon't forget to save your configuration changes.\r\n* switch2-na:1 # " (spawn_id exp6) match regular expression "(Username|Login|login|user name|User):"? no
"[Pp]assword:"? no
"#"? yes
expect: set expect_out(0,string) "#"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) " key at any time for completions.\r\nDon't forget to save your configuration changes.\r\n* switch2-na:1 #"
send: sending "\r" to { exp6 }
expect: does " " (spawn_id exp6) match regular expression "[\r\n]+"? no
"^(.+[:.])1 (#)"? no
"^.+#"? no
enable
Syntax error at end of line.
autodst bootp bootprelay cli-
expect: does " enable\r\n\r\nSyntax error at end of line.\r\n\r\nNext possible completions:\r\n\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) " enable\r\n\r\n"
expect: continuing expect
expect: does "Syntax error at end of line.\r\n\r\nNext possible completions:\r\n\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "Syntax error at end of line.\r\n\r\n"
expect: continuing expect
expect: does "Next possible completions:\r\n\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "Next possible completions:\r\n"
expect: continuing expect
expect: does "\tautodst bootp bootprelay cli-" (spawn_id exp6) match regular expression "[\r\n]+"? no
"^(.+[:.])1 (#)"? no
"^.+#"? no
config-logging clipaging
dvmrp edp esrp gvrp icmp
idletimeouts igmp ignore-stp iparp ipforwarding
ipmcforwarding iproute isq ipxrip ipxsap
jumbo irdp learning license log
mirroring multinetting ospf pace pim-dm
ports qosmonitor radius rip rmon
sharing smartredundancy snmp sntp-client stpd
subvlan-proxy-arp summitlink syslog telnet type20
web <spanning tree name>
* switch2-na:2 #
expect: does "\tautodst bootp bootprelay cli-config-logging clipaging \r\n\tdvmrp edp esrp gvrp icmp \r\n\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\tautodst bootp bootprelay cli-config-logging clipaging \r\n"
expect: continuing expect
expect: does "\tdvmrp edp esrp gvrp icmp \r\n\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\tdvmrp edp esrp gvrp icmp \r\n"
expect: continuing expect
expect: does "\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\tidletimeouts igmp ignore-stp iparp ipforwarding \r\n"
expect: continuing expect
expect: does "\tipmcforwarding iproute isq ipxrip ipxsap \r\n\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\tipmcforwarding iproute isq ipxrip ipxsap \r\n"
expect: continuing expect
expect: does "\tjumbo irdp learning license log \r\n\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"
expect: set expect_out(buffer) "\tjumbo irdp learning license log \r\n"
expect: continuing expect
expect: does "\tmirroring multinetting ospf pace pim-dm \r\n\tports qosmonitor radius rip rmon \r\n\tsharing smartredundancy snmp sntp-client stpd \r\n\tsubvlan-proxy-arp summitlink syslog telnet type20 \r\n\tweb <spanning tree name> \r\n* switch2-na:2 # " (spawn_id exp6) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp6"