[rancid] Re: F5 load balancer support
Sam Munzani
smunzani at comcast.net
Fri Jul 13 21:43:24 UTC 2007
Lance,
I edited f5login file and added "-d" on expect line. Below is what I see
in debug.
clear[5Df5login test-f5-01
expect version 5.43.0
argv[0] = /usr/local/bin/expect argv[1] = -d argv[2] =
/opt/rancid/bin/f5login argv[3] = test-f5-01
set argc 1
set argv0 "/opt/rancid/bin/f5login"
set argv "test-f5-01"
executing commands from command file /opt/rancid/bin/f5login
test-f5-01
spawn ssh -c 3des -x -l root test-f5-01
using master pty /dev/ptyp2
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {30412}
expect: does "" (spawn_id exp4) match regular expression "(Connection
refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does "" (spawn_id exp4) match glob pattern "unknown host\r"? no
expect: does "" (spawn_id exp4) 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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? no
"([Pp]assword|passwd):"? no
"(#| \(enable\))"? no
"Login invalid"? no
Password:
expect: does "Password: " (spawn_id exp4) match regular expression
"(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does "Password: " (spawn_id exp4) match glob pattern "unknown
host\r"? no
expect: does "Password: " (spawn_id exp4) 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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? 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) "exp4"
expect: set expect_out(buffer) "Password:"
send: sending "***********\r" to { exp4 }
expect: continuing expect
expect: does " " (spawn_id exp4) match regular expression "(Connection
refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " " (spawn_id exp4) match glob pattern "unknown host\r"? no
expect: does " " (spawn_id exp4) 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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? no
"([Pp]assword|passwd):"? no
"(#| \(enable\))"? no
"Login invalid"? no
expect: does " \r\n" (spawn_id exp4) match regular expression
"(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " \r\n" (spawn_id exp4) match glob pattern "unknown host\r"? no
expect: does " \r\n" (spawn_id exp4) 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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? no
"([Pp]assword|passwd):"? no
"(#| \(enable\))"? no
"Login invalid"? no
Last login: Fri Jul 13 14:38:03 2007 from 172.24.100.12
expect: does " \r\nLast login: Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n" (spawn_id exp4) match regular expression
"(Connection refused|Secure connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " \r\nLast login: Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n" (spawn_id exp4) match glob pattern "unknown host\r"? no
expect: does " \r\nLast login: Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n" (spawn_id exp4) 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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? yes
expect: set expect_out(0,string) "login:"
expect: set expect_out(1,string) "login"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) " \r\nLast login:"
send: sending "root\r" to { exp4 }
expect: continuing expect
expect: does " Fri Jul 13 14:38:03 2007 from 172.24.100.12\r\r\n"
(spawn_id exp4) match regular expression "(Connection refused|Secure
connection [^\n\r]+ refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " Fri Jul 13 14:38:03 2007 from 172.24.100.12\r\r\n"
(spawn_id exp4) match glob pattern "unknown host\r"? no
expect: does " Fri Jul 13 14:38:03 2007 from 172.24.100.12\r\r\n"
(spawn_id exp4) 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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? no
"([Pp]assword|passwd):"? no
"(#| \(enable\))"? no
"Login invalid"? no
[root at test-f5-01:Active] config #
expect: does " Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n[root at test-f5-01:Active] config # " (spawn_id exp4)
match regular expression "(Connection refused|Secure connection [^\n\r]+
refused)"? no
"(Connection closed by|Connection to [^\n\r]+ closed)"? no
expect: does " Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n[root at test-f5-01:Active] config # " (spawn_id exp4)
match glob pattern "unknown host\r"? no
expect: does " Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n[root at test-f5-01:Active] config # " (spawn_id exp4)
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
"@[^\r\n]+ ([Pp]assword|passwd):"? no
"(Username|Login|login|user name):"? no
"([Pp]assword|passwd):"? no
"(#| \(enable\))"? yes
expect: set expect_out(0,string) "#"
expect: set expect_out(1,string) "#"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) " Fri Jul 13 14:38:03 2007 from
172.24.100.12\r\r\n[root at test-f5-01:Active] config #"
send: sending "\r" to { exp4 }
expect: does " " (spawn_id exp4) match regular expression "[\r\n]+"? no
"^(.+:)1 (#| \(enable\))"? no
"^.+(#| \(enable\))"? no
"^.+> \(enable\)"? no
ro
expect: does " ro" (spawn_id exp4) match regular expression "[\r\n]+"? no
"^(.+:)1 (#| \(enable\))"? no
"^.+(#| \(enable\))"? no
"^.+> \(enable\)"? no
ot
-bash: root: command not found
[root at test-f5-01:Active] config #
expect: does " root\r\n-bash: root: command not
found\r\n[root at test-f5-01:Active] config # " (spawn_id exp4) match
regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) " root\r\n"
expect: continuing expect
expect: does "-bash: root: command not found\r\n[root at test-f5-01:Active]
config # " (spawn_id exp4) match regular expression "[\r\n]+"? yes
expect: set expect_out(0,string) "\r\n"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "-bash: root: command not found\r\n"
expect: continuing expect
expect: does "[root at test-f5-01:Active] config # " (spawn_id exp4) match
regular expression "[\r\n]+"? no
"^(.+:)1 (#| \(enable\))"? no
"^.+(#| \(enable\))"? yes
expect: set expect_out(0,string) "[root at test-f5-01:Active] config #"
expect: set expect_out(1,string) "#"
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "[root at test-f5-01:Active] config #"
tty_raw_noecho: was raw = 0 echo = 1
spawn id exp4 sent <\r\n>
spawn id exp4 sent <[root at test-f5-01:Active] config # >
[root at test-f5-01:Active] config # spawn id exp0 sent <\r>
spawn id exp4 sent <\r\n>
spawn id exp4 sent <[root at test-f5-01:Active] config # >
[root at test-f5-01:Active] config # spawn id exp0 sent <e>
spawn id exp4 sent <e>
espawn id exp0 sent <x>
spawn id exp4 sent <x>
xspawn id exp0 sent <i>
spawn id exp4 sent <i>
ispawn id exp0 sent <t>
spawn id exp4 sent <t>
tspawn id exp0 sent <\r>
spawn id exp4 sent <\r\nlogout\r\n>
logout
spawn id exp4 sent <\u001b[H\u001b[J>
[H[Jspawn id exp4 sent <Connection to test-f5-01 closed.\r\r\n>
Connection to test-f5-01 closed.
interact: received eof from spawn_id exp4
tty_set: raw = 0, echo = 1
tty_set: raw = 3, echo = 0
$
$
> What error(s) do you get when you try to run your f5rancid?
>
> Where does it fail if you debug your f5login?
>
>
> -lance
>
>
>> -------- Original Message --------
>> Subject: [rancid] F5 load balancer support
>> From: Sam Munzani <smunzani at comcast.net>
>> Date: Fri, July 13, 2007 12:45 pm
>> To: rancid-discuss at shrubbery.net
>>
>> Hi,
>>
>> Did anybody happened to hack one of Cisco scripts to support BigIP F5
>> boxes? It should be pretty simple. All I want to do is login and type "b
>> list" which is equivalent of "show run" on cisco.
>>
>> However for some reason things not working. All I did was copied clogin
>> to f5login, copied rancid to f5rancid and added following to rancid-fe.
>> elsif ($vendor =~ /^f5$/i) { exec('f5rancid', $router); }
>>
>> Then modified f5 rancid file and kept only one command in list of
>> commands "b list".
>>
>> For some reason its not working. I can post my configs here if somebody
>> like to see them.
>>
>> Thanks,
>> Sam
>> _______________________________________________
>> Rancid-discuss mailing list
>> Rancid-discuss at shrubbery.net
>> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20070713/b49e1dc7/attachment.html
More information about the Rancid-discuss
mailing list