From 9696336bdc4e7baa25be3616fed1268397b9388c Mon Sep 17 00:00:00 2001 From: Kris <“x@hi.sy”> Date: Sun, 1 May 2022 16:41:03 +0200 Subject: [PATCH] Rewrite the English guide and fix some text errors --- docs/UserGuide_en.md | 218 +++++++++++------------ docs/UserGuide_zh.md | 18 +- resource/template/component/cron.html | 6 +- resource/template/component/monitor.html | 6 +- 4 files changed, 124 insertions(+), 124 deletions(-) diff --git a/docs/UserGuide_en.md b/docs/UserGuide_en.md index 56b32f0..0ecaf27 100644 --- a/docs/UserGuide_en.md +++ b/docs/UserGuide_en.md @@ -1,138 +1,138 @@ # User Guide -## install script +## Script for installation -**Recommended configuration:** Preparation before installation _Two domains_,one can **access CDN** as _Public Access_,for example (status.nai.ba);Another one resolves to the panel server as Agent connect Dashboard use,**can't access CDN** Direct exposure panel host IP,for example(ip-to-dashboard.nai.ba)。 +**Recommended configuration:** Prepare _two domains_ before installation,a domain can **connect to CDN** for _Public Access_,for example (status.nai.ba). Another domain name resolves to the panel server allows the Agent can connect to the Dashboard,This domain **cannot connect to CDN** You need to make it expose the ip of the panel server directly. ```shell curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x nezha.sh sudo ./nezha.sh ``` -_\* use WatchTower Panels can be updated automatically,Windows terminal can use nssm configure autostart_ +_\* Use WatchTower to automatically update the panel, and in Windows you can use nssm to configure self-start_ -**Windows -A key installation Agent (please use Powershell admin rights)** +**Windows One-Click Installation Agent (please use Powershell administrator privileges)** ```powershell set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://raw.githubusercontent.com/naiba/nezha/master/script/install.ps1 -OutFile C:\install.ps1;powershell.exe C:\install.ps1 dashboard_host:grpc_port secret ``` -_In case of confirmation「Implement policy changes」please choose Y_ +_If you encounter the prompt "Implement Policy Change" please select Y_ -### Agent customize +### Customize Agent -#### Custom monitoring of network cards and hard disk partitions +#### Customize the NIC and hard drive partitions to be monitored -implement `/opt/nezha/agent/nezha-agent --edit-agent-config` to select custom NICs and partitions,then reboot just agent +Execute `/opt/nezha/agent/nezha-agent --edit-agent-config` to select a custom NIC and partition, and then restart Agent #### Operating parameters -by executing `./nezha-agent --help` View supported parameters,If you use one-click scripting,can be edited `/etc/systemd/system/nezha-agent.service`,exist `ExecStart=` At the end of this line add +Execute `./nezha-agent --help` to view supported parameters,if you are already using the one-click script, you can edit `/etc/systemd/system/nezha-agent.service`,at the end of this line `ExecStart=` add: -- `--report-delay` System information reporting interval,The default is 1 Second,can be set to 3 to further reduce agent End-system resource usage(Configuration interval 1-4) -- `--skip-conn` Do not monitor the number of connections,if vpn-gateway/connection-intensive machines High CPU usage,Recommended settings -- `--skip-procs` Do not monitor the number of processes,can also be reduced agent occupy -- `--disable-auto-update` prohibit **auto update** Agent(safety features) -- `--disable-force-update` prohibit **Force update** Agent(safety features) -- `--disable-command-execute` prohibited in Agent Execute scheduled tasks on the machine、Open online terminal(safety features) -- `--tls` enable SSL/TLS encryption(use nginx reverse proxy Agent of grpc connect,and nginx turn on SSL/TLS Time,This configuration needs to be enabled) +- `--report-delay` System information reporting interval, default is 1 second, can be set to 3 to reduce the system resource usage on the agent side (configuration range 1-4) +- `--skip-conn` Not monitoring the number of connections, if it is a server with a large number of connections, the CPU usage will be high. It is recommended to set this to reduce CPU usage +- `--skip-procs` Disable monitoring the number of processes can also reduce CPU and memory usage +- `--disable-auto-update` Disable **Automatic Update** Agent (security feature) +- `--disable-force-update` Disable **Forced Update** Agent (security feature) +- `--disable-command-execute` Disable execution of scheduled tasks, disallow open online terminals on the Agent side (security feature) +- `--tls` Enable SSL/TLS encryption (If you are using nginx to reverse proxy Agent´s grpc connections, and if nginx has SSL/TLS enabled, you need to enable this configuration) -## Function Description +## Description of the functions
- Scheduled Tasks:backup script、service restart,and other periodic operation and maintenance tasks。 + Scheduled tasks: backup scripts, service restarts, and other scheduled tasks -Use this feature to periodically combine restic、rclone back up the server,Or periodically restart some service to reset the network connection。 +Use this feature to periodically back up the server in combination with restic or rclone, or to periodically restart a service to reset the network connection.
- Alarm notification:Real-time monitoring of load, CPU, memory, hard disk, bandwidth, traffic, monthly traffic, number of processes, and number of connections。 + Notification: Real-time monitoring of load, CPU, memory, hard disk, bandwidth, transfer, monthly transfer, number of processes, number of connections #### Flexible notification methods -`#NEZHA#` is the panel message placeholder,The panel will automatically replace the placeholder with the actual message when the notification is triggered +`#NEZHA#` is a panel message placeholder, and the panel will automatically replace the placeholder with the actual message when it triggers a notification -Body content is`JSON` formatted:**when the request type is FORM Time**,value is `key:value` form,`value` Placeholders can be placed inside,Automatically replace when notified。**when the request type is JSON** It will only be submitted directly to the`URL`。 +The content of Body is in `JSON` format:**When the request type is FORM**,the value is in the form of `key:value`,`value` can contain placeholders that will be automatically replaced when notified. **When the request type is JSON** It will only do string substitution and submit to the `URL` directly. -URL Placeholders can also be placed inside,Simple string replacement is done when requested。 +Placeholders can also be placed inside the URL, and it will perform a simple string substitution when requested. -Refer to the example below,very flexible。 +Refer to the example below, it is very flexible. 1. Add notification method - - telegram Example [@haitau](https://github.com/haitau) contribute + - Telegram Example, contributed by [@haitau](https://github.com/haitau) - - name:telegram Robot message notification + - Name:Telegram Robot message notification - URL:# - - request method: GET - - request type: default + - Request method: GET + - Request type: default - Body: null - - URL Parameter acquisition instructions:botXXXXXX Neutral XXXXXX is in telegram Follow the official @Botfather ,enter/newbot ,Create new bot(bot)Time,will provide token(in prompt Use this token to access the HTTP API:next line)here 'bot' Three letters are indispensable. After bot created, You need to chat with the BOT to have a conversation(Just send a message),then available API Send a message. YYYYYY is telegram user's number ID。with the robot @userinfobot Dialogue is available。 + - URL Parameter acquisition instructions:The XXXXXX in botXXXXXX is the token provided when you follow the official @Botfather in Telegram and enter /newbot to create a new bot. (In the line after _Use this token to access the HTTP API_). The 'bot' are essential. After creating a bot, you need to talk to the BOT in Telegram (send a random message) before you can send a message by using API. YYYYYY is Telegram user's ID, you can get it by talking to the bot @userinfobot. -2. Add an offline alarm +2. Add an offline notification - - name:Offline notifications - - rule:`[{"Type":"offline","Duration":10}]` - - enable:√ + - Name: Offline notifications + - Rule: `[{"Type":"offline","Duration":10}]` + - Enable: √ -3. add a monitor CPU continued 10s Exceed 50% **and** memory persistent 20s Occupied less than 20% the alarm +3. Add an notification when the CPU exceeds 50% for 10s **but** the memory usage is below 20% for 20s - - name:CPU+RAM - - rule:`[{"Type":"cpu","Min":0,"Max":50,"Duration":10},{"Type":"memory","Min":20,"Max":0,"Duration":20}]` - - enable:√ + - Name: CPU+RAM + - Rule: `[{"Type":"cpu","Min":0,"Max":50,"Duration":10},{"Type":"memory","Min":20,"Max":0,"Duration":20}]` + - Enable: √ -#### Description of alarm rules +#### Description of notification rules -##### basic rules +##### Basic Rules -- type +- Type - `cpu`、`memory`、`swap`、`disk` - - `net_in_speed` Inbound speed、`net_out_speed` Outbound speed、`net_all_speed` two-way speed、`transfer_in` Inbound traffic、`transfer_out` Outbound traffic、`transfer_all` bidirectional traffic + - `net_in_speed` Inbound speed, `net_out_speed` Outbound speed, `net_all_speed` Inbound + Outbound speed, `transfer_in` Inbound Transfer, `transfer_out` Outbound Transfer, `transfer_all` Total Transfer - `offline` Offline monitoring - `load1`、`load5`、`load15` load - - `process_count` number of processes _Currently fetching threads takes up too many resources,Temporarily not supported_ - - `tcp_conn_count`、`udp_conn_count` number of connections -- duration:duration in seconds,Sampling records in seconds 30% The above trigger threshold will only alarm(Anti-Data Pin) + - `process_count` Number of processes _Currently, counting the number of processes takes up too many resources and is not supported at the moment_ + - `tcp_conn_count`、`udp_conn_count` Number of connections +- duration:Lasting for a few seconds, the notification will only be triggered when the sampling record reaches 30% or more within a few seconds - min/max - - flow、Network speed class value as bytes(1KB=1024B,1MB = 1024\*1024B) - - memory、hard disk、CPU occupancy percentage - - Offline monitoring without setup + - Transfer, network speed, and other values of the same type. Unit is byte (1KB=1024B,1MB = 1024\*1024B) + - Memory, hard disk, CPU. units are usage percentages + - No setup required for offline monitoring - cover `[{"type":"offline","duration":10, "cover":0, "ignore":{"5": true}}]` - - `0` monitor all,pass `ignore` ignore specific server - - `1` ignore all,pass `ignore` Monitor specific servers -- ignore: `{"1": true, "2":false}` specific server,match `cover` use + - `0` Cover all, use `ignore` to ignore specific servers + - `1` Ignore all, use `ignore` to monitoring specific servers +- ignore: `{"1": true, "2":false}` to ignore specific servers, use with `cover` -##### special:Arbitrary cycle flow alarm +##### Special: Any-cycle transfer notification -Can be used as monthly flow alarm +Can be used as monthly transfer notificatin - type - - transfer_in_cycle Inbound traffic during the period - - transfer_out_cycle Outbound traffic during the period - - transfer_all_cycle Bidirectional flow in cycles and -- cycle_start Fiscal Period Start Date(Can be the start date of your machine billing cycle),RFC3339 Time format,For example, Beijing time is`2022-01-11T08:00:00.00+08:00` -- cycle_interval How many cycle units every (for example, if the cycle unit is days, the value is 7, which means that the statistics will be counted every 7 days) -- cycle_unit Statistical period unit, default `hour`, optional(`hour`, `day`, `week`, `month`, `year`) -- min/max、cover、ignore Refer to Basic Rules Configuration -- Example: ID for 3 the machine(ignore inside the definition)of monthly 15 outbound monthly traffic billed 1T Call the police `[{"type":"transfer_out_cycle","max":1000000000000,"cycle_start":"2022-01-11T08:00:00.00+08:00","cycle_interval":1,"cycle_unit":"month","cover":1,"ignore":{"3":true}}]` + - transfer_in_cycle Inbound transfer during the cycle + - transfer_out_cycle Outbound transfer during the cycle + - transfer_all_cycle The sum of inbound and outbound transfer during the cycle +- cycle_start Start date of the statistical cycle (can be the start date of your server's billing cycle), the time format is RFC3339, for example, the format in Beijing time zone is`2022-01-11T08:00:00.00+08:00` +- cycle_interval Interval time cycle (For example, if the cycle is in days and the value is 7, it means that the statistics are counted every 7 days) +- cycle_unit Statistics cycle unit, default `hour`, optional(`hour`, `day`, `week`, `month`, `year`) +- min/max、cover、ignore Please refer to the basic rules to configure +- Example: The server with ID 3 (defined in the `ignore`) is counted on the 15th of each month, and a notification is triggered when the monthly outbound traffic reaches 1TB during the cycle. `[{"type":"transfer_out_cycle","max":1000000000000,"cycle_start":"2022-01-11T08:00:00.00+08:00","cycle_interval":1,"cycle_unit":"month","cover":1,"ignore":{"3":true}}]` ![7QKaUx.md.png](https://s4.ax1x.com/2022/01/13/7QKaUx.md.png)
- service monitoring:HTTP、SSL certificate、ping、TCP port etc。 + Service monitoring: HTTP, SSL certificate, ping, TCP port, etc. -Enter `/monitor` Click to create a new monitor on the page,Instructions are below the form。 +Just go to the `/service` page and click on Add Service Monitor, there are instructions on the form.
- custom code:Change the logo、change color、Add statistical code, etc.。 + Custom code: change logo, change color tone, add statistics code, etc. **Effective only on the visitor's home page.** -- Default theme changing progress bar color example +- Example of changing the default theme progress bar color ```html ``` -- DayNight Example of theme changing progress bar color, modifying footer(from [@hyt-allen-xu](https://github.com/hyt-allen-xu)) +- Example of modifying DayNight theme progress bar color and footer (by [@hyt-allen-xu](https://github.com/hyt-allen-xu)) ```html