Skip to content

Instantly share code, notes, and snippets.

@cmur2
Last active January 1, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmur2/8118431 to your computer and use it in GitHub Desktop.
Save cmur2/8118431 to your computer and use it in GitHub Desktop.
#!/usr/bin/expect
set timeout 20
set name [lindex $argv 0]
set user [lindex $argv 1]
set password [lindex $argv 2]
spawn telnet $name
expect "login: "
send "$user\n"
expect "Password: "
send "$password\n"
expect "$ "
send "monitor/trafficMtr/summary wanId 1\n"
expect "Percentage of this Month's Limit"
expect "$ "
send "exit\n"
expect eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment