cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
749
Views
0
Helpful
3
Replies

Help needed in executing few Cisco commands

Hello All,

I got to know know the commands. But I'm trying to find out how to use the command for troubleshooting.

Can anybody help me to know how to execute the below commands:

1, sh spanning tree detail | in exec | from | last

2, sh logging log | begin "2011"

3, sh logging log | grep

4, sh account log start time 2011

I would like to know about the parameters we are providing as input in executing the above commands.

3 Replies 3

Mahesh Gohil
Level 7
Level 7

Hi,

I don't know if I have understood your question correctly or not.

you need to login to router and copy the command provided and it will provided desired output on screen.

Like if I want to retrieve information on CRC and reliability then I will run command "sh interface" but if I want that output

only contains only two lines they I would have typed command:

sh int Gi8/0/1 | inc CRC | reliability

Router#sh int Gi8/0/1 | inc CRC | reliability
     reliability 255/255, txload 1/255, rxload 1/255

If you still not clear or if question is somewhat different please reply here

Regards

Mahesh

Hi,

#sh spanning-tree detail | include exec | from | last
  Number of topology changes 27 last change occurred 6w0d ago
          from GigabitEthernet0/2

***This will give brief information about any topology changes***


#sh logging | begin 2011
***This will provide you the logs being from 2011***


#sh accounting | in start time 2011


And regarding sh logging log | grep command it is not there you might need to look other comands like below....

#sh logging | ?
  append    Append redirected output to URL (URLs supporting append operation
            only)
  begin     Begin with the line that matches
  count     Count number of lines which match regexp
  exclude   Exclude lines that match
  format    Format the output using the specified spec file
  include   Include lines that match
  redirect  Redirect output to URL
  tee       Copy output to URL

Please rate the helpfull posts.
Regards,
Naidu.

So basically, all the show commands can be greped (or filtered) with desired keywords, these are not parameters but just what you want to see.

foreg. "show spanning-tree detail" on a switch will produce like 10 page output, but i might be interested in just seeing when did last topology change occured and at what interface it was received. I will simply pick words from each line and pipe it with actuall STP command, like below

show spanning-tree detail

VLAN0001 is executing the rstp compatible Spanning Tree protocol
  Bridge Identifier has priority 8192, sysid 1, address 0024.c4c0.8a40
  Configured hello time 2, max age 20, forward delay 15, tranmsit hold-count 6
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 23 last change occurred 5d21h ago
          from Port-channel6
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

-------rest of the output removed------

I decide to use:

"show spanning-tree detail | include is executing|topology changes"

CISCO7606-S#$ng-tree detail | include is executing|topology changes
VLAN0001 is executing the rstp compatible Spanning Tree protocol
  Number of topology changes 23 last change occurred 5d21h ago
VLAN0002 is executing the rstp compatible Spanning Tree protocol
  Number of topology changes 0 last change occurred 2w4d ago
VLAN0003 is executing the rstp compatible Spanning Tree protocol
  Number of topology changes 1 last change occurred 1d09h ago
VLAN0004 is executing the rstp compatible Spanning Tree protocol
  Number of topology changes 0 last change occurred 2w4d ago
VLAN0005 is executing the rstp compatible Spanning Tree protocol
  Number of topology changes 0 last change occurred 2w4d ago

Whoa, just what I need, so you can just look for interesting things you need.

Another example.. I want to look at 5 minutes input rate on all interfaces... rather than scrolling on "show interface" i will use intelligent CLI.

"show interface | i line|5 minute input rate"

Vlan166 is up, line protocol is up
  5 minute input rate 3000 bits/sec, 4 packets/sec
Vlan544 is up, line protocol is up
  5 minute input rate 0 bits/sec, 0 packets/sec
Vlan545 is administratively down, line protocol is down
  5 minute input rate 0 bits/sec, 0 packets/sec
Vlan1070 is up, line protocol is up
  5 minute input rate 0 bits/sec, 0 packets/sec

If you find this useful, Please rate it.