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 such as the CLI event, timer event, and route change event.
The Python script is installed.
If the specified directory does not exist, the system automatically creates the directory. A maximum of seven levels of subdirectories can be created under cfcard:/$_user/.
The system view is displayed.
The OPS view is displayed.
OPS is enabled.
An environment variable is configured.
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.
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.
The configuration is committed.
Run the display ops assistant current command to check current information about maintenance assistants.