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 188.8.131.52.184.108.40.206.220.127.116.11.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.18.104.22.168.22.214.171.124.2 = Gauge32: 40
Refer to Cisco ASR 1000 Series Routers MIB Specifications for load thresholds for warning and critical alerts.
Variable Format: Gauge32 (32 bit integer)
cpmCPULoadAvg1min (24): The overall RP CPU load Average in the last 1 minute period.
126.96.36.199.188.8.131.52.184.108.40.206.1.24.2 = Gauge32: 0
220.127.116.11.18.104.22.168.22.214.171.124.1.24.3 = Gauge32: 36
126.96.36.199.188.8.131.52.184.108.40.206.1.24.4 = Gauge32: 31
cpmCPULoadAvg5min (25): The overall RP CPU load Average in the last 5 minute period.
SNMPv2-SMI::enterprises.220.127.116.11.18.104.22.168.2 = Gauge32: 0
SNMPv2-SMI::enterprises.22.214.171.124.126.96.36.199.3 = Gauge32: 25
SNMPv2-SMI::enterprises.188.8.131.52.184.108.40.206.4 = Gauge32: 34
cpmCPULoadAvg15min (26): The overall RP CPU load Average in the last 15 minute period.
SNMPv2-SMI::enterprises.220.127.116.11.18.104.22.168.2 = Gauge32: 0
SNMPv2-SMI::enterprises.22.214.171.124.126.96.36.199.3 = Gauge32: 18
SNMPv2-SMI::enterprises.188.8.131.52.184.108.40.206.4 = Gauge32: 27