Results 1 to 5 of 5
I'm trying to write an expect script to get some data off a cisco content switch. I telnet to the switch and get logged in no problem. Where I run ...
- 12-21-2010 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 2
expect script question
I'm trying to write an expect script to get some data off a cisco content switch. I telnet to the switch and get logged in no problem. Where I run into difficulty is after issuing a command
send -- "show service summary\r"
This command will return a hundred or so lines with data that is different from run to run. Every 24 lines (depending on terminal size) it will prompt "--More---" at which point I need to send a space to get the next page of data. I need to continue sending spaces at the "--More---" prompt until I get back to my shell prompt.
I've tried a number of solutions but I get the same behavior each time. I see the first 24 lines and the "--More---" prompt, but I'm hung at that point.
Can anyone offer a way to ignore the lines of data, sending spaces when seeing "--More---", until getting my prompt back "CS11503# "?
- 12-22-2010 #2
Been there. Send the IOS command
terminal length 0
in exec mode first.
- 12-22-2010 #3Just Joined!
- Join Date
- Dec 2010
- Posts
- 3
What type of data are you needing from the Cisco?
- 12-22-2010 #4Just Joined!
- Join Date
- Oct 2010
- Posts
- 2
Just in case you consider perl an alternative I did a pretty big project reading many routers to collect usage data using the following module from CPAN ~joshua/Net-Telnet-Cisco-1.10/Cisco.pm
Worked great.
- 12-22-2010 #5Just Joined!
- Join Date
- Dec 2010
- Posts
- 2
Thanks all, especially greyhairweenie. "terminal length 0" did not work for me, but "no terminal more" worked great.
thenewbe, I am getting the state of each service from the content switch, and writing a custom alarm to alert if a service has been suspended for more then an hour.


Reply With Quote