Guest

IP Application Services

How to Collect CPU Utilization on Cisco IOS Devices Using SNMP

Document ID: 15215

Updated: Oct 26, 2005

   Print

Introduction

This document describes how to collect CPU utilization on Cisco IOS® devices that use Simple Network Management Protocol (SNMP).

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

The information in this document is only for devices that run Cisco IOS software. The c7500 example with multiple CPUs uses Cisco IOS Software Release 12.0(22)S3.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Conventions

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Procedure for Devices with Single CPU

Critical router functions, like routing protocol processing and process packet switching, are handled in memory and share the CPU. Thus, if CPU utilization is very high, it is possible that a routing update cannot be handled or a process-switching packet is dropped. From the CISCO-PROCESS-MIB, the cpmCPUTotal5minRev MIB object value reports the percentage of the processor in use over a five-minute average.

The cpmCPUTotal5minRev MIB object provides a more accurate view of the performance of the router over time than the MIB objects cpmCPUTotal1minRev and cpmCPUTotal5secRev . These MIB objects are not accurate because they look at CPU at one minute and five second intervals, respectively. These MIBs enable you to monitor the trends and plan the capacity of your network. The recommended baseline rising threshold for cpmCPUTotal5minRev is 90 percent. Depending on the platform, some routers that run at 90 percent, for example, 2500s, can exhibit performance degradation versus a high-end router, for example, the 7500 series, which can operate fine.

  • cpmCPUTotal5secRev (.1.3.6.1.4.1.9.9.109.1.1.1.1.6): The overall CPU busy percentage in the last five-second period. This object deprecates the object cpmCPUTotal5sec and increases the value range to (0..100).

  • cpmCPUTotal1minRev (.1.3.6.1.4.1.9.9.109.1.1.1.1.7): The overall CPU busy percentage in the last one-minute period. This object deprecates the object cpmCPUTotal1min and increases the value range to (0..100).

  • cpmCPUTotal5minRev (.1.3.6.1.4.1.9.9.109.1.1.1.1.8): The overall CPU busy percentage in the last five-minute period. This object deprecates the object cpmCPUTotal5min and increases the value range to (0..100).

This table shows the new MIBs and their objects beside the old MIBs and objects they replace:

Version Cisco IOS Software releases 12.2(3.5) or later Cisco IOS Software releases later to 12.0(3)T and prior to 12.2(3.5) Cisco IOS Software releases prior to 12.0(3)T
MIB CISCO-PROCESS-MIB CISCO-PROCESS-MIB OLD-CISCO-CPU-MIB
Objects cpmCPUTotal5minRev (.1.3.6.1.4.1.9.9.109.1.1.1.1.8) cpmCPUTotal5min (.1.3.6.1.4.1.9.9.109.1.1.1.1.5) avgBusy5 (.1.3.6.1.4.1.9.2.1.58)
cpmCPUTotal1minRev (.1.3.6.1.4.1.9.9.109.1.1.1.1.7) cpmCPUTotal1min (.1.3.6.1.4.1.9.9.109.1.1.1.1.4) avgBusy1 (.1.3.6.1.4.1.9.2.1.57)
cpmCPUTotal5secRev (.1.3.6.1.4.1.9.9.109.1.1.1.1.6) cpmCPUTotal5sec (.1.3.6.1.4.1.9.9.109.1.1.1.1.3) busyPer (.1.3.6.1.4.1.9.2.1.56)

Example

Here is a typical output from the show processes CPU command on a router that runs Cisco IOS Software Release 12.0(9):

Router# show processes CPU 

CPU utilization for five seconds: 2%A/1%B; one minute: 1%C; five minutes: 1%D 
 PID  Runtime(ms)  Invoked  uSecs    5Sec   1Min   5Min TTY Process 
   1         164    137902      1   0.00%  0.00%  0.00%   0 Load Meter 
   2         100       119    840   0.57%  0.11%  0.02%   2 Virtual Exec 
   3      468644     81652   5739   0.00%  0.04%  0.05%   0 Check heaps 
   4           0         1      0   0.00%  0.00%  0.00%   0 Pool Manager 
   5           0         2      0   0.00%  0.00%  0.00%   0 Timers 
   6           0         2      0   0.00%  0.00%  0.00%   0 Serial Background 
   7           0         1      0   0.00%  0.00%  0.00%   0 OIR Handler 
   8           0         1      0   0.00%  0.00%  0.00%   0 IPC Zone Manager 
   9         348    689225      0   0.00%  0.00%  0.00%   0 IPC Periodic Tim 
  10           0         1      0   0.00%  0.00%  0.00%   0 IPC Seat Manager 
  11      175300    332916    526   0.00%  0.02%  0.00%   0 ARP Input 
  12        3824    138903     27   0.00%  0.00%  0.00%   0 HC Counter Timer 
  13           0         2      0   0.00%  0.00%  0.00%   0 DDR Timers 
  14           0         1      0   0.00%  0.00%  0.00%   0 Entity MIB API 
  15           0         1      0   0.00%  0.00%  0.00%   0 SERIAL A'detect 
  16           0         1      0   0.00%  0.00%  0.00%   0 Microcode Loader 
  17           0         1      0   0.00%  0.00%  0.00%   0 IP Crashinfo Inp 
--<snip>-- 

From the output, this is the relevant information:

Note: On the basis of the Cisco IOS Software Release that runs on the device, use appropriate MIB objects.

  • The CPU utilization over the last five seconds [also available through the object busyPer (.1.3.6.1.4.1.9.2.1.56)]

    %snmpwalk –v2c –c public 172.16.99.1 .1.3.6.1.4.1.9.2.1.56 
    
    !--- SNMP Query
    
    enterprises.9.2.1.56.0 = 2 
    
    !--- Response
    
    
  • The percentage of CPU time at interrupt level (fast-switched packets), over a five-second period. If you take the difference between the first and second, you arrive at the five-second percentage the router spends at the process level. In this case, the router spends one percent at the process level over the last five seconds (process- switched packets - No MIB variable).

  • The CPU utilization over the last minute [also available through the object avgBusy1 (.1.3.6.1.4.1.9.2.1.57)]

    %snmpwalk –v2c –c public 172.16.99.1 .1.3.6.1.4.1.9.2.1.57
    
    !--- SNMP Query
    
    enterprises.9.2.1.57.0 = 3  
    
    !--- Response
    
    
  • The CPU utilization over the last five minutes [also available through the object avgBusy5 (.1.3.6.1.4.1.9.2.1.58)]

    %snmpwalk –v2c –c public 172.16.99.1 .1.3.6.1.4.1.9.2.1.58 
    
    !--- SNMP Query
    
    enterprises.9.2.1.58.0 = 1  
    
    !--- Response
    
    

When you poll CPU utilization variables and any other SNMP variables, the actual CPU utilization is affected. Sometimes, the utilization is 99 percent when you continuously poll the variable at one-second intervals. It is an overkill to poll so frequently, but take into consideration the impact to CPU when you determine how frequently you want to poll the variable.

Procedure for Devices with Multiple CPUs

If your IOS device has several CPUs, you must use CISCO-PROCESS-MIB and its object cpmCPUTotal5minRev from the table called cpmCPUTotalTable , indexed with cpmCPUTotalIndex . This table allows CISCO-PROCESS-MIB to keep CPU statistics for different physical entities in the router, like different CPU chips, group of CPUs, or CPUs in different modules/cards. In case of a single CPU, cpmCPUTotalTable has only one entry.

Information about different physical entities in the router is stored in the entPhysicalTable of RFC 2737 standard-based ENTITY-MIB. You can link between two tables ( cpmCPUTotalTable and entPhysicalTable ) easily: each row of cpmCPUTotalTable has an object cpmCPUTotalPhysicalIndex that keeps the value of the entPhysicalIndex (index of entPhysicalTable ), and points to the entry in entPhysicalTable , correspondent to the physical entity for which these CPU statistics are maintained.

This implies that the IOS device must support both CISCO-PROCESS-MIB and ENTITY-MIB for you to be able to retrieve relevant information about CPU utilization. The only case where you do not need to have or use ENTITY-MIB is when you only have a single CPU.

Example

Monitor the use of multiple CPUs in the 7500 chassis (RSP and two VIPs). The same applies to GSR linecards. Use Cisco IOS Software Release 12.0(22)S3 or later when you poll c7500 or GSR for these values. Be aware of the related bugs: CSCdw52978 (registered customers only) , CSCdp17238 (registered customers only) .

  1. Poll cpmCPUTotal5min (.1.3.6.1.4.1.9.9.109.1.1.1.1.5) to get "overall CPU busy percentage in the last 5 minute period" for all CPUs in the chassis. The output shows that the 7507 device has three CPUs, utilized for 10%, 1%, and 2% during last 5 minutes.

    %snmpwalk –v2c –c public 172.16.0.1 .1.3.6.1.4.1.9.9.109.1.1.1.1.5 
    
    !--- SNMP Query
    
    enterprises.9.9.109.1.1.1.1.5.1 = 10
    enterprises.9.9.109.1.1.1.1.5.8 = 1
    enterprises.9.9.109.1.1.1.1.5.9 = 2 
    
    !--- Response
    
    

    Note: On the basis of the Cisco IOS Software Release that runs on the device, use appropriate MIB objects.

  2. In order to identify the physical entity to which these values correspond, poll cpmCPUTotalPhysicalIndex (.1.3.6.1.4.1.9.9.109.1.1.1.1.2). You see three physical entities with indexes 9, 25 and 28:

    %snmpwalk -v2c -c public 172.16.0.1 .1.3.6.1.4.1.9.9.109.1.1.1.1.2 
    
    !--- SNMP Query
    
    enterprises.9.9.109.1.1.1.1.2.1 = 9
    enterprises.9.9.109.1.1.1.1.2.8 = 25
    enterprises.9.9.109.1.1.1.1.2.9 = 28 
    
    !--- Response
    
    
  3. In order to identify the particular card to which each physical entry is related, poll correspondent entPhysicalName (.1.3.6.1.2.1.47.1.1.1.1.7) entry, with the exact indexes 9, 25, 28 from Step 2, as a last digit. You see that RSP is utilized for 10%, and VIPs in slots 4 and 6 are utilized for one and two percent.

    %snmpwalk -v2c -c public 172.16.0.1 .1.3.6.1.2.1.47.1.1.1.1.7.9 
    
    !--- SNMP Query
          
    47.1.1.1.1.7.9 = "RSP at Slot 2" 
    
    !--- Response
    
           
    %snmpwalk -v2c -c public 172.16.0.1 .1.3.6.1.2.1.47.1.1.1.1.7.25 
    
    !--- SNMP Query
    
    47.1.1.1.1.7.25 = "Line Card 4" 
    
    !--- Reponse
    
         
    %snmpwalk -v2c -c public 172.16.0.1 .1.3.6.1.2.1.47.1.1.1.1.7.28  
    
    !--- SNMP Query
    
    47.1.1.1.1.7.28 = "Line Card 6" 
    
    !--- Response
    
    

Procedure for CPU of Catalyst 5000 LANE Cards

Catalyst 5000 LANE Module runs IOS code and supports these objects from OLD-CISCO-CPU-MIB mentioned in Procedure for Devices with Single CPU:

Catalyst 5000 LANE Module does not have its own IP address. Therefore, you must use the IP address of Catalyst supervisor along with community string indexing. For example, if your LANE card is in slot 6 of your catalyst and your community string is public, use community string "public@6" and send the SNMP request to the IP address of the supervisor module. Refer to SNMP Community String Indexing for more information.

Note: If you do not specify the module number in the community, you receive data corresponding to the first LANE module in the Catalyst chassis.

Related Information

Updated: Oct 26, 2005
Document ID: 15215