gdt: Kangaroo road sign (Default)
[personal profile] gdt

When tracking bugs it is useful to have the time the command was run. This is particularly so with networking bugs, as traffic counters without the time they were observed are a bit pointless. It's handy if each command is automatically timestamped.

Cisco IOS
Router> terminal exec prompt timestamp 
Router> show version
Load for five secs: 5%/5%; one minute: 5%; five minutes: 5%
Time source is NTP, 07:01:02.345 UTC Fri Aug 2 2013
Cisco IOS Software...

You can make this the login default:

line vty 0 15
 exec prompt timestamp
Juniper JUNOS
root@amnesiac> set cli timestamp format "%Y-%m-%d %T"
root@amnesiac> show version 
2013-08-02 07:01:02
Hostname: amnesiac...
There is a command macro facility you can use to make this the login default.
Linux
$ trap 'date --utc "+%Y-%m-%d %H:%M:%S.%N"' DEBUG
$ uname -r
2013-08-02 07:01:02.157011493
3.9.6-200.fc18.x86_64
2013-08-02 07:01:02.159011493

If you just want to print the command start time then there is discussion of pre-exec hooks for bash here and a well-known script.

You can make this the login default by editing ~/.bash_profile in the usual way.

This account has disabled anonymous posting.
(will be screened)
(will be screened)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

Profile

gdt: Kangaroo road sign (Default)
Glen Turner

September 2021

S M T W T F S
   1234
567891011
121314151617 18
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2026-01-02 07:00
Powered by Dreamwidth Studios