Introducción

    Este documento describe cómo configurar un applet Cisco IOS® Embedded Event Manager (EEM) para capturar el resultado del comando show stacks. El Cisco Technical Assistance Center (TAC) suele necesitar este resultado para solucionar los problemas de uso elevado de la CPU causados por el protocolo simple de administración de red (SNMP).

    Prerequisites

    Requirements

    Cisco recomienda que tenga conocimiento sobre estos temas:

    • ‘Protocolo de administración de red simple (SNMP)
    • Cisco IOS Embedded Event Manager (EEM)
    • Syslog

    Componentes Utilizados

    La información que contiene este documento se basa en las siguientes versiones de software y hardware.

    • Versión 15.1(4)M6 del IOS de Cisco
    • Router de servicios integrados Cisco 2811

    Nota: Las configuraciones en este documento deben funcionar con versiones anteriores del software Cisco IOS, ya que ambos applets utilizan EEM Versión 3.0, que es compatible con Cisco IOS Release 12.4(22)T o posterior. Sin embargo, esto no se ha probado.

    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.

    Configurar

    Estos applets EEM automatizan el proceso para capturar el resultado del comando show stacks. Tenga en cuenta que:

    • Ambos applets utilizan la ID de proceso (PID) del motor SNMP. Ingrese el comando show processes cpu para encontrar el PID; en este ejemplo, el PID es 188:

      2811#show processes cpu | include SNMP ENGINE
      PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process
      188 40 1 40000 0.00% 0.04% 0.01% 0 SNMP ENGINE
      2811#
    • Se requiere EEM versión 3.0 o posterior para utilizar las acciones de espera. Ingrese el comando show event manager version para detectar la versión de EEM.
    • Los dispositivos de software Cisco IOS que utilizan autenticación, autorización y contabilidad (AAA) deben definir qué usuario puede ejecutar acciones de CLI. Utilice el comando event manager session cli username user para esta configuración, donde user es un nombre de usuario autorizado para ejecutar todos los comandos CLI en applets EEM.
    • Es posible que algunos sistemas de archivos no se admitan con la opción 'append' para redirigir el resultado. Antes de configurar el applet, pruebe esto manualmente para asegurarse de que puede redirigir la salida a su sistema de archivos.

    El comando show stacks muestra las tareas que se están manejando por el proceso especificado. Al solucionar problemas de uso elevado de la CPU, es útil averiguar qué tareas se ejecutan cuando se produce la condición.

    Utilización de CPU superior al 50%

    Este applet EEM detecta cuándo la utilización de la CPU supera el 50%. En ese momento, la salida del comando show stacks se muestra durante nueve segundos y se registra en un archivo llamado SNMP_STACK.txt dentro de la memoria flash. Esta información ayuda al TAC a identificar la causa de la alta utilización de la CPU.

    Este ejemplo investiga una condición de CPU alta causada por SNMP; puede utilizar un applet EEM similar para recopilar un conjunto diferente de salidas para investigar los problemas de CPU elevados causados por un proceso diferente.

    event manager applet SNMP_STACK
    event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.10.1 get-type exact entry-op gt
    entry-val "50" exit-op lt exit-val "15" poll-interval 2 maxrun 20
    action 0.0 syslog msg "High CPU DETECTED"
    action 0.1 cli command "enable"
    action 1.1 cli command "show clock | append flash:SNMP_STACK.TXT"
    action 1.2 cli command "show proc cpu sort | append flash:SNMP_STACK.TXT"
    action 2.1 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 2.2 wait 1
    action 2.3 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 2.4 wait 1
    action 2.5 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 2.6 wait 1
    action 2.7 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 2.8 wait 1
    action 2.9 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.1 wait 1
    action 3.2 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.3 wait 1
    action 3.4 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.5 wait 1
    action 3.6 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.7 wait 1
    action 3.8 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"

    Mensaje de registro del sistema %SNMP-3-INPUT_QFULL_ERR

    Este applet EEM se activa si se genera el mensaje syslog %SNMP-3-INPUT_QFULL_ERR. En ese momento, la salida del comando show stacks se muestra durante nueve segundos y se registra en un archivo llamado SNMP_STACK.txt dentro de la memoria flash. Esta información ayuda al TAC a identificar la causa de la alta utilización de la CPU.

    event manager applet SNMP_STACK
    event syslog pattern "%SNMP-3-INPUT_QFULL_ERR"
    action 1.0 cli command "enable"
    action 2.1 cli command "show clock | append flash:SNMP_STACK.TXT"
    action 2.2 cli command "show proc cpu sort | append flash:SNMP_STACK.TXT"
    action 3.1 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.2 wait 1
    action 3.3 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.4 wait 1
    action 3.5 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.6 wait 1
    action 3.7 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 3.8 wait 1
    action 3.9 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 4.1 wait 1
    action 4.2 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 4.3 wait 1
    action 4.4 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 4.5 wait 1
    action 4.6 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 4.7 wait 1
    action 4.8 cli command "show stacks 188 | append flash:SNMP_STACK.TXT"
    action 4.9 wait 1

    Verificación

    Actualmente, no hay un procedimiento de verificación disponible para esta configuración.

    Troubleshoot

    Actualmente, no hay información específica de troubleshooting disponible para esta configuración.

    Información Relacionada