ネットワークエンジニアになろう! > IOS Tips > exec prompt timestamp - show コマンドを実行した時刻を知る

exec prompt timestamp - show コマンドを実行した時刻を知る

このログ、何時に採ったの?

お客様から送られてきたログを見ていると、怪しい箇所を発見しました。

「このカウンターの上がり方は異常だよね」

そのshow コマンドは複数回連続して採ってあり、カウンター値が異常に増えている事が見て取れます。
でも、このshow コマンドはどれくらいの間隔で実行したのでしょうか?
コマンドの出力にタイムスタンプが付いていないので分かりません。

多くの人は、show clock コマンドを使ってコマンド実行時の時刻を表示させているようです。

Router#
Router#show clock
03:24:18.664 UTC Thu Dec 29 2005

Router#
Router#show interfaces ethernet 0/0
Ethernet0/0 is up, line protocol is up
Hardware is AmdP2, address is 0050.500b.9100 (bia 0050.500b.9100)
Internet address is 1.60.50.54/8
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:02, output hang never
Last clearing of "show interface" counters never
Input queue: 1/75/139095/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 2000 bits/sec, 3 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
5164144 packets input, 513614455 bytes, 0 no buffer
Received 5163863 broadcasts, 0 runts, 0 giants, 0 throttles
1797 input errors, 0 CRC, 0 frame, 0 overrun, 1797 ignored
0 input packets with dribble condition detected
133101 packets output, 12732441 bytes, 0 underruns
0 output errors, 84 collisions, 1 interface resets
0 babbles, 0 late collision, 108 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Router#


でも、トラブルの真っ最中に、コマンドを実行するたびにshow clockしていては時間の無駄ですし、忘れてしまうことだって考えられます。

そこで、exec prompt timestamp を使う事を提案します。

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#line console 0
Router(config-line)#
Router(config-line)#exec prompt ?
timestamp Print timestamps for show commands

Router(config-line)#
Router(config-line)#exec prompt timestamp
Router(config)#^Z
Router#

exec prompt timestamp を設定しておくと、show コマンドの出力にタイムスタンプをつけてくれるようになります。

Router#
Router#show interfaces gigabitEthernet 0/1
Load for five secs: 5%/0%; one minute: 6%; five minutes: 3%
Time source is user configuration, 03:25:53.011 UTC Thu Dec 29 2005

GigabitEthernet5/0/1 is up, line protocol is up (connected)
Hardware is Gigabit Ethernet, address is 0012.7ff7.7e81 (bia 0012.7ff7.7e81)
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Full-duplex, 100Mb/s, media type is 10/100/1000BaseTX
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:01, output 00:00:06, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 7000 bits/sec, 10 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
1887 packets input, 176680 bytes, 0 no buffer
Received 1327 broadcasts (0 multicast)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 318 multicast, 0 pause input
0 input packets with dribble condition detected
44 packets output, 4844 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
Router#



このexec prompt timestamp はIOS version 12.2 からはサポートされているようですが、12.1 や12.0 でも一部のメンテナンスリリースで利用可能です。
みなさんがお使いのルータでも利用可能か、一度確認されることをお勧めします。


ネットワークエンジニアになろう!のトップページへ戻る
サイト内検索
無料メールマガジン「英語でネットワークエンジニア」
マニュアルやRFCを読むのに必要なのは、高度な文法知識ではなく語彙力です。毎回一単語、例文と解説に技術情報を併せてお届けします. (マガジンID:0000181633)
メールアドレス:
Powered by
This website is powered by Movable Type 3.2 Smartnetworks.jp.