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

Reminder

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

upgrade

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 Command Assistant

Configuring a Command Assistant

This section describes how to configure a command assistant to facilitate device maintenance.

Pre-configuration Tasks

Before configuring a command assistant, power on the device and ensure that self-check is successful.

Configuration Procedure

Perform the following configurations as required.

Manually Running a Python Script

Context

If you need to test whether a Python script runs normally or you do not need to bind a Python script to a trigger condition to run this script, manually trigger the execution of this script using a command.

Procedure

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

    ops install file file [ destination directory ]

    The batch file is installed.

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

    NOTE:

    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 ops run python [ background ] script-name [ arguments ]

    If you do not specify background in the command, the Python script is executed on the foreground. If you specify background, the Python script is executed on the background.

  4. Run commit

    The configuration is committed.

Configuring a Command Assistant Based on Commands

This section describes how to configure a command assistant based on commands.

Context

If you want a device to automatically run a few commands in a specific condition to implement a function, bind the commands to a command assistant.

NOTE:
  • Ensure that the specified commands are correct and complete. The system does not provide help information or check the correctness of the commands bound to a command assistant.

  • Assistants are executed on the background. Therefore, it is not recommended to bind interactive commands or jump commands, such as telnet and stelnet, to an assistant.

  • When executing an interactive command that requires a Y/N choice, the system automatically selects Y. When executing an interactive command that requires input of a character string, the system waits until the command times out and then runs the subsequent command.

  • The system switches to the user view by default to run the specified commands. If a command needs to be executed in the system view, run the execute priority command system-view command first. Otherwise, the command configuration does not take effect.

  • If a command needs to be committed and the two-phase validation mode is used in the system, run the execute priority command commit command after specifying this command. Otherwise, the configuration does not take effect.

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

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ops

    The OPS view is displayed.

  3. Run enable

    OPS is enabled.

  4. Run assistant task-name

    An assistant is created.

  5. Configure a trigger condition for the assistant.

    • Run the condition alarm level compare-operator level-name command to set an alarm severity.

    • Run the condition timer cron minutes hours days-of-month months days-of-week [ years ] command to set a timer.

    Each assistant can have only one trigger condition.

  6. Run execute priority command command-string

    A command that the assistant will run is specified.

    You can run the command multiple times to specify multiple commands to run.

  7. Run commit

    The configuration is committed.

Verifying the Command Assistant Configuration

After configuring a command assistant, verify the configuration.

Prerequisites

A command assistant has been configured.

Procedure

  • Run the display ops assistant { history | current | verbose } [ name task-name ] command to check information about a maintenance assistant.
  • Run the display ops script [ dir-or-file-name ] command to check the directory to which the script is installed.

Example

Run the display ops assistant current command. The command output shows current information about maintenance assistants.

<HUAWEI> display ops assistant current
--------------------------------------------------------
Assistant          State      Condition         Type
--------------------------------------------------------
task               ready      event             command
--------------------------------------------------------

Run the display ops script command. The command output shows the OPS script directory.

<HUAWEI> display ops script
--------------------------------------------------------------------------------
  Index      Size(Byte)  Filename
--------------------------------------------------------------------------------
      0            6273  OPS_get_esn.py
--------------------------------------------------------------------------------
Translation
Download
Updated: 2019-01-02

Document ID: EDOC1100055400

Views: 20527

Downloads: 30

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