That's the thing, sometimes there was no output but the expect command would match because the word "down" was in the command. I did find what I needed though by using the parenthesis to match newline and put things in the expect_out array. For example (this is just off the top of my head for...
I have an issue where expect is matching the actual remote command instead of the output. The code is:
send "show card 1 | match down\r"
expect {
"down" {write_card_fail $host}
}
The problem is expect matches the "down" from the command and not the actual output of the command. Anyway to...
Ok, I think I came up with a solution. I went ahead with my original plan, but moved the backup and verify functions under the log_in function:
proc log_in {host} {
global spawn_id
spawn telnet $host
exp_internal 1
set timeout 30
expect {
"Connect failed" { fail $host; return }...
Hello,
I have an Expect script that logs into a number of routers to perform backups and it works pretty well. The problem I am having is figuring what to do when the host is not responding.
Here is the snippet for the log in procedure:
proc log_in {host} {
global spawn_id
spawn telnet...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.