This section describes how to configure a command assistant based on commands.
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.
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.
The system view is displayed.
The OPS view is displayed.
OPS is enabled.
An assistant is created.
To set the severity of an alarm that triggers the assistant execution, run the condition alarm level { eq | ge | gt | le | lt | ne } { critical | major | minor | warning } command.
To set the name of an alarm or event that triggers the assistant execution, run the condition { alarm alarm-type | event } feature feature-name name event-name [ para-name para-optype para-value ] & <1-4> [ occurs occur-number [ period period-value ] ] command.
To set the time when an assistant is executed, run the condition timer cron minutes hours daysOfMonth months daysOfWeek [ years ] command.
Each assistant can have only one trigger condition.
A command that the assistant will run is specified.
You can run the command multiple times to specify multiple commands to run.
The configuration is committed.