4

bar show interface link is there an alternative (pretty) way to display a summary of link last in use. Goal is to get a view of how long a link has been unused. Something along the lines of:

show interface X | inc Last input

However, I want to see all interfaces on a cisco switch not using ios.SH or tcl.

4
  • 2
    *cough* show interfaces | inc line_protocol|Last_input Anything fancier than that will require a program.
    – Ricky
    May 19 '16 at 19:59
  • brilliant. Can you elaborate on the use of "_" ? I thought the AND was not supported?
    – Max
    May 20 '16 at 6:24
  • 2
    Underscore is the regex for space.
    – Ricky
    May 20 '16 at 18:52
  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 9 '17 at 18:48
2

show interface history

To display histograms of interface utilization, use the showinterfacehistory command in privileged EXEC mode.

show interface [ type number ] history [ all | 60sec | 60min | 72hour ] [ both | input | output ]

Syntax Description

type (Optional) Interface type. number (Optional) Port number of the interface. all (Optional) Specifies the histograms representing the last 60 seconds, the last 60 minutes, and the last 72 hours of interface utilization. 60sec (Optional) Specifies the histograms representing the last 60 seconds of interface utilization. 60min (Optional) Specifies the histograms representing the last 60 minutes of interface utilization. 72hour (Optional) Specifies the histograms representing the last 72 hours of interface utilization. both (Optional) Specifies both the input histograms and the output histograms. input (Optional) Specifies the input histograms. output (Optional) Specifies the output histograms. Command Modes

Privileged EXEC (#)

Command History

Release Modification 12.2(33)XNE This command was introduced.

Usage Guidelines

The showinterfacehistory command displays histograms of interface utilization. The y-axis represents the input or output rate in packets per second, kilobits per second, or megabits per second. Kilobits per second is used when the bandwidth of the interface is less than one gigabit per second. Megabits per second is used for more than one gigabit per second.

The x-axis represents time in units of seconds, minutes or hours with the most current time at the left side of the histogram. There are three histograms available: the last 60 seconds, the last 60 minutes, and the last 72 hours.

The interface counters specified in the history(interface) command are displayed under the x-axis of each histogram. Each counter has a five-character identification as listed in the command. The identification is displayed at the beginning of each counter line. The number in the column indicates that the counter incremented by that amount during the specified interval. When the counter exceeds a single digit, the values are displayed vertically.

Examples

The following example shows the histogram output of interface history:

Router# show interface gigabitethernet 0/1 history 60min

5689688755455324777665666876546
      10
       9    *
       8   ** **                  *
       7   *# ##*        ***      #*
       6  *######        ####* **###*  *
       5 ########## *#   ############* *
       4 #############  *#############**
       3 ############## ###############*
       2 ###############################
       1 ###############################
        0....5....1....1....2....2....3....3....4....4....5....5....6
                  0    5    0    5    0    5    0    5    0    5    0
         3333333333333333333333333333331
   Mlcst 556555555565555555555565535555700000000000000000000000000000
         22322111111     121221211211
         57149774766867 133175814422022
   iDrop 425727636924219265454496840996600000000000000000000000000000
         GigabitEthernet0/1 input rate(mbits/sec)  (last 60 minutes)
                 * = maximum   # = average
5677678656555434767665666866545
      10
       9
       8       *                  *
       7   ** *#         * *      *
       6  *#####* *      ##*** ***##*
       5 *#########***   #####*######* *
       4 #############* *#############**
       3 #############**###############*
       2 ###############################
       1 ###############################
        0....5....1....1....2....2....3....3....4....4....5....5....6
                  0    5    0    5    0    5    0    5    0    5    0
   Unkno 000000000000000000000000000000000000000000000000000000000000
   oDrop 000000000000000000000000000000000000000000000000000000000000
         GigabitEthernet0/1 output rate(mbits/sec)  (last 60 minutes)
                 * = maximum   # = average

The input rate histogram shows that the input rate peaked at 9 Mbps and 4 minutes prior to the command execution. During that one-minute interval, there were 35 input multicast packets and 247 input drops. The counter values in the histogram should be read vertically.

The output rate histogram shows that the output rate reached 8 Mbps twice; once 7 minutes prior and the second time 26 minutes prior to the command execution. There were no unknown protocol drops and no output drops during the last 60 minutes.

The table below describes the significant fields shown in the display.

Table 2 show interface history Field Descriptions Field Description Mlcst Ethernet input multicast. iDrop Input drops. Unkno Unknown protocol drops. oDrop Output drops. Related Commands

Command Description history (interface) Enables an interface to maintain utilization history.

0

What you're looking for requires creative use of pipes like you've already suggested.

Just a thought - why wouldn't you use a NMS and query the telemetry data to display this for you?

3
  • there are many possibilities to do it with NMW, ios.SH some TCL, probably even creative use of aliases, but I was hoping there would be a magic pipe combo. ios doesn't seem to allow pipes into other commands, only string filtering..
    – Max
    May 19 '16 at 14:01
  • Let me rephrase. Sure given the tools you could do it. Why do you need this from the CLI and not telemetry from polling the box? You're requirement of 'view hot long a link has been unsued' sounds like something that is better suited from historical analysis of telemetry data and not something that should be solved from CLI queries. Just speaking from experience here.
    – APA
    May 19 '16 at 14:08
  • agreed, in general it is better to have this data externally viewable and not via cli. Use case for this would be the discussion of resuing a port, or reconfiguring to use another vlan. So that one can quickly identify the port with the most chance of not being used in the last x.
    – Max
    May 19 '16 at 14:15
0

You can show all the interfaces in a Cisco switch with the same command you are using. The command you are using is the show interfaces command. If you do not include a specific interface, it will show all the interfaces.

8
  • show interface | inc Last input would give me the last input, but I don't clearly have the correlating interface number.
    – Max
    May 19 '16 at 14:17
  • If you just run the show interfaces command without the pipe, you get the information you need. Anything fancier than that will require what you don't want to use. You can always capture the output and send it through some other processor offline.
    – Ron Maupin
    May 19 '16 at 14:28
  • the AND operator after pipe is forbidden, can only use OR. I can reverse it and show interfaces | exclude (and then list everything I don't want, so everything but Interface and Last input). but the length is also limited.
    – Max
    May 19 '16 at 14:44
  • You were not clear in your question that you wanted to limit the output to the interface and the line in question. My answer is an answer to the question as written; it gives you the information requested. If you want to include other information, too, you need more than just the pipe. You could have a prepared list of all the interface commands like you had, and just paste it in, or you can capture the full output and use something on your PC to parse it. You could even have a prepared TCL script to paste in.
    – Ron Maupin
    May 19 '16 at 14:50
  • the question states withouth the use of TCL or any other means.
    – Max
    May 19 '16 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.