이 문서에서는 EEM(Embedded Event Manager) 스크립트를 사용하여 Cisco ASR 1000 Series ASR(Aggregation Services Router) 커널의 로드를 모니터링하는 방법에 대해 설명합니다.
기존 Cisco IOS® 소프트웨어 디바이스에서 show process cpu 명령을 사용하여 CPU 사용량을 관찰합니다.이 명령은 IOS XE에서 사용할 수 있지만 Linux 커널에서 프로세스로 실행되는 Cisco IOS 소프트웨어 데몬(IOSd)을 모니터링하는 데만 사용됩니다. 커널의 로드를 모니터링해야 할 수도 있습니다.
이 스크립트는 RP0(Route Processor 0) 로드를 위해 ASR 커널의 로드를 1분(1분)에 모니터링하는 샘플 EEM 스크립트입니다. .40의 부하가 작업 1부터 5까지 트리거됩니다. 스크립트가 트리거될 때 작업 1은 로그 메시지를 생성합니다.Actions 2 - 5는 CLI(Command-Line Interface) 명령을 실행하고 bootflash로 출력하며 cpuinfo 파일을 추가합니다.
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
1분 OID(load object identifier)에 대한 폴링 결과에 100을 곱합니다. 이 예에서는 로드가 .40이지만 SNMP(Simple Network Management Protocol) OID는 이 로드를 40(.40 x 100 = 40)으로 보고합니다. EEM 스크립트의 'entry-val'도 100으로 곱해야 합니다. RP0의 1분 로드가 .40인 경우 39보다 큰 'entry-val'이 트리거됩니다.
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.24.2 = Gauge32: 40
경고 및 중요 경고에 대한 로드 임계값은 Cisco ASR 1000 Series 라우터 MIB 사양을 참조하십시오.
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