Add a "terminal monitor" command to cli

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Adding a terminal monitor, or the like, as is available with other vendors to allow real time monitoring of logging information while in a cli session. 
Photo of BJ

BJ, Champ

  • 374 Posts
  • 45 Reply Likes

Posted 4 years ago

  • 1
Photo of Brian Ambler

Brian Ambler

  • 245 Posts
  • 126 Reply Likes
Hi BJ,

We do have a "debug console" in our device CLI, perhaps this is what you are looking for?

labap1#debug console     console   Show debug messages on the console
labap1#debug console 
    <cr>         
    all         Show all messages on the console
    level       Specify a logging level
    timestamp   Show debug messages timestamp

Don't let the name fool you, you are able to display logging levels other than debug level.

labap1#debug console level     emergency      Show emergency-level log entries (Default: debug)
    alert          Show log entries from alert to emergency levels
                   (Default: debug)
    critical       Show log entries from critical to emergency levels
                   (Default: debug)
    error          Show log entries from error to emergency levels
                   (Default: debug)
    warning        Show log entries from warning to emergency levels
                   (Default: debug)
    notification   Show log entries from notification to emergency levels
                   (Default: debug)
    info           Show log entries from info to emergency levels (Default:
                   debug)
    debug          Show log entries for all severity levels (Default:
                   debug)

Hope this helps
Photo of BJ

BJ, Champ

  • 374 Posts
  • 45 Reply Likes
It looks promising. I'll give it  a try.
Photo of Brian Ambler

Brian Ambler

  • 245 Posts
  • 126 Reply Likes
Thanks BJ, just let me know. One thing to note, the log order in the debug console, since it is realtime, is reversed from the buffered log, which is historical. So just keep in mind that while the log order in the buffered log is newest to oldest, the log order when running the debug console is oldest to newest.
Photo of BJ

BJ, Champ

  • 374 Posts
  • 45 Reply Likes
Exactly what I was looking for, and even more convenient than other vendors since I can select the logging level from a single command. 
Photo of Brian Ambler

Brian Ambler

  • 245 Posts
  • 126 Reply Likes
Excellent BJ, glad to hear the debug console fit your use case.

Also, I did not mention it in my previous post, but just type "no debug console" to disable the console from printing.
Photo of J. Goodnough

J. Goodnough, Champ

  • 266 Posts
  • 32 Reply Likes
A trick that I've used is to enter no debug console first, then the relevant debugging command. That way if your screen gets completely dumped on you can easily just tap up-up-enter and not have to try to type through the mess.
Photo of Brian Ambler

Brian Ambler

  • 245 Posts
  • 126 Reply Likes
I wouldn't say this a trick, but rather good common sense. I guess I did not mention this when I made my initial response, but I just assumed (perhaps incorrectly) that this would be assumed by anyone having enough knowledge of the CLI to be using this command.

But if this is not the case, then yes, I would recommend (as J mentioned), if you are actually tracking debug commands (which BJ was not), enter your commands, then enter "debug console" to start the console. You may do as J mentions, but regardless as to whether your typing "no debug console" to stop the console shows up on one line, it will be processed by the CLI. So nothing fancy is needed, the CLI will correctly interpret the command.
Photo of J. Goodnough

J. Goodnough, Champ

  • 266 Posts
  • 32 Reply Likes
well sure, and a good typist won't have problems doing it, it's just a bit distracting - and if you are looking for something in particular, being able to stop the listing as fast as possible is helpful.
Photo of Brian Ambler

Brian Ambler

  • 245 Posts
  • 126 Reply Likes
You can hit [return] or q to insert a break into the debug console temporarily as well. Also, being a good typist is hardly required, as I mentioned, just because the command can possibly be broken up by a stream of commands, the CLI still interprets the "no debug console" as the printed text is not registered as entered commands.

I just want people to be aware that this is not a limitation of the debug console. They are certainly free to follow your tip, but it is by no means required.