Skip to content

Instantly share code, notes, and snippets.

@hafthanhf
Created April 26, 2015 08:26
Show Gist options
  • Save hafthanhf/953557b5aa7c61d71c02 to your computer and use it in GitHub Desktop.
Save hafthanhf/953557b5aa7c61d71c02 to your computer and use it in GitHub Desktop.
display BGP session status on Juniper router
#!/usr/bin/expect
set user digicom_noc
set pass "digicom@)!#"
set hostname [lindex $argv 0]
#set config
set timeout 120
spawn ssh $user@$hostname
# -------------- do not edit below -------------- #
#get data from remote devices
expect "password:"
send "$pass\n"
expect ">"
send "set cli logical-system PE \n"
expect ">"
send "show bgp summary | find AS | except inet | no-more | except AS \n"
expect ">"
send "exit\n"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment