Home Search Center Intelligent Model Selection IP Encyclopedia

What Is EVA?

EVA is a function that uses Python or JSON scripts to analyze and judge data collected by devices and perform troubleshooting based on the analysis and judgment result. After EVA is enabled on devices, network O&M personnel can locate and troubleshoot faults quickly.

Why Do We Need EVA?

A network management system (NMS) can subscribe to XPaths in YANG through channels such as telemetry, NETCONF, and RESTCONF to obtain data from its managed YANG-capable devices. By analyzing the data in real time, the NMS can determine whether such a device is faulty and, if it is, quickly troubleshoot the fault. For network devices that are not managed by any NMS, in actual network applications, it is time- and labor-consuming to locate faults, leading to a long inspection time and low inspection efficiency.

To address these problems, Huawei develops the EVA function. By extending the Python framework of the open programmability system (OPS), it subscribes to telemetry data (known as KPI data) and then constructs a strategy based on KPI events and log events by orchestrating the KPI data, implementing quick self-healing of new faults. After the EVA function is enabled on a device, during fault judgment and troubleshooting, you can customize data subscription and the device automatically judges the fault and executes the corresponding strategy. During inspection, the device can automatically collect data, and the collection duration and device quantity are decoupled. Both cloud and device faults can be automatically analyzed. In addition, device faults can be automatically delivered to devices for analysis and fault snapshots can be recorded in real time.

EVA provides the following capabilities:

  • Data openness based on scripts

    With the programmability of the device, EVA allows you to define data subscription interfaces in scripts, including monitoring events such as CPU usage change.

  • Powerful data processing

    EVA provides data calculation and data judgment functions. Data calculation functions can be used to calculate the average, maximum, and minimum values. You can directly invoke these functions in scripts to process subscribed data.

  • Strategy customization and open fault orchestration

    EVA supports customized strategies, in which one or more faults can be combined using strategy formulas.

  • Action execution

    EVA provides automatic action execution capabilities. When a fault strategy event is triggered, EVA automatically executes actions in a customized strategy to troubleshoot device faults.

How Does EVA Work?

The following figure shows the EVA working process.

EVA working process
EVA working process
  1. Introduce the EVA module to a customized script.
  2. Upload the compiled JSON or Python script to a device.
  3. Install and register the script.
  4. EVA automatically parses the script and runs the content defined in the script.
  5. The device locates faults or displays data by analyzing the subscribed data. If a fault is located, EVA executes the corresponding action through strategy matching.

In EVA scripts, events are used to define fault symptoms, and strategies and tasks/actions are used to define operations performed after faults occur. The device automatically records fault data after a fault occurs, without the need of manually collecting onsite data by O&M personnel.

Customized Python Script

def condition():
    e1 = eva.Event()
    kpi1 = e1.addkpi()
    e1.ret = eva.avg()     
    s1 = eva.Strategy()
    s1.formula = e1
    action1 = eva.log()
    s1.addaction(action1)

In the preceding script:

  • Event: describes data subscription, processing, and judgment.
  • LogEvent: describes the subscription to device logs.
  • Strategy: describes the orchestration and execution actions of events.
  • Action: defines device behaviors, including command delivery and data calculation.

Customized JSON Script

  • An example of a single-task script is as follows:
    {
    	"ItemName": {
    		"description": "",
    		"define": {},
    		"events": {},
    		"strategy": "",
    		"tasks": {}
            }
    }
  • An example of a PMI script is as follows:
    {"ItemName1": {"description": "","define": {},"events": {},"strategy": "","tasks": {}}}
    {"ItemName2": {"description": "","define": {},"events": {},"strategy": "","tasks": {}}}
    {"ItemName3": {"description": "","define": {},"events": {},"strategy": "","tasks": {}}}

In the preceding scripts:

  • description: provides brief description of the script.
  • define: defines global variables for the entire script. A maximum of 15 global variables can be defined. Other variables cannot be referenced.
  • event: defines the entry conditions for running a script.
  • strategy: defines an event or an event combination condition for executing a task or an action.
  • task: defines an action triggered by a strategy and the relationship between actions. Each task contains one action. If the service logic is complex, you can define multiple tasks and define in a task the jump relationship between the task and other tasks. The service logic of the loop type is also defined in a task.

Typical Application Scenarios of EVA

Configuring EVA Based on JSON PMI Scripts

In an inspection scenario, a customized JSON script is stored on an SFTP server. O&M personnel want to use EVA to collect routing information, interface diagnostic information, and device health information from devices. The JSON script is an inspection script that defines the commands for collecting routing information, interface diagnostic information, and device health information.

Networking diagram of performing inspection on devices through EVA
Networking diagram of performing inspection on devices through EVA

The configuration roadmap is as follows:

  1. Compile a JSON script and define events, strategies, and tasks in the script.

  2. Upload the JSON script to the device.

  3. Install and register the JSON script.

Step 1 Compile a JSON script and define events, strategies, and tasks in the script.

{"inspection_1":{"description":"Collect IP routing information","events":{"e1":{"trigger":"eva.singleCollect()"}},"strategy":"e1","tasks":{"mainTask":{"parameters":{"IProute_cmdArray":["display bgp peer","display isis peer","display ospf peer"]},"action":"eva.cliArray(\"user\",${IProute_cmdArray})"}}}}  # Collect routing information.
{"inspection_2":{"description":"Collect statistics on error packets and diagnosis information on the interfaces","events":{"e1":{"trigger":"eva.singleCollect()"}},"strategy":"e1","tasks":{"mainTask":{"parameters":{"Interface_cmdArray":["display interface troubleshooting","display interface counters errors","display interface brief"]},"action":"eva.cliArray(\"user\",${Interface_cmdArray})"}}}}  # Collect interface diagnostic information.
{"inspection_3":{"description":"Collect system management information","events":{"e1":{"trigger":"eva.singleCollect()"}},"strategy":"e1","tasks":{"mainTask":{"parameters":{"Health_cmdArray":["display debugging","display device","display health"]},"action":"eva.cliArray(\"user\",${Health_cmdArray})"}}}}  # Collect device health information.

Step 2 Upload the JSON script to the device.

[~DeviceA] sftp client-transfile get host-ip 10.2.1.1 username client001 password Helloworld@6789 sourcefile CollectInformation.json
# Configure DeviceA functioning as an SFTP client to download the JSON script CollectInformation.json from the SFTP server.

Step 3 Install and register the JSON script.

<DeviceA> install eva script CollectInformation.json inspection

Configuring EVA Based on Python Scripts

A customized Python script is stored on an SFTP server. O&M personnel want to use EVA to monitor the CPU usage and memory usage. The Python script specifies that when the CPU usage and memory usage exceed 90%, the system automatically generates an alarm log reporting high CPU and memory usages, prompting O&M personnel to maintain devices in a timely manner.

Networking diagram of monitoring CPU usage changes through EVA
Networking diagram of monitoring CPU usage changes through EVA

The configuration roadmap is as follows:

  1. Compile a Python script to customize events and troubleshooting strategies.
  2. Upload the Python script to the device.

  3. Install and register the Python script.

Step 1 Compile a Python script to customize events and troubleshooting strategies.

import eva
def condition(): 
    e1 = eva.Event()
    kpi1 = e1.addkpi("huawei-cpu-memory:cpu-memory/board-cpu-infos/board-cpu-info/system-cpu-usage")
    e1.ret = eva.avg(kpi1, 10) > 90
 
    e2 = eva.Event()
    kpi2 = e2.addkpi("huawei-cpu-memory:cpu-memory/board-memory-infos/board-memory-info/os-memory-usage")
    e2.ret = eva.avg(kpi2, 10) > 90
    
    s1 = eva.Strategy()
    s1.formula = e1 & e2
    s1.validTime= 10
    action1 = eva.log("board ${e1.slot-id}--${e1.cpu-id} cpu and memory simultaneously overload")
    s1.addaction(action1)
# Compile the script cpuMemHigh.py to subscribe to the system CPU usage and memory usage, and calculate the average values of last 10 CPU usages and memory usages. If both the average values exceed 90%, an alarm log is generated.

Step 2 Upload the Python script to the device.

[~DeviceA] sftp client-transfile get host-ip 10.2.1.1 username client001 password Helloworld@6789 sourcefile cpuMemHigh.py
# Configure DeviceA functioning as an SFTP client to download the Python script file cpuMemHigh.py from the SFTP server.
Step 3 Install and register the Python script.
<DeviceA> ops install file cpuMemHigh.py                           # Install the Python script.
<DeviceA> ops run python evamain.py install cpuMemHigh.py        # Register the Python script.
About This Topic
  • Author: Qian Jinchen
  • Updated on: 2024-02-27
  • Views: 1379
  • Average rating:
Share link to