Find the answer to your Linux question:
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 ...
  1. #1
    hom
    hom is offline
    Just 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# "?

  2. #2
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Been there. Send the IOS command
    terminal length 0
    in exec mode first.

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    3
    What type of data are you needing from the Cisco?

  4. #4
    Just 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.

  5. #5
    hom
    hom is offline
    Just 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...