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

Configuration Guide - Device Management

CloudEngine 12800 and 12800E V200R005C10

This document describes the configurations of Device Management, including device status query, hardware management, Information Center Configuration, NTP, Synchronous Ethernet Configuration, Fault Management Configuration, Energy-Saving Management Configuration, Performance Management Configuration, Maintenance Assistant Configuration, and OPS Configuration.
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 to Run a Python Script

Configuring a Command Assistant to Run a Python Script

Context

Python scripts can be run by being associated with command assistants. Command assistants use commands to set trigger conditions, including timer and software and hardware alarms. When trigger conditions are met, the system runs Python scripts.

Procedure

  1. Upload a Python script to the device. For details on how to upload a file to the device, see File Management in the CloudEngine 12800 and 12800E Series Switches Configuration Guide - Basic Configuration.
  2. Run the ops install file file [ destination directory ] command in the user view to install the Python script.

    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 the system-view command to enter the system view.
  4. Run the ops command to enter the OPS view.
  5. Run the assistant task-name command to create a command assistant.
  6. Configure a trigger condition for the command assistant.

    Each command assistant can have only one trigger condition. You can run any of the following condition commands to configure a trigger condition. If you run the condition command multiple times, only the latest configuration takes effect.

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

    • Run the condition { alarm [ start | end ] | event } feature feature-name name name [ para-name para-compare-type para-value ] & <1-4> [ occurs occur-timers [ period period-value ] ] command to specify an alarm or event name.

      Run the condition command to specify an alarm or event name.

      For the modules and names of the corresponding alarms and events, see the alarm and log manuals.

    • Run the condition snmp-notification oid oid [ int-compare oid-int-value ] command to match an SNMP trap OID.
    • Run the condition syslog pattern regexp [ occurs occur-timers [ period period-value ] ] command to math logs.
    • Run the condition timer cron minutes hours days-of-month months days-of-week [ years ] command to set a timer.

  7. Run the execute priority python file-name [ arguments ] command to bind a Python script to the command assistant.

    Each command assistant can run only one Python script.

  8. Run the commit command to commit the configuration.
Translation
Download
Updated: 2019-04-20

Document ID: EDOC1100074722

Views: 14436

Downloads: 18

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