优化更新中英文文档-管理面板-服务器

This commit is contained in:
Kris 2024-05-14 01:52:57 +02:00
parent 236304236e
commit 3b7bcbe716
No known key found for this signature in database
GPG Key ID: 36AFAA97D2910652
3 changed files with 169 additions and 161 deletions

View File

@ -127,7 +127,7 @@ function getGuideSidebarZhCN() {
{ text: '实时通道断开/在线终端连接失败', link: '/guide/q4.html' },
{ text: '面板数据迁移、备份和恢复', link: '/guide/q5.html' },
{ text: '设置每月重置流量统计', link: '/guide/q6.html' },
{ text: '自定义 Agent 监控项目', link: '/guide/q7.html' },
{ text: '自定义 Agent 监控项目', link: '/guide/q7.html' },
{ text: '使用Cloudflare Access作为OAuth2提供方', link: '/guide/q8' },
]
},

View File

@ -1,43 +1,61 @@
# Servers
---
outline: deep
---
# Server
## Introduction
The Servers area is responsible for managing the Agent, the most basic area in Nezha Monitoring, and the basis for other functions.
## Add a server
The first step is to add a servers, which can be customized with names, groups, display index and notes.
Servers in the same group will be displayed in groups in supported themes, and notes will only be displayed in the admin panel, no need to worry about leaking information.
The server section is responsible for managing Agents, forming the most fundamental part of Nezha monitoring and serving as the basis for other functionalities.
## Install Agent
Please refer to the previous article: [Install Agent](/en_US/guide/agent.html)
We recommend using one-click installation, that is, **after configuring the communication domain name**, click the button on the column **one-click installation** and copy it to the monitored servers for installation.
## Adding a Server
## Forced Updates
The flags related to the update of the Agent are: `--disable-auto-update` and `--disable-force-update`. Please refer to [Customize Agent](/en_US/guide/agent.html#customize-agent)
By default, the Agent is updated automatically, but when the user turns off automatic updates, the specified servers can also be selected for forced updates.
This feature does not take effect when `-disable-force-update` is turned on.
The first step is to add a server, where you can customize the name, group, sorting, and notes.
Servers in the same group will be displayed together in supported themes. Notes will only be visible in the Admin Panel, so there's no need to worry about leaking information.
## Data List
* Version number: Record the current version of Agent
* Secret: Used when configuring the Agent
* One-Click Installation: A more convenient way to install Agent
* Manage: WebShell on the left, Edit in the middle, Delete on the right
## Installing the Agent
## Webshell
This feature does not take effect when `disable-command-execute` is turned on.
Both Linux and Windows are available and can be pasted using Ctrl+Shift+V.
For connection failure, please refer to [Real-time channel disconnection/online terminal connection failure](/en_US/guide/q4.html).
Note that in theWebShell function, the Agent also connects to the **Domain names for public access** via WebSocket, not via grpc.
Please refer to the previous section on [installing the Agent](/en_US/guide/agent.html).
It is recommended to use the one-click installation. After configuring the parameters, click the corresponding system icon in the **one-click installation** column of the server to copy the installation command and execute it on the respective server.
## DDNS
DDNS feature is suitable for servers that have dynamic IP addresses. When a different IP is reported by Agent, Dashboard will update DNS record automatically using configured settings.
## Forced Update
### Why choose Nezha's DDNS feature
- Manage your DDNS configuration centrally, without deploying a single service on every server.
- Save your credentials only on the Dashboard server to prevent data leaks.
Agent update-related parameters include `--disable-auto-update` and `--disable-force-update` as described in [Custom Agent Monitoring Projects](/en_US/guide/q7.html).
By default, the Agent will update automatically without intervention. However, if the user disables automatic updates, you can select specific servers for a forced update.
The forced update will not work if `disable-force-update` is enabled.
### Configuration description
Currently, DDNS supports two types of configurations: Single and Multiple. If Single is chosen, all Agent servers will use the same configuration to update DNS records, whereas selecting Multiple allows each server to use a specified configuration.
## Data Columns
* Version: Records the current version of the Agent.
* Hide from Guests: When true, guests cannot see this server in the Dashboard.
* Enable DDNS: When true, if the server IP changes, the Dashboard will automatically update the DNS records.
* DDNS Domain: The DDNS domain configured for this server.
* Secret: The secret/key used for configuring the Agent, which is used to verify communication between the Agent and the Dashboard.
* One-Click Install: Click the corresponding system button to copy the command and execute it on the server for a one-click installation.
* Management: Connects to WebShell, modifies server configuration, or deletes the server.
## WebSSH Terminal
This is WebShell; the feature will not work if `disable-command-execute` is enabled.
It is available for both Linux and Windows and supports Ctrl+Shift+V for pasting.
If the connection fails, refer to [Real-Time Channel Disconnection/Online Terminal Connection Failure](/en_US/guide/q4.html).
Note that in the WebSSH terminal function, the Agent connects to the **public access domain** via WebSocket, not through gRPC.
## DDNS Functionality
The DDNS functionality is suitable for servers with dynamic IPs. When the Agent reports a new IP, the Dashboard will automatically update the DNS records based on the configuration.
### Why Use Nezha Monitoring's DDNS Functionality?
- Centralized management of DDNS settings instead of deploying a DDNS service on each server.
- Confidential information is only stored on the Dashboard server, preventing leakage.
### Configuration Instructions
Currently, the DDNS functionality supports two configuration forms: single configuration and multiple configurations. If single configuration is used, all Agent servers will use the same configuration to update DDNS. If multiple configurations are used, each server can be assigned a specific configuration to update DDNS, offering greater flexibility.
#### Single Configuration
#### Single
```yaml
DDNS:
Enable: true
@ -51,63 +69,39 @@ DDNS:
MaxRetries: 3
Profiles: null
```
##### Enable
Boolean value indicating whether the DDNS function is enabled.
##### Provider
Name of the DDNS provider, currently support `webhook`, `cloudflare` and `tencentcloud`.
##### AccessID
Secret ID associated with DDNS provider.
Only applied to `tencentcloud`.
##### AccessSecret
Secret key associated with DDNS provider.
- `Enable`: Boolean value to enable or disable the DDNS functionality.
- `Provider`: The name of the DDNS provider; currently supports `webhook`, `cloudflare`, and `tencentcloud`.
- `AccessID`: Token ID for the DDNS provider; only applicable to the `tencentcloud` provider.
- `AccessSecret`: Token Secret for the DDNS provider; only applicable to the `cloudflare` and `tencentcloud` providers.
- `WebhookMethod`: The request method for the webhook, such as `GET` or `POST`; only applicable to the `webhook` provider.
- `WebhookURL`: The request URL for the webhook; only applicable to the `webhook` provider.
- `WebhookRequestBody`: The request body for the webhook; only applicable to the `webhook` provider.
- `WebhookHeaders`: The request headers for the webhook; only applicable to the `webhook` provider.
- `MaxRetries`: The number of retry attempts when a request fails.
- `Profiles`: Multi-configuration settings; ignored in single configuration settings.
Only applied to `cloudflare` and `tencentcloud`.
##### WebhookMethod
Request method of Webhook. For example, `GET` and `POST`.
The `WebhookURL`, `WebhookRequestBody`, and `WebhookHeaders` can include the following parameters:
Only applied to `webhook`.
##### WebhookURL
Request URL of Webhook.
- `{ip}`: The current IP of the server.
- `{domain}`: The DDNS domain.
- `{type}`: The IP type, which could be "ipv4" or "ipv6".
- `{access_id}`: Credential 1.
- `{access_secret}`: Credential 2.
Only applied to `webhook`.
##### WebhookRequestBody
Request body of Webhook.
Example Configuration:
Only applied to `webhook`.
##### WebhookHeaders
Request headers of Webhook.
Only applied to `webhook`.
##### MaxRetries
The number of retry attempts after an update request has failed.
##### Profiles
Multiple configuration setting. Will be ignored in Single configuration setting.
:::tip
`WebhookURL`, `WebhookRequestBody` and `WebhookHeaders` can use additional params
`{ip}` - Host IP
`{domain}` - DDNS domain
`{type}` - Your IP type, possibly "ipv4" or "ipv6"
`{access_id}` - Credential #1
`{access_secret}` - Credential #2
Example:
```
```yaml
WebhookHeaders: |
a:{access_id}
b:{access_secret}
WebhookRequestBody: '{"domain": "{domain}", "ip": "{ip}", "type": "{type}"}'
```
:::
#### Multiple
Please leave `DDNS.Provider` field blank while using Multiple configuration. If not, the Multiple configuration will be ignored.
#### Multiple Configurations
When using multiple configurations, leave the `DDNS.Provider` value empty. If `DDNS.Provider` is not empty, the multiple configuration settings will be ignored.
```yaml
DDNS:
Enable: true
@ -122,39 +116,36 @@ DDNS:
WebhookRequestBody: ""
WebhookHeaders: ""
```
##### Profiles
Multiple configuration setting.
##### example
Name of DDNS configuration, can be any string.
For other options, view [Single](#single).
- `Profiles`: Multi-configuration settings.
- `example`: Can be replaced with any string as the DDNS configuration name.
### Dashboard configuration
After configuring `config.yaml`, you will need to modify server settings in Dashboard to make DDNS function effective.
Other options can be referenced from the [Single Configuration](#Single-Configuration) section.
Explanation of DDNS-related options:
- Enable DDNS
Enable the DDNS functionality for this server.
- Enable DDNS IPv4
Enable IPv4 resolution when updating DDNS records.
- Enable DDNS IPv6
Enable IPv6 resolution when updating DDNS records.
- DDNS Domain
The domain name the record points to.
- DDNS Configuration
The DDNS configuration to use in case of multiple configurations.
#### Dashboard Configuration
::: tip
When modifying settings in the Dashboard and saving them, default configuration options will be filled into the `config.yaml` file. At this time, in the DDNS field, there will be both single configuration and multiple configurations options available.
After modifying the configuration file, you also need to modify the server settings in the Dashboard for the DDNS to take effect.
If you need to use a single configuration, please ignore the content related to the Profiles option.
DDNS related options:
Please leave `DDNS.Provider` field blank while using Multiple configuration. If not, the Multiple configuration will be ignored.
- `Enable DDNS`: Enable the DDNS functionality for this server.
- `Enable DDNS IPv4`: Enable IPv4 parsing when updating DDNS records.
- `Enable DDNS IPv6`: Enable IPv6 parsing when updating DDNS records.
- `DDNS Domain`: The domain the record points to.
- `DDNS Configuration`: The DDNS configuration name to use in multiple configurations.
::: warning
When you modify the configuration and save it in the Dashboard settings, it will populate the default configuration options in `config.yaml`, and both single and multiple configurations will exist in the DDNS section.
- To use single configuration, configure `DDNS.Provider` and ignore the `Profiles` options.
- To use multiple configurations, leave `DDNS.Provider` empty. If `DDNS.Provider` is not empty, the multiple configuration settings will be ignored.
:::
### View log
In the Dashboard's logs, you can view the relevant logs for the DDNS. When configured correctly, there will be corresponding log entries when the DNS records are updated.
```shell
dashboard_1 | 2024/03/16 23:16:25 NEZHA>> 正在尝试更新域名(ddns.example.com)DDNS(1/3)
dashboard_1 | 2024/03/16 23:16:28 NEZHA>> 尝试更新域名(ddns.example.com)DDNS成功
```
#### Viewing Logs
In the Dashboard logs, you can see the relevant logs for the DDNS functionality. When configured correctly, there will be corresponding log entries when updating DNS records.
```shell
dashboard_1 | 2024/03/16 23:16:25 NEZHA>> 正在尝试更新域名(ddns.example.com)DDNS(1/3) # Attempting to update domain (ddns.example.com) DDNS (1/3)
dashboard_1 | 2024/03/16 23:16:28 NEZHA>> 尝试更新域名(ddns.example.com)DDNS成功 # Successfully updated domain (ddns.example.com) DDNS
```

View File

@ -5,47 +5,57 @@ outline: deep
# 服务器
## 介绍
服务器区域负责管理 Agent是哪吒探针中最基础的区域也是其他功能的基础。
## 新增服务器
第一步是新增服务器,可以自定义名称、分组、排序和备注。
拥有相同分组的服务器会在受支持的主题中划分到一起进行显示,备注仅会在后台显示,无需担心泄露信息。
## 安装 Agent
请参考前文[安装 Agent](/guide/agent.html)
请参考前文[安装 Agent](/guide/agent.html)。
推荐使用一键安装,即**配置好参数后**,点击服务器**一键安装**列上的对应的系统图标即可复制安装命令,在相应服务器上进行安装。
## 强制更新
Agent 更新相关的参数是 [自定义 Agent 监控项目](/guide/agent.html#自定义agent监控项目) 中的 `--disable-auto-update``--disable-force-update`
Agent 更新相关的参数是 [自定义 Agent 监控项目](/guide/q7.html) 中的 `--disable-auto-update``--disable-force-update`
默认情况下Agent 会自动更新,无需干预。但当用户关闭自动更新后,也可以选中指定服务器进行强制更新。
`disable-force-update` 开启时此功能不生效。
## 数据列
* 版本号: 记录 Agent 当前版本
* 对游客隐藏: 为 True 时,游客在面板中无法查看到此服务器
* 启用DDNS: 为 True 时当该服务器IP发生变化Dashboard 会自动更新 DNS 记录
* DDNS域名为该服务器配置的 DDNS 域名
* 密钥: 即 secret\key配置 Agent 时会用到,用于验证 Agent 与 Dashboard 的通信
* 一键安装: 点击相应的系统按钮,复制命令到服务器执行即可一键安装
* 管理: 分别为连接 WebShell修改服务器配置删除服务器
* 版本号:记录 Agent 当前版本。
* 对游客隐藏:为 True 时,游客在面板中无法查看到此服务器。
* 启用 DDNS为 True 时,当该服务器 IP 发生变化Dashboard 会自动更新 DNS 记录。
* DDNS 域名:为该服务器配置的 DDNS 域名。
* 密钥:即 secret/key配置 Agent 时会用到,用于验证 Agent 与 Dashboard 的通信。
* 一键安装:点击相应的系统按钮,复制命令到服务器执行即可一键安装。
* 管理:分别为连接 WebShell修改服务器配置删除服务器。
## 在线终端
即 WebShell`disable-command-execute`开启时此功能不生效。
即 WebShell`disable-command-execute` 开启时此功能不生效。
Linux 和 Windows 均可用,可使用 Ctrl+Shift+V 粘贴。
连接失败请参考[实时通道断开/在线终端连接失败](/guide/q4.html)。
注意在线终端功能中Agent 也是通过 WebSocket 连接到**公开访问域名**,而非通过 gRPC 交互。
## DDNS 功能
DDNS 功能适用于使用动态 IP 的服务器,当 Agent 上报了一个新的 IPDashboard 会根据配置自动更新 DNS 记录
DDNS 功能适用于使用动态 IP 的服务器,当 Agent 上报了一个新的 IPDashboard 会根据配置自动更新 DNS 记录。
### 为什么我要使用哪吒监控的 DDNS 功能?
- 方便集中管理 DDNS 设置,而不是在每台机器上都部署一个 DDNS 服务
- 仅在面板机上保存您的机密信息,防止外泄
- 方便集中管理 DDNS 设置,而不是在每台服务器上都部署一个 DDNS 服务。
- 仅在面板服务器上保存您的机密信息,防止外泄。
### 配置说明
目前 DDNS 功能支持两种形式的配置:单配置和多配置。如使用单配置,则所有 Agent 服务器都使用相同的配置更新 DDNS如使用多配置则可为每台服务器指定一个配置更新 DDNS灵活性更强
目前 DDNS 功能支持两种形式的配置:单配置和多配置。如使用单配置,则所有 Agent 服务器都使用相同的配置更新 DDNS如使用多配置则可为每台服务器指定一个配置更新 DDNS灵活性更强。
#### 单配置
```yaml
DDNS:
Enable: true
@ -59,35 +69,39 @@ DDNS:
MaxRetries: 3
Profiles: null
```
- `Enable` 布尔值,选择是否开启 DDNS 功能
- `Provider` DDNS 供应商的名称;目前支持 `webhook``cloudflare` 以及 `tencentcloud`
- `AccessID` DDNS 供应商的令牌 ID仅适用于供应商 `tencentcloud`
- `AccessSecret` DDNS 供应商的令牌 Secret仅适用于供应商 `cloudflare``tencentcloud`
- `WebhookMethod` Webhook 的请求方法。例如 `GET``POST`等;仅适用于供应商 `webhook`
- `WebhookURL` Webhook 的请求地址;仅适用于供应商 `webhook`
- `WebhookRequestBody` Webhook 的请求体;仅适用于供应商 `webhook`
- `WebhookHeaders` Webhook 的请求头;仅适用于供应商 `webhook`
- `MaxRetries`当请求失败时,重试请求的次数
- `Profiles` 多配置设定;在单配置设定中,此项忽略
`WebhookURL``WebhookRequestBody` 以及`WebhookHeaders`可以包含以下参数:
- `{ip}` - 主机当前IP
- `{domain}` - ddns域名
- `{type}` - IP类型可能为"ipv4"和"ipv6"
- `{access_id}` - 凭据1
- `{access_secret}` - 凭据2
- `Enable`:布尔值,选择是否开启 DDNS 功能。
- `Provider`DDNS 供应商的名称;目前支持 `webhook``cloudflare` 以及 `tencentcloud`
- `AccessID`DDNS 供应商的令牌 ID仅适用于供应商 `tencentcloud`
- `AccessSecret`DDNS 供应商的令牌 Secret仅适用于供应商 `cloudflare``tencentcloud`
- `WebhookMethod`Webhook 的请求方法。例如 `GET``POST` 等;仅适用于供应商 `webhook`
- `WebhookURL`Webhook 的请求地址;仅适用于供应商 `webhook`
- `WebhookRequestBody`Webhook 的请求体;仅适用于供应商 `webhook`
- `WebhookHeaders`Webhook 的请求头;仅适用于供应商 `webhook`
- `MaxRetries`:当请求失败时,重试请求的次数。
- `Profiles`:多配置设定;在单配置设定中,此项忽略。
`WebhookURL``WebhookRequestBody` 以及 `WebhookHeaders` 可以包含以下参数:
- `{ip}`:主机当前 IP。
- `{domain}`ddns 域名。
- `{type}`IP 类型,可能为 "ipv4" 和 "ipv6"。
- `{access_id}`:凭据 1。
- `{access_secret}`:凭据 2。
配置示例:
```
```yaml
WebhookHeaders: |
a:{access_id}
b:{access_secret}
WebhookRequestBody: '{"domain": "{domain}", "ip": "{ip}", "type": "{type}"}'
```
<br>
#### 多配置
当使用多配置时,请将 `DDNS.Provider` 留空。如 `DDNS.Provider` 的值不为空,多配置设定将被忽略
当使用多配置时,请将 `DDNS.Provider` 留空。如 `DDNS.Provider` 的值不为空,多配置设定将被忽略。
```yaml
DDNS:
Enable: true
@ -102,33 +116,36 @@ DDNS:
WebhookRequestBody: ""
WebhookHeaders: ""
```
- `Profiles` 多配置设定
- `example` 可替换为 DDNS 配置名,可填任意字符串
- `Profiles`:多配置设定。
- `example`:可替换为 DDNS 配置名,可填任意字符串。
其它选项请参考[单配置](#单配置)段。
<br>
#### Dashboard 配置
修改配置文件后,还需要在 Dashboard 中修改服务器设置才能使 DDNS 生效
<br>
修改配置文件后,还需要在 Dashboard 中修改服务器设置才能使 DDNS 生效。
DDNS 相关选项说明:
- `启用DDNS` 为此服务器启用 DDNS 功能
- `启用DDNS IPv4` 更新 DDNS 记录时,启用 IPv4 解析
- `启用DDNS IPv6` 更新 DDNS 记录时,启用 IPv6 解析
- `DDNS域名` 记录指向的域名
- `DDNS配置` 在多配置情况下,要使用的 DDNS 配置名
- `启用 DDNS`:为此服务器启用 DDNS 功能。
- `启用 DDNS IPv4`:更新 DDNS 记录时,启用 IPv4 解析。
- `启用 DDNS IPv6`:更新 DDNS 记录时,启用 IPv6 解析。
- `DDNS 域名`:记录指向的域名。
- `DDNS 配置`:在多配置情况下,要使用的 DDNS 配置名。
::: warning
在 Dashboard 设置中修改配置并保存时,会在 `config.yaml` 中填入默认配置选项,此时 DDNS 段中会同时存在单配置和多配置
在 Dashboard 设置中修改配置并保存时,会在 `config.yaml` 中填入默认配置选项,此时 DDNS 段中会同时存在单配置和多配置
- 如需使用单配置,请配置`DDNS.Provider`,并忽略 `Profiles` 选项相关内容。
- 如需使用单配置,请配置 `DDNS.Provider`,并忽略 `Profiles` 选项相关内容。
- 如需使用多配置,请将 `DDNS.Provider` 留空。如 `DDNS.Provider` 的值不为空,多配置设定将被忽略。
:::
<br>
#### 查看日志
在 Dashboard 的日志中,可以看到 DDNS 功能的相关日志,配置正确时,更新 DNS 记录时会有相应的日志记录。
```shell
dashboard_1 | 2024/03/16 23:16:25 NEZHA>> 正在尝试更新域名(ddns.example.com)DDNS(1/3)
dashboard_1 | 2024/03/16 23:16:28 NEZHA>> 尝试更新域名(ddns.example.com)DDNS成功
```
在 Dashboard 的日志中,可以看到 DDNS 功能的相关日志,配置正确时,更新 DNS 记录时会有相应的日志记录。
```shell
dashboard_1 | 2024/03/16 23:16:25 NEZHA>> 正在尝试更新域名(ddns.example.com)DDNS(1/3)
dashboard_1 | 2024/03/16 23:16:28 NEZHA>> 尝试更新域名(ddns.example.com)DDNS成功
```