cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1923
Views
0
Helpful
2
Replies

BPX8620 automatic script...

imirochnik
Level 1
Level 1

Hello everyone,

I so need your help regarding automatic receiving data from BPX8620 machine.

Problem description: when the command “dsptrkstats 1.1” runs on BPX, statistic screen is appear and overwrite

once in time. For stop this command “DEL” must be hit ("Hit DEL key to quit: ").

I wrote a simply script for getting statistics automatically, but BPX doesn’t receive the ascii code 177 (DEL).

#! /usr/users/svplus/tools/expect

set timeout 30

spawn telnet BPXtest

expect timeout {

send_user "Sorry, Unable to telnet! Quitting…”

exit 1

} “Enter User ID: “

send "UserName\r"

expect "Enter Password: “

send "Passwd\r"

expect -re "Next Command: "

send "dsptrkstats 1.1\r"

expect -re "Hit DEL key to quit: “

send "\177"

expect -re "Next Command: "

send "bye\r"

Q. What code must be send as "DEL" to BPX?

2 Replies 2

mchin345
Level 6
Level 6

As you mentioned we have to hit the DEL command to stop the command output from dsptrkstats 1.1. And the code for the DEL command is 177. If the BPX machine is not accepting the code then you may not be able to achieve this . That is it is not possible to write a script to automatically receive data from the BPX.

You may want to try" CTRL-C" or "CTRL - break" or just "break" and check if the dsptrkstats 1.1 command gets terminated. If you can , try using the corresponding ASCII code in the script.

Thank you for the explanation.

I will try.

Add. Q. What is "corresponding ASCII code" and how to use it in the expect scripts?

Review Cisco Networking for a $25 gift card