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.
  2. I've always used script(1) to record console sessions, myself:

    script(1) man page
  3. Ahh, the lucky ones that use Linux as the default operating system :)

    @Scott: That's simply brilliant. Thanks for sharing this tip.
  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.
  5. @Tassos: Have you configured "service timestamps debug"? Sometimes Cisco IOS has a weird idea what "debugging" and "logging" is.
  6. Yes, both log & debug are configured.
  7. Then we're faced with YAWB (Yet-Another-Weird-Behavior :)
  8. 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.
  9. In which version of IOS that command has been implemented? Is there any way to log a message with a different facility as well?
Add comment
Sidebar