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 Batch File Execution Command Assistant

Configuring a Batch File Execution Command Assistant

Context

If you want a device to automatically run some commands in a specific condition to implement a function, add these commands to a batch file (*.bat), install the batch file, and then bind it to a command assistant. When the device executes the assistant, it runs the commands in the batch file associated with the assistant in the sequence at which the commands were written into the batch file.

NOTE:
  • A command assistant can run only one batch file.

  • Ensure that the specified batch file is correct and complete. The system does not check correctness of the batch file.

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

  • The system switches to the user view by default to run the commands in the batch file. If a command needs to be executed in the system view, run the system-view command to switch to the system view. Otherwise, the command is executed in the user view and the configuration cannot take effect.

  • If a command in the batch file needs to be committed and the two-stage configuration mode is used in the system, write the commit command in the batch file. Otherwise, the configuration does not take effect.

  • After the execute batch-file command is run, the command execution automatically proceeds in machine-to-machine mode (Y is automatically entered). Intelligent rollback is not supported, and you must run the quit command to exit the current view before entering another view.

Procedure

  1. Upload a batch file 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 batch file.

    If you do not specify destination directory in the command, the batch file is installed in the default path flash:/$_user/. If this parameter is specified, the batch file is installed in 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 batch-file file-name command to bind the batch file to the assistant.

    Each command assistant can run only one batch file.

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

Document ID: EDOC1100074722

Views: 15232

Downloads: 18

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