Guest

IP Application Services

Monitor ASR Kernel Load CPU with EEM Script

Document ID: 116213

Updated: Jul 26, 2013

Contributed by David Chen, Cisco TAC Engineer.

   Print

Introduction

This document describes how to monitor the load on an Cisco ASR 1000 Series Aggregation Services Routers (ASR) kernel with an Embedded Event Manager (EEM) script.

On traditional Cisco IOS® software devices, you commonly observe CPU usage with the show process cpu command. This command is available on IOS XE, but is used only to monitor the Cisco IOS software daemon (IOSd), which runs as a process on the Linux kernel.  You might also need to monitor the load on the kernel.

Sample EEM Script to Monitor ASR Kernel Load

This is a sample EEM script that monitors the load on an ASR kernel for Route Processor 0 (RP0) load at one minute (1-Min).  A load of .40 triggers actions 1 through 5. Action 1 generates a log message when the script triggers. Actions 2 through 5 run command-line interface (CLI) commands, outputs them to the bootflash, and appends the cpuinfo file.

 event manager applet capture_cpu_spike
event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.24.2 get-type exact entry-op ge entry-val 39 exit-time 180 poll-interval 2
action 1.0 syslog msg "CPU Utilization is high. Check bootflash:cpuinfo for details."
action 2.0 cli command "en"
action 3.0 cli command "show clock | append bootflash:cpuinfo"
action 4.0 cli command "show platform software status control-processor br | append bootflash:cpuinfo"
action 5.0 cli command "show platform software process slot rp active monitor | append bootflash:cpuinfo"
Router#show platform software status control-processor brief

Load Average Slot Status 1-Min 5-Min 15-Min
RP0 Healthy 0.40 0.32 0.28

Polling results for a 1-Min load object identifier (OID) are multiplied by 100.  In this example, the load is .40 but the Simple Network Management Protocol (SNMP) OID reports it as 40 (.40 x 100 = 40). The 'entry-val' in the EEM script also needs to be multiplied by 100.  An 'entry-val' of greater than 39 triggers when the 1-Min load on RP0 is .40.

SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.24.2 = Gauge32: 40

Refer to Cisco ASR 1000 Series Routers MIB Specifications for load thresholds for warning and critical alerts.

Sample OIDs

LOAD AVERAGE:

Variable Format: Gauge32 (32 bit integer)

cpmCPULoadAvg1min (24): The overall RP CPU load Average in the last 1 minute period.
Example:
1.3.6.1.4.1.9.9.109.1.1.1.1.24.2 = Gauge32: 0
1.3.6.1.4.1.9.9.109.1.1.1.1.24.3 = Gauge32: 36
1.3.6.1.4.1.9.9.109.1.1.1.1.24.4 = Gauge32: 31

cpmCPULoadAvg5min (25): The overall RP CPU load Average in the last 5 minute period.
Example:
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.25.2 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.25.3 = Gauge32: 25
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.25.4 = Gauge32: 34

cpmCPULoadAvg15min (26): The overall RP CPU load Average in the last 15 minute period.
Example:
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.26.2 = Gauge32: 0
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.26.3 = Gauge32: 18
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.26.4 = Gauge32: 27
Updated: Jul 26, 2013
Document ID: 116213