更新:中英文报警、任务页,以符合上游更改。优化了一些小细节
This commit is contained in:
@@ -136,4 +136,12 @@ Can be used as monthly transfer notificatin
|
||||
>>The servers with ID 3 and 4 (defined in the `ignore`) are counted on the 1st of each month, and a notification is triggered when the monthly outbound transfer reaches 1TB during the cycle.
|
||||
>
|
||||
> `[{"type":"transfer_out_cycle","max":1099511627776,"cycle_start":"2022-01-01T00:00:00+08:00","cycle_interval":1,"cycle_unit":"month","cover":1,"ignore":{"3":true,"4":true}}]`
|
||||

|
||||
|
||||
## Description of mode of triggering notification
|
||||
- Always triggered: A notification is triggered each time the status reported by the Agent matches the rules of the notification
|
||||
- Triggered only once: only one notification is triggered when the state changes, such as changing from normal state to abnormal state or abnormal state back to normal state
|
||||
|
||||
## Set the task to be executed when notification
|
||||
If you need to perform a task while sending a notification message, you can set those items
|
||||
+ `Tasks to be triggered in case of failure` The task to be executed when the notification status matches the change from "normal" to "failure", the task should be set in advance in the tasks page
|
||||
+ `Tasks to be triggered after fault recovery` The task to be executed when the notification status matches the change from " failure " to " normal ", the task should be set in advance in the tasks page
|
||||
@@ -1,19 +1,24 @@
|
||||
**In the task area, you can set up scheduled tasks, periodic tasks, and multi-server batch execution tasks**
|
||||
**In the task area, you can set up scheduled tasks, Trigger tasks, and multi-server batch execution tasks**
|
||||
|
||||
Nezha monitoring supports pushing commands to the Agent for execution, so this feature is very flexible and can be used to periodically back up the server in conjunction with restic, rclone, or periodically restart a service to reset the network connection.
|
||||
Nezha monitoring supports pushing commands to the Agent for execution, so this feature is very flexible and can be used to periodically back up the server in conjunction with restic, rclone. Periodically restart a service to reset the network connection. It can also be used with notifications to perform a task when a notification is triggered, such as running a script when the CPU is at high occupancy for a long period of time.
|
||||
|
||||
## How to use
|
||||
Go to the "Tasks" page of the admin panel and click "Add Scheduled Task"
|
||||
To add a scheduled task you need to make the following settings:
|
||||
+ `Name` - Customize a task name
|
||||
|
||||
+ `Cron Expression` - Set schedule time, the Cron Expression is like:: `* * * * * *` `sec min hour day month week`, see details in [CRON Expression Format](https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format)
|
||||
+ `Task Type` - select the type of task
|
||||
Scheduled Tasks - Tasks are executed periodically at the scheduled time set below
|
||||
Trigger Tasks - Tasks that are triggered only by API or notification rules and are executed once per trigger
|
||||
|
||||
+ `Cron Expression` - (Not valid when using the trigger task type) Set schedule time, the Cron Expression is like:: `* * * * * *` `sec min hour day month week`, see details in [CRON Expression Format](https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format)
|
||||
For example: `0 0 3 * * *` is `Every day at 3 o'clock`
|
||||
|
||||
+ `Command` - Just like writing shell/bat scripts, **but line wrap is not recommended**, **Multiple Commands should be connected with `&&/&`**
|
||||
For example, to execute a periodic reboot command, you can type `reboot` here
|
||||
|
||||
+ `Coverage` and `Specific Servers` - Similar to the settings on the Services page, select rules to determine which Agents need to execute scheduled tasks
|
||||
When using the trigger task type, you can select `Only servers that are included in the notification rule`
|
||||
|
||||
+ `Notification Group` - Select the notification method you have set up on the "Notification" page. [Click here](/en_US/guide/notifications.html#flexible-notification-methods) for more information
|
||||
|
||||
|
||||
Reference in New Issue
Block a user