Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
expect telnet批量执行多个厂家交换机判断设备厂家
Experiences and Insight
710
views ·
0
replies ·
To
floor
Go
su_bbc
deepin
2015-08-04 06:10
Author
本帖最后由 su_bbc 于 2015-8-3 23:48 编辑
expect 批量执行telnet多个厂家交换机,如何判断设备厂家并执行相关命令
#!/usr/bin/expect
log_file chack.log
log_user 1
set timeout 5
set ip [lindex $argv 0]
set username [lindex $argv 1]
set password [lindex $argv 2]
spawn telnet $ip 5357
expect "Username:" "login:" "(none) login:"
send "$username\r"
expect "
assword:"
send "$password\r"
expect "/ $"
send "help\r"
expect eof
麻烦各位大神帮忙解决下,先谢了!
···············以找到方法··············
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
New Thread
Popular Events
More
expect 批量执行telnet多个厂家交换机,如何判断设备厂家并执行相关命令
#!/usr/bin/expect
log_file chack.log
log_user 1
set timeout 5
set ip [lindex $argv 0]
set username [lindex $argv 1]
set password [lindex $argv 2]
spawn telnet $ip 5357
expect "Username:" "login:" "(none) login:"
send "$username\r"
expect "assword:"
send "$password\r"
expect "/ $"
send "help\r"
expect eof
麻烦各位大神帮忙解决下,先谢了!
···············以找到方法··············