Annotate your router sessions

The November Technical Services News from Cisco included the Annotating Troubleshooting Sessions document from the Cisco’s support wiki. The document describes two well hidden features of Cisco IOS:

  • The send log exec-level command writes a line in the syslog, allowing you to delineate logging or debugging outputs.
  • The exclamation mark used as the first character in any IOS command line (not just in the configuration) serves as a comment. If you’re logging the TTY session, you can use these comments to document the session.

9 comments:

  1. That exclamation mark is useful in one other subtle little way. If you've typed out a really long command and just realized that you need to go enable something else first, you can CNTL-A and add in the exclamation mark. Hit return and go do what's in need of doing. Then you can up arrow back and do another CNTL-A to remove the exclamation.

    ReplyDelete
  2. I've always used script(1) to record console sessions, myself:

    script(1) man page

    ReplyDelete
  3. Ahh, the lucky ones that use Linux as the default operating system :)

    @Scott: That's simply brilliant. Thanks for sharing this tip.

    ReplyDelete
  4. Is it only me not getting timestamps in front of user generated logs (7600/SRB2)?

    %SYS-7-USERLOG: Message from 1(XXX): TEST
    %SYS-2-USERLOG: Message from 1(XXX): TEST2

    "service timestamps log" is configured and normal logs include the timestamp in front of them.

    ReplyDelete
  5. Then we're faced with YAWB (Yet-Another-Weird-Behavior :)

    ReplyDelete
  6. ok, 6500/SXH3a shows it fine (using a different message!), but it doesn't give you the option to define a custom severity level (having 2 as default!).

    Nov 24 19:54:32: %SYS-2-LOGMSG: Message from 1(XXX): TEST

    I guess Cisco is still experimenting with it.

    ReplyDelete
  7. In which version of IOS that command has been implemented? Is there any way to log a message with a different facility as well?

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.