CCIE Pursuit Blog

July 6, 2007

“clear frame-relay counters” = Hidden 12.4 Command?

Filed under: Cool Commands,IOS — cciepursuit @ 4:31 pm

This is an odd little command in that I could not find it in the 12.4 Command Reference, yet it is available for that code version:

r1#sh ver
Cisco IOS Software, 2800 Software (C2800NM-SPSERVICESK9-M), Version 12.4(8b), RELEASE SOFTWARE (fc2)

r1#clear frame-relay counter ?
  interface  Frame Relay Interface
  <cr>

This is a command that I rarely use, but it does come in handy every once in a while.  Say that you are troubleshooting Frame-Relay (“show frame-relay pvc”, “show frame-relay lmi”, etc.) and you need to clear the counters.  You can clear the counters on the physical interface and that will clear the Frame-Relay counters as well:

Initial Output:
r1#sh int s0/0/0
Serial0/0/0 is up, line protocol is up
—–some output truncated—–
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of “show interface” counters 01:08:30
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/250 (size/max)
  30 second input rate 4000 bits/sec, 7 packets/sec
  30 second output rate 4000 bits/sec, 7 packets/sec
     25924 packets input, 4730477 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     23237 packets output, 2541206 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

r1#sh frame pvc

PVC Statistics for interface Serial0/0/0 (Frame Relay DTE)

              Active     Inactive      Deleted       Static
  Local          1            0            0            0
  Switched       0            0            0            0
  Unused         0            0            0            0

DLCI = 102, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0.102

  input pkts 22349         output pkts 20024        in bytes 4142379
  out bytes 2243557        dropped pkts 0           in pkts dropped 0
  out pkts dropped 0                out bytes dropped 0
  in FECN pkts 0           in BECN pkts 0           out FECN pkts 0
  out BECN pkts 0          in DE pkts 0             out DE pkts 0
  out bcast pkts 0         out bcast bytes 0
  5 minute input rate 1000 bits/sec, 5 packets/sec
  5 minute output rate 2000 bits/sec, 5 packets/sec
  Shaping adapts to BECN
  pvc create time 15:48:07, last time pvc status changed 15:46:57

r1#sh frame lmi

LMI Statistics for interface Serial0/0/0 (Frame Relay DTE) LMI TYPE = CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 414              Num Status msgs Rcvd 414
  Num Update Status Rcvd 0              Num Status Timeouts 0
  Last Full Status Req 00:00:01         Last Full Status Rcvd 00:00:01

After “clear counters s0/0/0” command:
r1#clear count s0/0/0
Clear “show interface” counters on this interface [confirm]
r1#sh int s0/0/0
Serial0/0/0 is up, line protocol is up
—–some output truncated—–
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of “show interface” counters 00:00:03
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/250 (size/max)
  30 second input rate 4000 bits/sec, 6 packets/sec
  30 second output rate 6000 bits/sec, 6 packets/sec
     29 packets input, 1348 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     29 packets output, 3012 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

r1#sh frame pvc

PVC Statistics for interface Serial0/0/0 (Frame Relay DTE)

              Active     Inactive      Deleted       Static
  Local          1            0            0            0
  Switched       0            0            0            0
  Unused         0            0            0            0

DLCI = 102, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0.102

  input pkts 61            output pkts 56           in bytes 3356
  out bytes 5825           dropped pkts 0           in pkts dropped 0
  out pkts dropped 0                out bytes dropped 0
  in FECN pkts 0           in BECN pkts 0           out FECN pkts 0
  out BECN pkts 0          in DE pkts 0             out DE pkts 0
  out bcast pkts 0         out bcast bytes 0
  5 minute input rate 1000 bits/sec, 2 packets/sec
  5 minute output rate 2000 bits/sec, 2 packets/sec
  Shaping adapts to BECN
  pvc create time 15:48:56, last time pvc status changed 15:47:46

r1#sh frame lmi

LMI Statistics for interface Serial0/0/0 (Frame Relay DTE) LMI TYPE = CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 40               Num Status msgs Rcvd 40
  Num Update Status Rcvd 0              Num Status Timeouts 0
  Last Full Status Req 00:00:10         Last Full Status Rcvd 00:00:10

You can see that the physical interface counters (s0/0/0) have been cleared as well as the Frame-Relay counters.  Let’s say that we want to clear the Frame-Relay counters, but we want to retain the historical information on the physical interface.  We can try to clear the counters on the subinterface, but IOS won’t play along:

r1#clear counters s0/0/0.102
% subinterface Serial0/0/0.102 has no support for counters

Here’s where the “clear frame-relay counters” command comes to the rescue:

After “clear frame count int s0/0/0.102” command:
r1#sh int s0/0/0
Serial0/0/0 is up, line protocol is up
—–some output truncated—–
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of “show interface” counters 00:06:20
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/250 (size/max)
  30 second input rate 4000 bits/sec, 7 packets/sec
  30 second output rate 3000 bits/sec, 6 packets/sec
     3751 packets input, 755170 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     3267 packets output, 364486 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up

r1#sh frame lmi

LMI Statistics for interface Serial0/0/0 (Frame Relay DTE) LMI TYPE = CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 40               Num Status msgs Rcvd 40
  Num Update Status Rcvd 0              Num Status Timeouts 0
  Last Full Status Req 00:00:10         Last Full Status Rcvd 00:00:10

r1#sh frame pvc

PVC Statistics for interface Serial0/0/0 (Frame Relay DTE)

              Active     Inactive      Deleted       Static
  Local          1            0            0            0
  Switched       0            0            0            0
  Unused         0            0            0            0

DLCI = 102, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0/0.102

  input pkts 130           output pkts 120          in bytes 10421
  out bytes 9840           dropped pkts 0           in pkts dropped 0
  out pkts dropped 0                out bytes dropped 0
  in FECN pkts 0           in BECN pkts 0           out FECN pkts 0
  out BECN pkts 0          in DE pkts 0             out DE pkts 0
  out bcast pkts 0         out bcast bytes 0
  5 minute input rate 2000 bits/sec, 3 packets/sec
  5 minute output rate 2000 bits/sec, 3 packets/sec
  Shaping adapts to BECN
  pvc create time 15:55:15, last time pvc status changed 15:54:06

So the “clear frame-relay counters” command will not clear the counters on the physical interface and it will not clear the LMI counters, but it will clear the “show frame-relay pvc” counters.

This command has a pretty limited use, but it does come in handy when you want to reset the Frame-Relay specific counters without wiping out the historical data on the physical interface’s counters.  I always find it better to clear only the least amount of counters during troubleshooting, so that you don’t erase some information that you may need to reference later to complete your troubleshooting.


Cisco Documentation:

Cisco IOS Master Commands List, Release 12.4 (command not listed)

Advertisements

1 Comment »

  1. i do have a question… what if its in the case of ATM. how do we clear the counters on the pvc now.

    I have a situation now.
    we have two subinterfaces on an ATM physical . physical is error free but the VC’s are not. we cleard the counters on physical but unable to clear the counters on the VC’s

    Please suggest

    Comment by srini — May 17, 2008 @ 2:47 pm | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: