No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


NE20E-S2 V800R010C10SPC500 Configuration Guide - System Management 01

This is NE20E-S2 V800R010C10SPC500 Configuration Guide - System Management
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuring a Script Assistant

Configuring a Script Assistant

This section describes how to configure a script assistant.


In a script assistant, trigger conditions are defined using the ops_condition() function in a Python script, and then tasks are defined using the ops_execute() function in the script. The trigger conditions supported by a script assistant include the CLI event, timer event, and route change event.


The ops_condition() and ops_execute() functions have been defined in the Python script to define trigger conditions and tasks.

This configuration process is supported only on the Admin-VS.


  1. Upload a Python script to the device. For details on how to upload a file to the device, see File System Management.
  2. In the user view, run:

    ops install file file [ destination directory ]

    The Python script is installed.

    If you do not specify destination directory in the command, the Python script is loaded to the default path flash:/$_user/. If this parameter is specified, the Python script is loaded to the path flash:/$_user/directory/.

    If the specified directory does not exist, the system automatically creates the directory. A maximum of seven levels of subdirectories can be created under flash:/$_user/.

  3. Run system-view

    The system view is displayed.

  4. Run ops

    The OPS view is displayed.

  5. Run enable

    OPS is enabled.

  6. (Optional) Run environment env-name env-value

    An environment variable is configured.

    The OPS supports the following environment variables:
    • System environment variables: environment variables that are automatically generated during system running.

    • User environment variables: environment variables that are configured using the environment command.

    Intermediate data generated during Python script running is lost after the Python is shut down. You can run the environment command to configure the Python script's running variable as an environment variable so that data is saved or used by other users.

  7. Run script-assistant python file-name

    A Python script assistant is configured.

    A script assistant is enabled by default after being created. When the trigger condition specified in a Python script is met, the tasks specified in the script will be automatically executed.

  8. Run commit

    The configuration is committed.

Checking the Configurations

Run the display ops assistant current command to check current information about maintenance assistants.

<HUAWEI> display ops assistant current
Assistant          State      Condition         Type
task               ready      event             command
Updated: 2019-01-02

Document ID: EDOC1100055400

Views: 20486

Downloads: 30

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Previous Next