commit
6bab66f3de
@ -67,12 +67,6 @@ export default defineConfig({
|
||||
|
||||
function getGuideSidebarZhCN() {
|
||||
return [
|
||||
{
|
||||
text: '哪吒监控',
|
||||
children: [
|
||||
{ text: '介绍', link: '/' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: '安装手册',
|
||||
children: [
|
||||
@ -94,10 +88,11 @@ function getGuideSidebarZhCN() {
|
||||
text: '常见问题',
|
||||
children: [
|
||||
{ text: 'TG api被墙', link: '/guide/q1' },
|
||||
{ text: '问题2', link: '/guide/q2' },
|
||||
{ text: '问题3', link: '/guide/q3' },
|
||||
{ text: '问题4', link: '/guide/q4' },
|
||||
{ text: '问题5', link: '/guide/q5' }
|
||||
{ text: 'Agent 启动/上线 问题自检流程', link: '/guide/q2' },
|
||||
{ text: '如何反向代理 gRPC 端口', link: '/guide/q3' },
|
||||
{ text: '实时通道断开/在线终端连接失败', link: '/guide/q4' },
|
||||
{ text: '如何进行数据迁移、备份恢复?', link: '/guide/q5' }
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -122,12 +117,6 @@ function getDeveloperSidebarZhCN() {
|
||||
|
||||
function getGuideSidebarEnUS() {
|
||||
return [
|
||||
{
|
||||
text: 'Nezha Monitoring',
|
||||
children: [
|
||||
{ text: 'Introduction', link: '/en_US/' }
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Installation Manual',
|
||||
children: [
|
||||
@ -148,11 +137,10 @@ function getGuideSidebarEnUS() {
|
||||
{
|
||||
text: 'FAQ',
|
||||
children: [
|
||||
{ text: 'Q1', link: '/en_US/guide/q1' },
|
||||
{ text: 'Q2', link: '/en_US/guide/q2' },
|
||||
{ text: 'Q3', link: '/en_US/guide/q3' },
|
||||
{ text: 'Q4', link: '/en_US/guide/q4' },
|
||||
{ text: 'Q5', link: '/en_US/guide/q5' }
|
||||
{ text: 'Let the Agent start/on-line, and the self-test process of the problem', link: '/en_US/guide/q2' },
|
||||
{ text: 'Reverse Proxy gRPC Port (support Cloudflare CDN)', link: '/en_US/guide/q3' },
|
||||
{ text: 'Real-time channel disconnection/online terminal connection failure', link: '/en_US/guide/q4' },
|
||||
{ text: 'How do I migrate my data to the new server and restore my backups?', link: '/en_US/guide/q5' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -1 +0,0 @@
|
||||
q1
|
@ -24,12 +24,9 @@
|
||||
* 等待安装完成后返回Dashboard主页查看服务器是否上线
|
||||
<br/>
|
||||
<br/>
|
||||
## 其他方式安装Agent
|
||||
|
||||
<br/>
|
||||
|
||||
## 其他方式安装Agent
|
||||
### Linux安装Agent
|
||||
---
|
||||
|
||||
* 首先在管理面板中添加一台服务器
|
||||
* 在被控服务器中,运行脚本(位于中国大陆的服务器请使用镜像):
|
||||
```bash
|
||||
@ -38,7 +35,7 @@ curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh
|
||||
```
|
||||
* 选择“安装监控Agent”
|
||||
* 输入通信域名,如:”data.example.com“
|
||||
* 输入面板通信端口,默认为5555
|
||||
* 输入面板通信端口(RPC端口),默认为5555
|
||||
* 输入Agent密钥,Agent密钥在管理面板中添加服务器时生成,可以在管理面板中的“主机”页中找到
|
||||
* 等待安装完成后返回Dashboard主页查看服务器是否上线
|
||||
<br/>
|
||||
@ -89,7 +86,7 @@ restart() {
|
||||
<br/>
|
||||
<br/>
|
||||
## 自定义Agent监控项目
|
||||
---
|
||||
|
||||
#### 自定义监控的网卡和硬盘分区
|
||||
|
||||
* 执行 `/opt/nezha/agent/nezha-agent --edit-agent-config` 来选择自定义的网卡和分区,然后重启 Agent 即可生效
|
||||
|
@ -1 +1,95 @@
|
||||
# 通知
|
||||
哪吒监控支持对服务器的负载、CPU、内存、硬盘、带宽、流量、月流量、进程数、连接数进行监控,并在其中某项达到用户设定值时发送报警通知
|
||||
<br/>
|
||||
<br/>
|
||||
## 灵活的通知方式
|
||||
`#NEZHA#` 是面板消息占位符,面板触发通知时会自动用实际消息替换占位符
|
||||
|
||||
Body 内容是`JSON` 格式的:**当请求类型为 FORM 时**,值为 `key:value` 的形式,`value` 里面可放置占位符,通知时会自动替换。**当请求类型为 JSON 时** 只会简单进行字符串替换后直接提交到`URL`。
|
||||
|
||||
URL 里面也可放置占位符,请求时会进行简单的字符串替换。
|
||||
|
||||
你可以参考以下的通知方式示例,也可以根据自己的需求灵活设置推送方式
|
||||
|
||||
- server酱示例
|
||||
|
||||
- 名称:server 酱
|
||||
- URL:https://sc.ftqq.com/SCUrandomkeys.send?text=#NEZHA#
|
||||
- 请求方式: GET
|
||||
- 请求类型: 默认
|
||||
- Body: 空
|
||||
|
||||
- wxpusher 示例,需要关注你的应用
|
||||
|
||||
- 名称: wxpusher
|
||||
- URL:http://wxpusher.zjiecode.com/api/send/message
|
||||
- 请求方式: POST
|
||||
- 请求类型: JSON
|
||||
- Body: `{"appToken":"你的appToken","topicIds":[],"content":"#NEZHA#","contentType":"1","uids":["你的uid"]}`
|
||||
|
||||
- Telegram 示例 [@haitau](https://github.com/haitau) 贡献
|
||||
|
||||
- 名称:telegram 机器人消息通知
|
||||
- URL:https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NEZHA#
|
||||
- 请求方式: GET
|
||||
- 请求类型: 默认
|
||||
- Body: 空
|
||||
- URL 参数获取说明:botXXXXXX 中的 XXXXXX 是在 telegram 中关注官方 @Botfather ,输入/newbot ,创建新的机器人(bot)时,会提供的 token(在提示 Use this token to access the HTTP API:后面一行)这里 'bot' 三个字母不可少。创建 bot 后,需要先在 telegram 中与 BOT 进行对话(随便发个消息),然后才可用 API 发送消息。YYYYYY 是 telegram 用户的数字 ID。与机器人@userinfobot 对话可获得。
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
## 报警规则说明
|
||||
|
||||
### 基本规则
|
||||
|
||||
- type:可选取一个或多个类型,如在一个规则中选择了多个类型,需要**同时满足**所有选择的类型才会触发通知(可参考后面的示例)
|
||||
- `cpu`、`memory`、`swap`、`disk`
|
||||
- `net_in_speed` 入站网速、`net_out_speed` 出站网速、`net_all_speed` 双向网速、`transfer_in` 入站流量、`transfer_out` 出站流量、`transfer_all` 双向流量
|
||||
- `offline` 离线监控
|
||||
- `load1`、`load5`、`load15` 负载
|
||||
- `process_count` 进程数 _目前取线程数占用资源太多,暂时不支持_
|
||||
- `tcp_conn_count`、`udp_conn_count` 连接数
|
||||
- duration:持续数秒,数秒内采样记录 30% 以上触发阈值才会报警(防数据插针)
|
||||
- min 或 max:
|
||||
- 流量、网速类数值 为字节(1KB=1024B,1MB = 1024\*1024B)
|
||||
- 内存、硬盘、CPU 以占用百分比计数
|
||||
- 离线监控无需设置此项
|
||||
- cover:
|
||||
- `0` 监控所有,通过 `ignore` 忽略特定服务器
|
||||
- `1` 忽略所有,通过 `ignore` 监控特定服务器
|
||||
例如:`[{"type":"offline","duration":10, "cover":0, "ignore":{"5": true}}]`
|
||||
- ignore: 选择忽略特定服务器,搭配 `cover` 使用,内容为服务器id和布尔值,例如:`{"1": true, "2":false}`
|
||||
|
||||
**完整示例:**
|
||||
:::tip
|
||||
添加一个离线报警
|
||||
|
||||
- 名称:离线通知
|
||||
- 规则:`[{"Type":"offline","Duration":10}]`
|
||||
- 启用:√
|
||||
:::
|
||||
|
||||
:::tip
|
||||
添加一个监控 CPU 持续 10s 超过 50% **且** 内存持续 20s 占用低于 20% 的报警
|
||||
|
||||
- 名称:CPU+内存
|
||||
- 规则:`[{"Type":"cpu","Min":0,"Max":50,"Duration":10},{"Type":"memory","Min":20,"Max":0,"Duration":20}]`
|
||||
- 启用:√
|
||||
:::
|
||||
<br/>
|
||||
|
||||
### 特殊:任意周期流量报警
|
||||
|
||||
可以用作月流量报警
|
||||
|
||||
- type:
|
||||
- `transfer_in_cycle` 周期内的入站流量
|
||||
- `transfer_out_cycle` 周期内的出站流量
|
||||
- `transfer_all_cycle` 周期内双向流量和
|
||||
- cycle_start: 统计周期开始日期(可以是你机器计费周期的开始日期),时间格式为RFC3339,例如北京时间为`2022-01-11T08:00:00.00+08:00`
|
||||
- cycle_interval:每隔多少个周期单位(例如,周期单位为天,该值为 7,则代表每隔 7 天统计一次)
|
||||
- cycle_unit 统计周期单位,默认`hour`,可选(`hour`, `day`, `week`, `month`, `year`)
|
||||
- min/max、cover、ignore 参考基本规则配置
|
||||
|
||||
示例: ID 为 3 的服务器(ignore 里面定义),以每月 15 号为统计周期,周期内统计的出站月流量达到 1TB 时报警 `[{"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}}]`
|
||||

|
@ -3,10 +3,10 @@
|
||||
搭建一个TGbot api反代,你需要:
|
||||
1.一个不受GFW封锁的服务器(且安装好nginx)
|
||||
2.一个域名(提前申请SSL证书)
|
||||
</br>
|
||||
<br/>
|
||||
## NGINX配置
|
||||
编辑你nginx的配置文件,在http{}中加上如下配置
|
||||
```
|
||||
```nginx
|
||||
# http强制跳转到htpps
|
||||
server {
|
||||
listen 80;
|
||||
@ -52,10 +52,10 @@ server {
|
||||
`yourDomainName`-你准备的域名
|
||||
`ssl_certificate`-SSL证书路径
|
||||
`ssl_certificate_key`-SSL证书路径
|
||||
</br>
|
||||
<br/>
|
||||
## 使用方式
|
||||
:tada:然后执行`systemctl restart nginx`回到nezha将原来的https://api.telegram.org/ 替换为https://yourDomainName/ ,即可正常推送消息
|
||||
</br>
|
||||
<br/>
|
||||
## 防止盗用
|
||||
`serverIp`-你监控鸡的ip地址,你系统安装的那个就用那个命令,ufw iptables都可.
|
||||
```bash
|
||||
|
@ -1 +1,4 @@
|
||||
# 问题2
|
||||
#### Agent 启动/上线 问题自检流程
|
||||
1. 直接执行 `/opt/nezha/agent/nezha-agent -s 面板IP或非CDN域名:面板RPC端口 -p Agent密钥 -d` 查看日志是否是因为 DNS、网络不佳导致超时(timeout)
|
||||
2. `nc -v 域名/IP 面板RPC端口` 或者 `telnet 域名/IP 面板RPC端口` 来检验是否是网络问题,检查本机与面板服务器的出入站防火墙,如果无法判断问题可借助 <https://port.ping.pe/> 提供的端口检查工具进行检测。
|
||||
3. 如果上面步骤检测正常,Agent 正常上线,尝试关闭 SELinux,[如何关闭 SELinux?](https://www.google.com/search?q=%E5%85%B3%E9%97%ADSELINUX)
|
@ -1 +1,52 @@
|
||||
# 问题3
|
||||
#### 反向代理 gRPC 端口(支持 Cloudflare CDN)
|
||||
使用 Nginx 或者 Caddy 反向代理 gRPC
|
||||
|
||||
- Nginx 配置
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
server_name data.example.com; # 你的 Agent 连接 Dashboard 的域名
|
||||
|
||||
ssl_certificate /data/letsencrypt/fullchain.pem; # 你的域名证书路径
|
||||
ssl_certificate_key /data/letsencrypt/key.pem; # 你的域名私钥路径
|
||||
|
||||
underscores_in_headers on;
|
||||
|
||||
location / {
|
||||
grpc_read_timeout 300s;
|
||||
grpc_send_timeout 300s;
|
||||
grpc_pass grpc://localhost:5555;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- Caddy 配置
|
||||
|
||||
```
|
||||
data.example.com:443 { # 你的 Agent 连接 Dashboard 的域名
|
||||
reverse_proxy {
|
||||
to localhost:5555
|
||||
transport http {
|
||||
versions h2c 2
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Dashboard 面板端配置
|
||||
|
||||
- 首先登录面板进入管理后台 打开设置页面,在 `未接入CDN的面板服务器域名/IP` 中填入上一步在 Nginx 或 Caddy 中配置的域名 比如 `data.example.com` ,并保存。
|
||||
- 然后在面板服务器中,打开 /opt/nezha/dashboard/data/config.yaml 文件,将 `proxygrpcport` 修改为 Nginx 或 Caddy 监听的端口,比如上一步设置的 `443` ;因为我们在 Nginx 或 Caddy 中开启了 SSL/TLS,所以需要将 `tls` 设置为 `true` ;修改完成后重启面板。
|
||||
|
||||
Agent 端配置
|
||||
|
||||
- 登录面板管理后台,复制一键安装命令,在对应的服务器上面执行一键安装命令重新安装 agent 端即可。
|
||||
|
||||
开启 Cloudflare CDN(可选)
|
||||
|
||||
根据 Cloudflare gRPC 的要求:gRPC 服务必须侦听 443 端口 且必须支持 TLS 和 HTTP/2。
|
||||
所以如果需要开启 CDN,必须在配置 Nginx 或者 Caddy 反向代理 gRPC 时使用 443 端口,并配置证书(Caddy 会自动申请并配置证书)。
|
||||
|
||||
- 登录 Cloudflare,选择使用的域名。打开 `网络` 选项将 `gRPC` 开关打开,打开 `DNS` 选项,找到 Nginx 或 Caddy 反代 gRPC 配置的域名的解析记录,打开橙色云启用 CDN。
|
||||
|
@ -1 +1,3 @@
|
||||
# 问题4
|
||||
#### 实时通道断开/在线终端连接失败
|
||||
+ 如果你使用了CDN,请确认CDN服务商提供WebSocket服务,并且已开启WebSocket
|
||||
+ 确认你的反代规则中针对 /ws,/terminal 路径的 WebSocket 进行了特别配置,你可以 [点击这里](/guide/dashboard.html#配置反向代理) 查看反向代理配置
|
@ -1 +1,5 @@
|
||||
# 问题5
|
||||
#### 如何进行数据迁移、备份恢复?
|
||||
|
||||
1. 先运行一键脚本,选择 `停止面板`
|
||||
2. 在旧服务器中打包 `/opt/nezha` 文件夹,复制到新环境相同位置解压
|
||||
3. 在新环境中运行一键脚本,选择 `启动面板`
|
@ -1 +1,3 @@
|
||||
# 服务
|
||||
服务监控:HTTP、SSL证书、ping、TCP 端口等
|
||||
|
||||
进入 `/服务` 页面点击新建监控即可,表单下面有相关说明。
|
@ -1 +1,81 @@
|
||||
# 设置
|
||||
## 多语言
|
||||
哪吒监控目前支持以下语言:
|
||||
|
||||
+ 简体中文
|
||||
+ English
|
||||
+ Español
|
||||
|
||||
[](https://crowdin.com/project/nezha)
|
||||
我们欢迎您贡献更多语言
|
||||
<br/>
|
||||
|
||||
## 自定义代码
|
||||
改LOGO、改色调、加统计代码等。
|
||||
|
||||
:::warning
|
||||
自定义代码仅在游客首页生效。
|
||||
:::
|
||||
<br/>
|
||||
|
||||
#### 默认主题更改进度条颜色示例
|
||||
|
||||
```html
|
||||
<style>
|
||||
.ui.fine.progress> .bar {
|
||||
background-color: pink !important;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
#### DayNight 主题更改进度条颜色、修改页脚示例(来自 [@hyt-allen-xu](https://github.com/hyt-allen-xu))
|
||||
|
||||
```html
|
||||
<style>
|
||||
.ui.fine.progress> .progress-bar {
|
||||
background-color: #00a7d0 !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var footer=document.querySelector("div.footer-container")
|
||||
footer.innerHTML="©2021 你的名字 & Powered by 你的名字"
|
||||
footer.style.visibility="visible"
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
#### 默认主题修改 LOGO、修改页脚示例(来自 [@iLay1678](https://github.com/iLay1678))
|
||||
|
||||
```html
|
||||
<style>
|
||||
.right.menu>a{
|
||||
visibility: hidden;
|
||||
}
|
||||
.footer .is-size-7{
|
||||
visibility: hidden;
|
||||
}
|
||||
.item img{
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var avatar=document.querySelector(".item img")
|
||||
var footer=document.querySelector("div.is-size-7")
|
||||
footer.innerHTML="Powered by 你的名字"
|
||||
footer.style.visibility="visible"
|
||||
avatar.src="你的方形logo地址"
|
||||
avatar.style.visibility="visible"
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
||||
#### hotaru 主题更改背景图片示例
|
||||
|
||||
```html
|
||||
<style>
|
||||
.hotaru-cover {
|
||||
background: url(https://s3.ax1x.com/2020/12/08/DzHv6A.jpg) center;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
@ -1 +1,3 @@
|
||||
# 任务
|
||||
计划任务:备份脚本、服务重启,等定期运维任务。
|
||||
|
||||
使用此功能可以定期结合 restic、rclone 给服务器备份,或者定期重启某项服务来重置网络连接。
|
@ -2,7 +2,7 @@
|
||||
home: true
|
||||
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
|
||||
heroText: 哪吒监控
|
||||
tagline: 一个开源的轻量服务器和网站监控、运维工具
|
||||
tagline: 一个开源、轻量的服务器和网站监控、运维工具
|
||||
actionText: 开始使用 →
|
||||
actionLink: /guide/dashboard
|
||||
features:
|
||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -1841,6 +1841,12 @@
|
||||
"vue": "^3.2.33"
|
||||
}
|
||||
},
|
||||
"vitepress-dark-theme": {
|
||||
"version": "git+ssh://git@github.com/nezhahq/vitepress-dark-theme.git#52550f5807214d139b7219a72b66b0bd9031b078",
|
||||
"dev": true,
|
||||
"from": "vitepress-dark-theme@github:nezhahq/vitepress-dark-theme",
|
||||
"requires": {}
|
||||
},
|
||||
"vue": {
|
||||
"version": "3.2.33",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.2.33.tgz",
|
||||
|
Loading…
x
Reference in New Issue
Block a user