Difference between revisions of "CCNP TSHOOT 642-832/Chapter 3"

From Teknologisk videncenter
Jump to: navigation, search
m
m (Include statement)
Line 5: Line 5:
 
=== Include statement ===
 
=== Include statement ===
 
Looking at the output below with more than 200 processes running. Its hard to sort out information.
 
Looking at the output below with more than 200 processes running. Its hard to sort out information.
<source input=cli>
+
<source lang=cli>
 
T1#<input>show processes cpu</input>
 
T1#<input>show processes cpu</input>
 
CPU utilization for five seconds: 5%/0%; one minute: 5%; five minutes: 5%
 
CPU utilization for five seconds: 5%/0%; one minute: 5%; five minutes: 5%
Line 26: Line 26:
 
</source>
 
</source>
 
If you now what your searching for. Use '''include''' - ala. [[grep]] to sort lines including text.
 
If you now what your searching for. Use '''include''' - ala. [[grep]] to sort lines including text.
<source lan=cli>
+
<source lang=cli>
 
T1#<input>show processes cpu | include Check heaps</input>
 
T1#<input>show processes cpu | include Check heaps</input>
 
   4    2036226    295180      6898  0.15%  0.06%  0.05%  0 Check heaps
 
   4    2036226    295180      6898  0.15%  0.06%  0.05%  0 Check heaps
 
</source>
 
</source>
 +
 
=== exclude statement ===
 
=== exclude statement ===
 
To many uninteresting lines in the output below.  
 
To many uninteresting lines in the output below.  

Revision as of 15:45, 8 June 2010

The Maintenance and Troubleshooting Toolbox

Cisco IOS Diagnostic Tools

Filtering the output of show commands

Include statement

Looking at the output below with more than 200 processes running. Its hard to sort out information.

T1#<input>show processes cpu</input>
CPU utilization for five seconds: 5%/0%; one minute: 5%; five minutes: 5%
 PID Runtime(ms)   Invoked      uSecs   5Sec   1Min   5Min TTY Process
   1           0        17          0  0.00%  0.00%  0.00%   0 Chunk Manager
   2         184    498119          0  0.00%  0.00%  0.00%   0 Load Meter
   3          57    249719          0  0.00%  0.00%  0.00%   0 OSPF Hello
   4     2036075    295159       6898  0.00%  0.06%  0.05%   0 Check heaps
   5           8         4       2000  0.00%  0.00%  0.00%   0 Pool Manager
   6           0         2          0  0.00%  0.00%  0.00%   0 Timers
   7      642424   3138677        204  0.00%  0.05%  0.00%   0 ARP Input
<notice>...OUTPUT OMITTES...</notice>
 201           0        37          0  0.00%  0.00%  0.00%   0 PDU DISPATCHER
 202          34        37        918  0.00%  0.00%  0.00%   0 SNMP ENGINE
 203           0         1          0  0.00%  0.00%  0.00%   0 SNMP ConfCopyPro
 204        7082     19564        361  0.00%  0.00%  0.00%   0 SNMP Traps
 205       98261   2959809         33  0.00%  0.00%  0.00%   0 NTP
 206           0        17          0  0.00%  0.00%  0.00%   0 hulc cfg mgr mas
 207       16502        82     201243  0.00%  0.00%  0.00%   0 hulc running con

If you now what your searching for. Use include - ala. grep to sort lines including text.

T1#<input>show processes cpu | include Check heaps</input>
   4     2036226    295180       6898  0.15%  0.06%  0.05%   0 Check heaps

exclude statement

To many uninteresting lines in the output below.

T1#<input>show interfaces status</input>

Port      Name               Status       Vlan       Duplex  Speed Type
Gi0/1     link to room 111   connected    trunk        full   1000 10/100/1000BaseTX
Gi0/2                        disabled     1            auto   auto 10/100/1000BaseTX
Gi0/3                        disabled     1            auto   auto 10/100/1000BaseTX
Gi0/4                        disabled     1            auto   auto 10/100/1000BaseTX
Gi0/5                        disabled     1            auto   auto 10/100/1000BaseTX
Gi0/6                        disabled     1            auto   auto 10/100/1000BaseTX
Gi0/7                        disabled     1            auto   auto 10/100/1000BaseTX
Gi0/8     link to room 112   connected    trunk        full   1000 10/100/1000BaseTX
Gi0/9     link to room 113   connected    trunk        full   1000 10/100/1000BaseTX
Gi0/10                       disabled     1            auto   auto 10/100/1000BaseTX
Gi0/11                       disabled     1            auto   auto 10/100/1000BaseTX
Gi0/12                       disabled     1            auto   auto 10/100/1000BaseTX

Only show lines not containing disabled

T1#<input>show interfaces status | exclude disabled</input>

Port      Name               Status       Vlan       Duplex  Speed Type
Gi0/1     link to room 111   connected    trunk        full   1000 10/100/1000BaseTX
Gi0/8     link to room 112   connected    trunk        full   1000 10/100/1000BaseTX
Gi0/9     link to room 113   connected    trunk        full   1000 10/100/1000BaseTX