#!/usr/bin/expect ########################################################################### ######## get the bgp infomation from logical-system in Juniper router ##### ##############----- hafthanhf ------################################# ########################################################################### set user username #the username configured on router set pass "password" set hostname [lindex $argv 0] set ls [lindex $argv 1] #set config set timeout 60 spawn ssh digicom_noc@$hostname # -------------- do not edit below -------------- # #get data from remote devices expect "password:" send "$pass\n" expect ">" send " set cli logical-system $ls\n" expect ">" send "show bgp summary |find AS | except inet | no-more \n" expect ">" send "exit\n" exit 0