#!/usr/bin/expect set user username #the username configured on router set pass "password" set hostname [lindex $argv 0] #set config set timeout 60 spawn ssh $user@$hostname # -------------- do not edit below -------------- # #get data from remote devices expect "password:" send "$pass\n" expect ">" send "show ip bgp summary | begin Neighbor \n" expect ">" send "exit\n" exit 0