0
votes

I am having a script which execute some commands in different line cards parallay ,Issue is script is running successfully on 6 line cards but for more then that it says send: spawn id exp10 not open.

I am doing telnet to the same ip in the script and then attaching to line cards,here for each session script is creating same expect spawn id may be that's why it says spawn id not open as session might have expired for some previous line cards.

But i put some sleep to make sure no background session gets expire still I see that more then 6 session expect is not able to do in the back ground.

script is something line this-

for {set current_card 1} {$current_card <= $cv_total_cards} {incr current_card} {
    puts "Triggering execution on Card $current_card "
    eval exec ./exeCommandsOnLCCards.tcl "some card specific arguments" >/dev/null &
    sleep 5
    }
}
cat exeCommandsOnLCCards.tcl 
spawn telnet <telnet_ip>
expect "'^]'"
sleep 2
expect "login: "
send -- "root\r"
expect "assword: "
send -- "<password>\r"
expect "#"

Please let me know if anybody have faced similar issue.

1

1 Answers

0
votes

Please ignore this.There is no issue with the script. Its due to the security restriction in the router.It started working if I increased the allowed parallel telnet sessions.