This project is read-only.

how to get long messages from cisco router

Nov 28, 2013 at 4:22 AM
Edited Nov 28, 2013 at 4:31 AM
I'm trying to get log from cisco router but it cuts response.

How to get full text messages from router?
>show log
Syslog logging: enabled (11 messages dropped, 0 messages rate-limited,
                0 flushes, 0 overruns, xml disabled, filtering disabled)
    Console logging: level debugging, 54 messages logged, xml disabled,
                     filtering disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
                     filtering disabled
    Buffer logging: level debugging, 54 messages logged, xml disabled,
                    filtering disabled
    Logging Exception size (4096 bytes)
    Count and timestamp logging messages: disabled

No active filter modules.

    Trap logging: level informational, 58 message lines logged
            var cmd = client.CreateCommand("show log ");   
            var asynch = cmd.BeginExecute();

            var reader = new StreamReader(cmd.OutputStream);

            while (!asynch.IsCompleted)
                var result = reader.ReadToEnd();
                if (string.IsNullOrEmpty(result))
Marked as answer by uugan on 11/27/2013 at 8:31 PM
Nov 29, 2013 at 3:01 AM

If you are seeing "--More--", that might mean that your terminal session in the cisco device is at the terminal's number of lines. You can change this to not page by the command:

"terminal pager 0"

This will turn paging off...
Jun 16, 2014 at 11:50 PM

I would love to get your example working, as I have the exact same problem you originally posted about. 50,000+ rows of 50 byte output...

I tried to just run it, and of course (because it was me) it failed. I have been using SshNet for a while synchronously, so I don't know how to add the things in your example that might be missing.. :(

Any advice appreciated! :)