更新英文文档:Dashboard安装文档、Agent安装文档
This commit is contained in:
parent
41cf48e5a5
commit
a5aa54d483
@ -1,63 +1,57 @@
|
||||
**哪吒监控的被控端服务被称为Agent,本文档将介绍如何在被控端服务器上安装Agent,并与Dashboard连接**
|
||||
**The service in the monitored server is called Agent. This document will describe how to install the Agent on the monitored server and connect it with Dashboard**
|
||||
<br/>
|
||||
## Install Agent using one-click script
|
||||
目前哪吒监控已支持在WIndows和Linux上一键安装Agent,遵循本文档的步骤,你可以很轻松的在服务器上部署它
|
||||
Nezha Monitoring now supports one-click installation of the Agent on Windows and Linux. Follow the steps in this document and you can easily deploy it on your server
|
||||
<br/>
|
||||
### 准备工作
|
||||
---
|
||||
你需要提前在管理面板中设置好通信域名,此域名不可以接入CDN,这里以前面提到过的示例通信域名 “data.example.com” 来做演示
|
||||
进入后台管理面板,转到“设置”页,在“未接入CDN的面板服务器域名/IP”项中填入通信域名,然后点击"保存"
|
||||
### Preparation
|
||||
First of all, you need to set up the communication domain name in the settings page of the admin panel, this domain name can not connect to the CDN, here is the sample communication domain name "data.example.com" mentioned earlier for demonstration
|
||||
Enter the administration panel, go to the "Settings" page, in the item "CDN Bypassed Domain/IP
|
||||
", fill in the communication domain name, and then click "Save"
|
||||
<br/>
|
||||
### Linux一键安装
|
||||
---
|
||||
* 首先在管理面板中添加一台服务器
|
||||
* 点击新添加的服务器旁,绿色的Linux图标按钮,复制一键安装命令
|
||||
* 在被控端服务器中运行复制的一键安装命令,等待安装完成后返回到Dashboard主页查看服务器是否上线
|
||||
### One-click installation on Linux
|
||||
* First add a server in the admin panel
|
||||
* Click on the green Linux icon button next to the newly added server and copy the one-click installation command
|
||||
* Run the copied one-click installation command on the monitored server, wait for the installation to complete, and then return to the Dashboard home page to see if the server is online.
|
||||
<br/>
|
||||
### Windows一键安装
|
||||
---
|
||||
* 首先在管理面板中添加一台服务器
|
||||
* 点击新添加的服务器旁,绿色的Windows图标按钮,复制一键安装命令
|
||||
* 进入Windows服务器,运行PowerShell,在PowerShell中运行复制的安装命令
|
||||
* 如遇到确认「执行策略变更」请选择 Y
|
||||
* 等待安装完成后返回Dashboard主页查看服务器是否上线
|
||||
### One-click installation on Windows
|
||||
* First add a server in the admin panel
|
||||
* Click on the green Linux icon button next to the newly added server and copy the one-click installation command
|
||||
* Login to Windows Server, open PowerShell, and run the copied installation command in PowerShell
|
||||
* If you encounter the prompt "Implement Policy Change" please select Y
|
||||
* Wait for the installation to complete and return to the Dashboard home page to see if the server is online
|
||||
<br/>
|
||||
<br/>
|
||||
## 其他方式安装Agent
|
||||
---
|
||||
## Other ways to install Agent
|
||||
<br/>
|
||||
|
||||
### Linux安装Agent
|
||||
---
|
||||
* 首先在管理面板中添加一台服务器
|
||||
* 在被控服务器中,运行脚本(位于中国大陆的服务器请使用镜像):
|
||||
### Installing Agent on Linux
|
||||
* First add a server in the admin panel
|
||||
* In the monitored server, run the script:
|
||||
```bash
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
```
|
||||
* 选择“安装监控Agent”
|
||||
* 输入通信域名,如:”data.example.com“
|
||||
* 输入面板通信端口,默认为5555
|
||||
* 输入Agent密钥,Agent密钥在管理面板中添加服务器时生成,可以在管理面板中的“主机”页中找到
|
||||
* 等待安装完成后返回Dashboard主页查看服务器是否上线
|
||||
* Select “Install_agent”
|
||||
* Input the communication domain name, e.g. "data.example.com"
|
||||
* Input RPC port, default is 5555
|
||||
* Input the Agent Secret, which is generated when adding a server in the administration panel and can be found in the " Servers " page of the administration panel
|
||||
* Wait for the installation to complete and return to the Dashboard home page to see if the server is online
|
||||
<br/>
|
||||
|
||||
### Windows安装Agent
|
||||
---
|
||||
- 请参考社区文章:
|
||||
[哪吒探针 - Windows 客户端安装](https://nyko.me/2020/12/13/nezha-windows-client.html)
|
||||
### Installing Agent on Windows
|
||||
- Please refer to the community article:
|
||||
[哪吒探针 - Windows 客户端安装](https://nyko.me/2020/12/13/nezha-windows-client.html)(Chinese)
|
||||
<br/>
|
||||
|
||||
### OpenWRT安装Agent
|
||||
---
|
||||
**如何使 旧版OpenWRT/LEDE 自启动**
|
||||
- 请参考项目:
|
||||
[哪吒监控 For OpenWRT](https://github.com/Erope/openwrt_nezha)
|
||||
### Installing Agent on OpenWRT
|
||||
|
||||
**How to make the old version of OpenWRT/LEDE self-boot?**
|
||||
- Please refer to the project:
|
||||
[哪吒监控 For OpenWRT](https://github.com/Erope/openwrt_nezha) (Chinese)
|
||||
<br/>
|
||||
|
||||
**如何使 新版OpenWRT 自启动?来自 @艾斯德斯**
|
||||
* 首先在 release 下载对应的二进制解压 zip 包后放置到 `/root`
|
||||
* 运行 `chmod +x /root/nezha-agent` 赋予执行权限,然后创建 `/etc/init.d/nezha-service`:
|
||||
**How to make the new version of OpenWRT self-boot? By @艾斯德斯**
|
||||
* First download the corresponding binary from the release, unzip the zip package and place it in `/root`
|
||||
* Then run `chmod +x /root/nezha-agent` to give it execute access, create file `/etc/init.d/nezha-service`:
|
||||
|
||||
```shell
|
||||
#!/bin/sh /etc/rc.common
|
||||
@ -67,7 +61,7 @@ USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command /root/nezha-agent -s 面板通信地址:端口 -p 秘钥 -d
|
||||
procd_set_param command /root/nezha-agent -s data.example.com:5555 -p secreat -d
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@ -83,24 +77,24 @@ restart() {
|
||||
}
|
||||
```
|
||||
|
||||
* 运行 `chmod +x /etc/init.d/nezha-service` 赋予执行权限
|
||||
* 启动服务: `/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start`
|
||||
* Give it permission to execute: `chmod +x /etc/init.d/nezha-service`
|
||||
* Start the service `/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start`
|
||||
<br/>
|
||||
<br/>
|
||||
## 自定义Agent监控项目
|
||||
---
|
||||
#### 自定义监控的网卡和硬盘分区
|
||||
|
||||
* 执行 `/opt/nezha/agent/nezha-agent --edit-agent-config` 来选择自定义的网卡和分区,然后重启 Agent 即可生效
|
||||
## Customize Agent
|
||||
|
||||
#### 其他运行参数
|
||||
#### Customize the NIC and hard drive partitions to be monitored
|
||||
|
||||
通过执行 `./nezha-agent --help` 查看支持的参数,如果你使用了一键脚本安装Agent,可以编辑 `/etc/systemd/system/nezha-agent.service`,在 `ExecStart=` 这一行的末尾加上以下参数
|
||||
* Run `/opt/nezha/agent/nezha-agent --edit-agent-config` to select a custom NIC and partition, and then restart Agent
|
||||
|
||||
- `--report-delay` 控制系统信息上报的间隔,默认为 1 秒,可以设置为 3 来进一步降低 agent 端系统资源占用(配置区间 1-4)
|
||||
- `--skip-conn` 不监控连接数,推荐 机场/连接密集型服务器或CPU占用较高的服务器设置
|
||||
- `--skip-procs` 不监控进程数,也可以降低 agent 占用
|
||||
- `--disable-auto-update` 禁止 **自动更新** Agent(安全特性)
|
||||
- `--disable-force-update` 禁止 **强制更新** Agent(安全特性)
|
||||
- `--disable-command-execute` 禁止在 Agent 上执行定时任务、打开在线终端(安全特性)
|
||||
- `--tls` 启用 SSL/TLS 加密(使用 nginx 反向代理 Agent 的 grpc 连接,并且 nginx 开启 SSL/TLS 时,需要启用该项配置)
|
||||
#### Other Flags
|
||||
|
||||
Run `./nezha-agent --help` to view supported flags,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, 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)
|
@ -1,65 +1,57 @@
|
||||
### Preparations
|
||||
----
|
||||
搭建一个哪吒监控,你需要:
|
||||
1. 一台可以连接公网的VPS,防火墙和安全策略需要放行8008和5555端口,否则会无法访问和无法接收数据。单核512MB内存的服务器配置就足以满足大多数使用场景
|
||||
2. 一个已经设置好A记录,指向Dashboard服务器ip的域名
|
||||
## Preparations
|
||||
To setup a Nezha monitorning Dashboard, you need these things:
|
||||
1. A VPS that can connect to the Internet, firewall and security policies need to open ports 8008 and 5555, otherwise it will be inaccessible and unable to receive data. A 1 core 512MB RAM server is sufficient for most usage scenarios
|
||||
2. A domain name that has been set up with an A record that resolves to the Dashboard server IP
|
||||
::: tip
|
||||
如果你想使用CDN,请准备两个域名,一个配置好CDN用作公开访问,CDN需要支持WebSocket协议;另一个域名不要使用CDN,用作Agent端与Dashboard的通信
|
||||
本文档分别以 "cdn.example.com" 和 "data.example.com" 两个域名来演示
|
||||
If you want to use CDN, please prepare two domains, one connect to CDN for public access, CDN needs to support WebSocket protocol; the other domain should not connect to CDN, use it as Agent to send data to Dashboard.
|
||||
This document uses "cdn.example.com" and "data.example.com" domains to demonstrate respectively
|
||||
:::
|
||||
3. 一个Github/Gitee账号
|
||||
3. A Github account
|
||||
|
||||
**本文档将以宝塔面板反代面板的过程作为范例,随着未来版本的变化,部分功能的入口可能会发生改变,本文档仅供参考**
|
||||
**This document will use the aaPanel as an example, with future versions of the changes, some of the features may change, this document is for reference only**
|
||||
<br/>
|
||||
<br/>
|
||||
### 获取Github的Client ID和密钥
|
||||
----
|
||||
哪吒监控接入Github和Gitee作为后台管理员账号
|
||||
+ 首先我们需要新建一个验证应用,以Github为例,登陆Github后,打开 https://github.com/settings/developers ,依次选择“OAuth Apps” - “New OAuth App”
|
||||
`Application name` - 随意填写
|
||||
`Homepage URL` - 填写面板的访问域名,如:"http://cdn.example.com"
|
||||
`Authorization callback URL` - 填写回调地址,如:"http://cdn.example.com/oauth2/callback"
|
||||
+ 点击“Register application”
|
||||
+ 保存页面中的Client ID,然后点击 “Generate a new client secret“,创建一个新的Client Secret,新建的密钥仅会显示一次,请妥善保存
|
||||
## Get the Client ID and Client Secret on Github
|
||||
Nezha Monitor uses a Github account as the login account for the admin panel
|
||||
+ First we need to create a new authentication application, after logging into Github, open https://github.com/settings/developers and select "OAuth Apps" - "New OAuth App "
|
||||
`Application name` - Fill in as you like
|
||||
`Homepage URL` - Fill in the panel's access domain name, such as: "http://cdn.example.com"
|
||||
`Authorization callback URL` - Fill in the callback address, e.g., "http://cdn.example.com/oauth2/callback"
|
||||
+ Click on "Registration Application"
|
||||
+ Remember the Client ID in the page, then click "Generate a new client secret" to create a new Client Secret, the new secret will be displayed only once, please save it properly
|
||||
<br/>
|
||||
<br/>
|
||||
### 在服务器中安装Dashboard
|
||||
---
|
||||
* 在面板服务器中,运行安装脚本:
|
||||
## Installing Dashboard on the server
|
||||
* In the panel server, run the installation script:
|
||||
```bash
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh
|
||||
```
|
||||
如果你的面板服务器位于中国大陆,可以使用镜像:
|
||||
````bash
|
||||
curl -L https://fastly.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo CN=true ./nezha.sh
|
||||
````
|
||||
|
||||
* 等待Docker安装完毕后,分别输入以下值:
|
||||
`OAuth提供商` - Github或Gitee
|
||||
`Client ID` - 之前保存的Client ID
|
||||
`Client Secret` - 之前保存的密钥
|
||||
`用户名` - Github或Gitee的用户名
|
||||
`站点标题` - 自定义站点标题
|
||||
`访问端口` - 公开访问端口,可自定义,默认8008
|
||||
`Agent的通信端口` - Agent与Dashboard的通信端口,默认5555
|
||||
* After waiting for the Docker installation to complete, input the following settings:
|
||||
`OAuth2 provider` - Github
|
||||
`Client ID` - Previously saved Client ID
|
||||
`Client Secret` - Previously saved secret
|
||||
`GitHub/Gitee login name` - Github username
|
||||
`Site title` - Custom site title
|
||||
`Site access port` - Public access port, customizable, default 8008
|
||||
`RPC port` - The communication port between Agent and Dashboard, default 5555
|
||||
|
||||
* 输入完成后,等待拉取镜像
|
||||
安装结束后,如果一切正常,此时你可以访问域名+端口号,如 “http://cdn.example.com:8008” 来查看面板
|
||||
* After the input is complete, wait to pull the mirror
|
||||
After the installation, if everything is fine, you can visit the domain + port number, such as "http://cdn.example.com:8008" to view the Dashboard
|
||||
|
||||
* 将来如果需要再次运行脚本,可以运行:
|
||||
* In the future, if you need to run the script again, you can run:
|
||||
```bash
|
||||
./nezha.sh
|
||||
```
|
||||
来打开管理脚本
|
||||
to open the management script
|
||||
<br/>
|
||||
<br/>
|
||||
### 配置反向代理
|
||||
---
|
||||
* 在宝塔面板中新建一个站点,域名填写公开访问域名,如 “http://cdn.example.com“ ,然后点击“设置”进入站点设置选项,选择“反向代理” - “新建反向代理”
|
||||
## Configure reverse proxy
|
||||
* Create a new site in the aaPanel, fill in the public access domain name, such as "http://cdn.example.com", then click "Settings" to enter the site settings option, select " Reverse proxy" - "New reverse proxy"
|
||||
|
||||
* 自定义一个代理名称,在下方“目标URL”中填入 `http://127.0.0.1` 然后点击“保存”
|
||||
* Customize a proxy name, fill in `http://127.0.0.1` in the "Target URL" and click "Save"
|
||||
|
||||
* 打开刚刚新建的反向代理右边的“配置文件”,将配置文件替换为以下内容:
|
||||
* Open the " configuration" to the right of the new reverse proxy you just created and replace the configuration file with the following:
|
||||
````nginx
|
||||
#PROXY-START/
|
||||
location / {
|
||||
@ -76,13 +68,13 @@ location ~ ^/(ws|terminal/.+)$ {
|
||||
}
|
||||
#PROXY-END/
|
||||
````
|
||||
* 点击“保存”
|
||||
现在,你应该可以直接使用域名,如:“http://cdn.example.com“ 来访问面板了
|
||||
* Click "Save"
|
||||
Now, you should be able to access the panel directly using a domain name such as: "http://cdn.example.com"
|
||||
<br/>
|
||||
#### 扩展内容:
|
||||
#### Other:
|
||||
|
||||
|
||||
* CaddyServer v1(v2 无需特别配置)
|
||||
* CaddyServer v1(v2 no special configuration required)
|
||||
|
||||
```
|
||||
proxy /ws http://ip:8008 {
|
||||
@ -96,8 +88,7 @@ location ~ ^/(ws|terminal/.+)$ {
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
### 在宝塔面板中配置SSL
|
||||
---
|
||||
首先,先暂时关闭反向代理
|
||||
正如在其他网站中配置SSL证书一样,进入站点设置中的“SSL”,你可以选择自动申请 Let´s Encrypt 证书或手动配置已有的证书
|
||||
完成SSL的设置后,你需要回到 https://github.com/settings/developers ,编辑之前创建的验证应用程序,将之前我们填入的"Homepage URL"和"Authorization callback URL"中的域名全部从`http`改为`https`,如:"https://cdn.example.com" 和 "https://cdn.example.com/oauth2/callback" ,**不更改此项可能会导致你无法登陆面板后台**
|
||||
## Configuring SSL in the aaPanel
|
||||
First, temporarily disable the reverse proxy
|
||||
As with other websites, you can choose to automatically apply for a Let´s Encrypt certificate or manually configure an existing certificate by going to "SSL" in the site settings
|
||||
After you finish setting up SSL, you need to go back to https://github.com/settings/developers and edit the authentication application you created before, change all the domain names in the "Homepage URL" and "Authorization callback URL" you filled in before from `http` to `https`, such as: "https://cdn.example.com" and "https://cdn.example.com/oauth2/callback", **If you don't change these links, you may not be able to log into the admin panel**
|
@ -2,7 +2,7 @@
|
||||
<br/>
|
||||
## 一键安装Agent
|
||||
|
||||
目前哪吒监控已支持在WIndows和Linux上一键安装Agent,遵循本文档的步骤,你可以很轻松的在服务器上部署它
|
||||
目前哪吒监控已支持在Windows和Linux上一键安装Agent,遵循本文档的步骤,你可以很轻松的在服务器上部署它
|
||||
<br/>
|
||||
### 准备工作
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user