Maintenance Assistant Overview
The maintenance assistant function implements automatic device management and maintenance. You can create an assistant and define a trigger condition and task for the assistant. If an assistant task is ready to run, the system monitors the device running status in real time. When the configured trigger condition is met, the system automatically performs the configured task. Assistants enable the system to monitor its running status and take actions in different conditions, improving system maintainability.
Type |
Trigger Condition |
Task |
|
---|---|---|---|
Command assistant |
Command-based |
The following trigger conditions are configured using commands:
|
Run a command. |
Batch file-based |
Run a batch file. |
||
Script assistant |
Defined by Python scripts |
Defined by Python scripts |
To configure the time when a maintenance assistant is executed, run the condition timer cron command. The time in the cron format is more flexible and can represent a single moment, multiple moments, time range, or interval in a simplified manner. For details about the cron format, see Table 19-2.
Usage Scenario |
Expression |
Format |
Example |
---|---|---|---|
Specifying a single moment |
time |
The value is an integer indicating a specific moment. |
The condition timer cron 0 1 2 5 3 2012 command configures a maintenance assistant to be executed at 01:00 on May 2 (Wednesday), 2012. |
Specifying multiple moments |
time1,time2,time3 |
The value is an integer indicating a specific moment. Multiple moments are isolated by , without spaces. There is no restriction on the time and sequence. |
The condition timer cron 0 1,2,3 2 3 * 2012 command configures a maintenance assistant to be executed at the following moments:
|
Specifies an interval. |
time/step |
time is an integer indicating a specific moment. step specifies an interval. time and step are isolated by / without spaces. The time is calculated in the format of time, time + 1 x step, ..., time + n x step. n is determined by step. The maximum time must be within the time range. |
The condition timer cron 0 0/10 * 3 * 2012 command configures a maintenance assistant to be executed at the following moments:
|
Specifies a period |
time1-time2 |
The value contains two moments that are isolated by - without spaces. time2 must be greater than or equal to time1. The time is calculated in the format of time1, time1 + 1, time1 + 2, …, and time2. |
The condition timer cron 0 0-3 1 3 * 2012 command configures a maintenance assistant to be executed at the following moments:
|
Specifies a periodical moment. |
* |
* indicates all possible moments. |
The condition timer cron 30 10 * 1 1 2012 command configures a maintenance assistant to be executed at 10:30 on each Monday in January, 2012. |
Specifies a time combination |
The previous methods can be used in a mix. |
Moments are isolated by , without spaces. |
The condition timer cron 0 0/10,2,4-5 1 3 * 2012 command configures a maintenance assistant to be executed at the following moments:
|
The OPS supports the maintenance assistant-based maintaining probe function that monitors protocol connectivity. If a protocol connection is torn down, the maintenance assistant script begins to run to collect disconnection information, improving device maintainability.