Created
April 26, 2015 08:26
-
-
Save hafthanhf/953557b5aa7c61d71c02 to your computer and use it in GitHub Desktop.
display BGP session status on Juniper router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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