哪吒监控的Dashboard已经添加本地化,支持多个语言,你可以在开发新功能时遵循以下步骤来支持本地化
WARNING
哪吒监控使用 Crowdin 平台翻译文本,请不要直接修改除 zh-CN.toml
以外的toml文件
介绍
- 你可以直接使用
/resource/l10n/zh-CN.toml
中的配置来替换新功能中的文本 - 如果新功能中有新的文本,请将新文本拉取到
zh-CN.toml
中 - 在Pull Request被合并后,你可以前往 Crowdin 平台贡献新文本的翻译
diff --git a/assets/guide_loginq.md.25aade1d.js b/assets/guide_loginq.md.9e45095c.js similarity index 84% rename from assets/guide_loginq.md.25aade1d.js rename to assets/guide_loginq.md.9e45095c.js index ba6848ce..c302a2c5 100644 --- a/assets/guide_loginq.md.25aade1d.js +++ b/assets/guide_loginq.md.9e45095c.js @@ -1 +1 @@ -import{_ as t,c as e,o as a,d as i}from"./app.c59cf861.js";const f='{"title":"\u767B\u9646\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u767B\u9646\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","slug":"\u767B\u9646\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F-\u62D2\u7EDD\u8FDE\u63A5-\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F"},{"level":3,"title":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F","slug":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F"}],"relativePath":"guide/loginq.md"}',s={},o=i('
\u8FD8\u6709\u5176\u4ED6\u4E00\u4E9B\u8868\u73B0\u5F62\u5F0F\uFF0C\u603B\u4E4B\u767B\u9646\u540E\u6D4F\u89C8\u5668\u65E0\u6CD5\u6B63\u5E38\u663E\u793A\u3002
TIP
\u4EC0\u4E48\u662F\u534F\u8BAE\uFF1F\u5728\u6D4F\u89C8\u5668\u4E2D\uFF0C\u60A8\u7684\u57DF\u540D\u4EE5://\u7ED3\u5C3E\u7684\u5B57\u7B26\u4E32\u5373\u4E3A\u534F\u8BAE\uFF0C\u901A\u5E38\u4E3Ahttp\u548Chttps\u4E24\u79CD\u3002\u7531\u4E8E\u6B63\u5E38\u90E8\u7F72\u60C5\u51B5\u4E0B\u9762\u677F\u53EF\u80FD\u6709\u591A\u79CD\u534F\u8BAE+\u57DF\u540D+\u7AEF\u53E3\u7EC4\u5408\u5747\u53EF\u8BBF\u95EE\uFF0C\u8BF7\u52A1\u5FC5\u9009\u4E00\u4E2A\u6700\u5408\u9002\u7684\u4F5C\u4E3A\u56DE\u8C03\u3002
\u8BF7\u786E\u4FDD\u767B\u5F55\u524D\u6D4F\u89C8\u5668\u663E\u793A\u7684\u534F\u8BAE+\u57DF\u540D+\u7AEF\u53E3\u548C\u767B\u9646\u540E\u8DF3\u8F6C\u5230\u7684\u534F\u8BAE+\u57DF\u540D+\u7AEF\u53E3\u4E00\u81F4\u3002
',6),l=[o];function r(c,_,d,n,h,p){return a(),e("div",null,l)}var g=t(s,[["render",r]]);export{f as __pageData,g as default}; +import{_ as t,c as e,o as a,d as i}from"./app.c59cf861.js";const f='{"title":"\u767B\u5F55\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u767B\u5F55\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","slug":"\u767B\u5F55\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F-\u62D2\u7EDD\u8FDE\u63A5-\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F"},{"level":3,"title":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F","slug":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F"}],"relativePath":"guide/loginq.md"}',s={},o=i('\u8FD8\u6709\u5176\u4ED6\u4E00\u4E9B\u8868\u73B0\u5F62\u5F0F\uFF0C\u603B\u4E4B\u767B\u5F55\u540E\u6D4F\u89C8\u5668\u65E0\u6CD5\u6B63\u5E38\u663E\u793A\u3002
TIP
\u4EC0\u4E48\u662F\u534F\u8BAE\uFF1F\u5728\u6D4F\u89C8\u5668\u4E2D\uFF0C\u60A8\u7684\u57DF\u540D\u4EE5://\u7ED3\u5C3E\u7684\u5B57\u7B26\u4E32\u5373\u4E3A\u534F\u8BAE\uFF0C\u901A\u5E38\u4E3Ahttp\u548Chttps\u4E24\u79CD\u3002\u7531\u4E8E\u6B63\u5E38\u90E8\u7F72\u60C5\u51B5\u4E0B\u9762\u677F\u53EF\u80FD\u6709\u591A\u79CD\u534F\u8BAE+\u57DF\u540D+\u7AEF\u53E3\u7EC4\u5408\u5747\u53EF\u8BBF\u95EE\uFF0C\u8BF7\u52A1\u5FC5\u9009\u4E00\u4E2A\u6700\u5408\u9002\u7684\u4F5C\u4E3A\u56DE\u8C03\u3002
\u8BF7\u786E\u4FDD\u767B\u5F55\u524D\u6D4F\u89C8\u5668\u663E\u793A\u7684\u534F\u8BAE+\u57DF\u540D+\u7AEF\u53E3\u548C\u767B\u5F55\u540E\u8DF3\u8F6C\u5230\u7684\u534F\u8BAE+\u57DF\u540D+\u7AEF\u53E3\u4E00\u81F4\u3002
',6),l=[o];function r(c,_,d,n,h,p){return a(),e("div",null,l)}var g=t(s,[["render",r]]);export{f as __pageData,g as default}; diff --git a/assets/guide_loginq.md.25aade1d.lean.js b/assets/guide_loginq.md.9e45095c.lean.js similarity index 78% rename from assets/guide_loginq.md.25aade1d.lean.js rename to assets/guide_loginq.md.9e45095c.lean.js index 453dfb8f..8972d81c 100644 --- a/assets/guide_loginq.md.25aade1d.lean.js +++ b/assets/guide_loginq.md.9e45095c.lean.js @@ -1 +1 @@ -import{_ as t,c as e,o as a,d as i}from"./app.c59cf861.js";const f='{"title":"\u767B\u9646\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u767B\u9646\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","slug":"\u767B\u9646\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F-\u62D2\u7EDD\u8FDE\u63A5-\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F"},{"level":3,"title":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F","slug":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F"}],"relativePath":"guide/loginq.md"}',s={},o=i("",6),l=[o];function r(c,_,d,n,h,p){return a(),e("div",null,l)}var g=t(s,[["render",r]]);export{f as __pageData,g as default}; +import{_ as t,c as e,o as a,d as i}from"./app.c59cf861.js";const f='{"title":"\u767B\u5F55\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","description":"","frontmatter":{},"headers":[{"level":2,"title":"\u767B\u5F55\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F\\\\\u62D2\u7EDD\u8FDE\u63A5\\\\\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F","slug":"\u767B\u5F55\u56DE\u8C03\u540E\u9875\u9762\u5361\u4F4F-\u62D2\u7EDD\u8FDE\u63A5-\u54CD\u5E94\u65F6\u95F4\u8FC7\u957F"},{"level":3,"title":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F","slug":"\u5982\u4F55\u68C0\u67E5\u6211\u7684\u56DE\u8C03\u5730\u5740\u662F\u5426\u9519\u8BEF\uFF1F"}],"relativePath":"guide/loginq.md"}',s={},o=i("",6),l=[o];function r(c,_,d,n,h,p){return a(),e("div",null,l)}var g=t(s,[["render",r]]);export{f as __pageData,g as default}; diff --git a/developer/index.html b/developer/index.html index f31b5fe1..641787cd 100644 --- a/developer/index.html +++ b/developer/index.html @@ -14,7 +14,7 @@哪吒监控的Dashboard已经添加本地化,支持多个语言,你可以在开发新功能时遵循以下步骤来支持本地化
WARNING
哪吒监控使用 Crowdin 平台翻译文本,请不要直接修改除 zh-CN.toml
以外的toml文件
/resource/l10n/zh-CN.toml
中的配置来替换新功能中的文本zh-CN.toml
中哪吒面板提供了主题开发环境,你可以使用它来创建新的哪吒监控主题
WARNING
请注意: 此开发环境仅支持 dashboard v0.13.16
及更新版本。
data/config.yaml
中的 Oauth2 配置(回调连接可以填 http://localhost
)docker-compose up
theme-custom
放置到服务器上的 /opt/nezha/dashboard/theme-custom
位置80
端口,在 docker-compose.yaml
中修改配置。Nezha Monitoring's Dashboard has added localization to support multiple languages, and you can follow these steps to support localization when developing new features
WARNING
Nezha uses the Crowdin platform to translate text, please do not directly modify the toml files other than zh-CN.toml
.
/resource/l10n/zh-CN.toml
zh-CN.toml
TIP
If you don't understand Chinese at all, you can translate the text using Google or DeepL Translate, and specify in the Pull Request, we will revise the Chinese translation after you add the English translation
Nezha Monitoring provides a theme development environment that you can use to create new Nezha Monitoring themes
WARNING
Please note: This development environment only supports dashboard v0.13.16
and newer versions.
data/config.yaml
(The callback connection can be filled with http://localhost
)docker-compose up
theme-custom
in /opt/nezha/dashboard/theme-custom
on the server80
, change the configuration in docker-compose.yaml
.chmod +x /etc/init.d/nezha-service
/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start
/opt/nezha/agent/nezha-agent --edit-agent-config
to select a custom NIC and partition, and then restart AgentRun ./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 WebShell (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)There is currently no Docker image for Agent.
The Agent is designed to be the opposite of the Dashboard, in that the Dashboard is designed to work without affecting the server as much as possible, while the Agent needs to execute monitoring services and run commands in the server.
Putting the Agent in a container does continue to execute monitoring services, but features such as WebShell do not work, so we do not provide Docker image of the Agent.
Nezha Monitoring supports monitoring of server load, CPU, memory, hard disk, bandwidth, data transfer, monthly data transfer, number of processes, number of connections, and sends alarm notifications when one of these items reaches a user-set limit.
#NEZHA#
is the panel message placeholder, the panel will automatically replace the placeholder with the actual message when it triggers the notification
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.
Placeholders can also be placed inside the URL, and it will perform a simple string substitution when requested.
Refer to the example below, it is very flexible.
Telegram Example, contributed by @haitau
cpu
、memory
、swap
、disk
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 Transferoffline
Offline monitoringload1
、load5
、load15
Loadprocess_count
Number of processes Currently, counting the number of processes takes up too many resources and is not supported at the momenttcp_conn_count
、udp_conn_count
Number of connections[{"type":"offline","duration":10, "cover":0, "ignore":{"5": true}}]
0
Cover all, use ignore
to ignore specific servers1
Ignore all, use ignore
to monitoring specific servers[{"type":"offline","duration":10, "cover":0, "ignore":{"5": true}}]
cover
with server id and boolean, e.g.: {"1": true, "2":false}
Complete examples:
TIP
Add an offline notification
[{"Type":"offline","Duration":10}]
TIP
Add an notification when the CPU exceeds 50% for 10s but the memory usage is below 20% for 20s
[{"Type":"cpu","Min":0,"Max":50,"Duration":10},{"Type":"memory","Min":20,"Max":0,"Duration":20}]
Can be used as monthly transfer notificatin
type
transfer_in_cycle
Inbound transfer during the cycletransfer_out_cycle
Outbound transfer during the cycletransfer_all_cycle
The sum of inbound and outbound transfer during the cyclecycle_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}}]
//opt/nezha/agent/nezha-agent -s IP/Domin(Panel IP or Domain not connected to CDN):port(Panel RPC port) -p secret(Agent Secret) -d
Check the logs to see if the timeout is due to a DNS problem or poor networknc -v domain/IP port(Panel RPC port)
or telnet domain/IP port(Panel RPC port)
to check if it' s a network problem, check the inbound and outbound firewall between the local machine and the panel server, if you can' t determine the problem you can check it with the port checking tool provided by https://port.ping.pe//ws
and /terminal
paths, you can click here to see the reverse proxy configurationStop Panel
/opt/nezha
folder to the same path as the new serverLaunch Panel
The Servers area is responsible for managing the Agent, the most basic area in Nezha Monitoring, and the basis for other functions.
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.
Please refer to the previous article: Install Agent
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.
The flags related to the update of the Agent are: --disable-auto-update
and --disable-force-update
. Please refer to 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.
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.
Note that in theWebShell function, the Agent also connects to the Domain names for public access via WebSocket, not via grpc.
Service area is a function setting area for setting up Agents to monitor external websites or servers
The monitoring results can be viewed on the "Services" page in the home page
To add a new monitor, you can go to the "Services" page in the administration panel and click "Add Service Monitor".
To add a service monitor, you need to complete the following settings:
Name
- Customize a name
Type
- Select a monitoring type. Nezha currently supports three monitoring types: "HTTP-GET", "ICMP-Ping" and "TCP-Ping".
Target
- Depending on the type you choose, the target is set in different ways
HTTP-GET
: Selecting this type, you should enter a URL as the target, the URL should be added withhttp://
orhttps://
If your target URL ishttps://
, it will also monitor the SSL certificate of that URL and trigger a notification when the SSL certificate expires or changes.
For example: https://example.com
ICMP-Ping
: When selecting this type, you should enter a domain name or IP without a port number
For example: 1.1.1.1 or example.com
TCP-Ping
: When selecting this type, you should enter a domain name or IP and include the port number
For example: 1.1.1.1:80 or example.com:22
Interval
: Sets the time interval in seconds between each time Agent sends requests to the target
Coverage
: Select a rule to determine which Agents to use to send requests to the target
Specific Servers
: Use with coverage to select the Agent to be excluded from the rule
Notification Group
: Select the notification method you have set up on the "Notification" page. Click here for more information
Enable Failure Notification
: Select whether to receive target failure notifications as needed, default is inactive
After setting, click "Add" and you are done.
Wait for a moment to go to the "Services" page on the home page to view the monitoring results
To manage existing service monitoring, you can go to the "Services" page in the administration panel
Select a monitoring configuration and click the icon on the right to edit or delete it
In the task area, you can set up scheduled tasks, periodic 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.
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
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
Notification Group
- Select the notification method you have set up on the "Notification" page. Click here for more information
Send Success Notification
- When this item is activated, a message notification will be triggered when the task is successfully executed
To manage existing scheduled tasks, you can go to the "Tasks" page in the administration panel
Select a task configuration and the three icons on the right, which are:
Execute Now
- When clicked, the scheduled time will be ignored and the task will be executed immediatelyEdit
- Click to modify the task configurationDelete
- Delete this scheduled tasksource ~/.bashrc
at beginning of your command or execute by absolute path.请查看 Dashboard相关-后台显示的IP和Agent实际IP不一致?
在此不再赘述。
多出现在国内主机中,目前一键脚本只从github直接获取安装脚本,您可以多尝试几次,或者手动安装Agent,别忘了使用镜像。
还有其他一些表现形式,总之登陆后浏览器无法正常显示。
TIP
什么是协议?在浏览器中,您的域名以://结尾的字符串即为协议,通常为http和https两种。由于正常部署情况下面板可能有多种协议+域名+端口组合均可访问,请务必选一个最合适的作为回调。
请确保登录前浏览器显示的协议+域名+端口和登陆后跳转到的协议+域名+端口一致。
还有其他一些表现形式,总之登录后浏览器无法正常显示。
TIP
什么是协议?在浏览器中,您的域名以://结尾的字符串即为协议,通常为http和https两种。由于正常部署情况下面板可能有多种协议+域名+端口组合均可访问,请务必选一个最合适的作为回调。
请确保登录前浏览器显示的协议+域名+端口和登录后跳转到的协议+域名+端口一致。
哪吒监控支持对服务器的负载、CPU、内存、硬盘、带宽、流量、月流量、进程数、连接数进行监控,并在其中某项达到用户设定值时发送报警通知
#NEZHA#
是面板消息占位符,面板触发通知时会自动用实际消息替换占位符
Body 内容是JSON
格式的:当请求类型为 FORM 时,值为 key:value
的形式,value
里面可放置占位符,通知时会自动替换。当请求类型为 JSON 时 只会简单进行字符串替换后直接提交到URL
。
URL 里面也可放置占位符,请求时会进行简单的字符串替换。
你可以参考以下的通知方式示例,也可以根据自己的需求灵活设置推送方式
server酱示例
wxpusher 示例,需要关注你的应用
{"appToken":"你的appToken","topicIds":[],"content":"#NEZHA#","contentType":"1","uids":["你的uid"]}
Telegram 示例 @haitau 贡献
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
连接数0
监控所有,通过 ignore
忽略特定服务器1
忽略所有,通过 ignore
监控特定服务器[{"type":"offline","duration":10, "cover":0, "ignore":{"5": true}}]
cover
使用,内容为服务器id和布尔值,例如:{"1": true, "2":false}
完整示例:
TIP
添加一个离线报警
[{"Type":"offline","Duration":10}]
TIP
添加一个监控 CPU 持续 10s 超过 50% 且 内存持续 20s 占用低于 20% 的报警
[{"Type":"cpu","Min":0,"Max":50,"Duration":10},{"Type":"memory","Min":20,"Max":0,"Duration":20}]
可以用作月流量报警
transfer_in_cycle
周期内的入站流量transfer_out_cycle
周期内的出站流量transfer_all_cycle
周期内双向流量和2022-01-11T08:00:00.00+08:00
hour
,可选(hour
, day
, week
, month
, year
)示例: 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}}]
/opt/nezha/agent/nezha-agent -s 面板IP或非CDN域名:面板RPC端口 -p Agent密钥 -d
查看日志是否是因为 DNS、网络不佳导致超时(timeout)nc -v 域名/IP 面板RPC端口
或者 telnet 域名/IP 面板RPC端口
来检验是否是网络问题,检查本机与面板服务器的出入站防火墙,如果无法判断问题可借助 https://port.ping.pe/ 提供的端口检查工具进行检测。停止面板
/opt/nezha
文件夹,复制到新环境相同位置解压启动面板
主机区域负责管理Agent,是哪吒探针中最基础的区域,也是其他功能的基础。
第一步是添加主机,可以自定义名称、分组、排序和备注。
拥有相同分组的主机会在受支持的主题中划分到一起进行显示,备注仅会在后台显示,无需担心泄露信息。
请参考前文安装Agent
推荐使用一键安装,即配置好参数后,点击主机一键安装列上的按钮,复制到相应主机进行安装。
Agent更新相关的参数是 自定义agent监控项目 中的 --disable-auto-update
和 --disable-force-update
。
默认情况下,Agent会自动更新,无需干预。但当用户关闭自动更新后,也可以选中指定主机进行强制更新。
disable-force-update开启时此功能不生效。
即WebShell,disable-command-execute
开启时此功能不生效。
Linux和Windows均可用,可使用Ctrl+Shift+V粘贴。
连接失败请参考实时通道断开/在线终端连接失败。
注意在线终端功能中,Agent也是通过WebSocket连接到公开访问域名,而非通过grpc交互。
服务区域是设置 Agent 监控外部网站或服务器的功能设置区
设置好的服务监控可以在主页中的 “服务” 页查看监控结果
如需新增一个监控,可以进入管理面板中的 “服务” 页,点击“添加监控”
新增一个服务监控,你需要设置以下参数:
名称
- 自定义一个名称
类型
- 选择一个监控类型,目前哪吒监控支持三种监控类型,分别是 “HTTP-GET”、“ICMP-Ping” 和 “TCP-Ping”
目标
- 根据你选择的类型不同,目标的设置方法也不同
HTTP-GET
: 选择此类型,你应该输入一个URL作为目标,URL需添加http://
或https://
如果你的目标URL是https://
,将会同时监控该URL的SSL证书,当SSL证书到期或发生变更,会触发提醒
例如: https://example.com
ICMP-Ping
: 选择此类型时,你应该输入一个域名或IP,不含端口号
例如:1.1.1.1 或 example.com
TCP-Ping
: 选择此类型时,你应该输入一个域名或IP并包含端口号
例如:1.1.1.1:80 或 example.com:22
请求间隔
: 设定 Agent 每次请求目标的时间间隔,以秒为单位
覆盖范围
: 选择一条规则来确定要使用哪些 Agent 来请求目标
特定服务器
: 配合覆盖范围使用,选择规则内需要排除的 Agent
通知方式组
: 选择你已经在 “报警” 页设置好的通知方式,点击这里了解详情
启用故障通知
: 根据需要选择是否接收目标故障通知,默认为不勾选
设置完成后,点击 “添加” 即可
稍等片刻前往主页的 “服务” 页,查看监控结果
如需对已有的服务监控进行管理,可以前往管理面板中的 “服务” 页
选择一条监控配置,点击右侧的图标进行编辑或删除
在任务区域中,可以设置计划任务,定期任务,多服务器批量执行任务
哪吒监控支持推送命令到 Agent 执行,因此此功能非常灵活,使用此功能可以定期结合 restic、rclone 给服务器备份,或者定期重启某项服务来重置网络连接
进入管理面板的 “任务” 页,点击 “添加计划任务”
添加计划任务你需要填入以下参数:
名称
- 自定义一个任务名称
计划
- 设置计划时间,时间的格式为: * * * * * *
分别对应 秒 分 时 天 月 星期
,详情见计划表达式格式
如:0 0 3 * * *
对应为 每天3点
命令
- 你可以在这里设置需要执行的命令,就像写 Shell/Bat 脚本一样,但是不推荐换行,多个命令使用 &&/&
连接
例如执行定期重启命令,可以在这里输入 reboot
覆盖范围
和 特定服务器
- 跟“服务”页中的设置类似,选择规则来确定哪些 Agent 执行计划任务
通知方式组
- 选择你已经在 “报警” 页设置好的通知方式,点击这里了解详情
推送成功的消息
- 勾选此项,任务执行成功后会触发消息通知
如需对已有的计划任务进行管理,可以前往管理面板中的 “任务” 页
选择一条任务配置,右侧的三个图标,分别是:
立即执行
- 点击后将忽略计划时间,立刻执行任务编辑
- 点击可以修改任务配置删除
- 删除这条计划任务source ~/.bashrc
或者使用绝对路径执行diff --git a/en_US/guide/agentq.html b/en_US/guide/agentq.html index 1cd873f1..8b871ea0 100644 --- a/en_US/guide/agentq.html +++ b/en_US/guide/agentq.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/api.html b/en_US/guide/api.html index 4a773800..8c5f81c9 100644 --- a/en_US/guide/api.html +++ b/en_US/guide/api.html @@ -126,7 +126,7 @@ Authorization: Token ] }
-
+
diff --git a/en_US/guide/dashboard.html b/en_US/guide/dashboard.html
index fef17128..91880290 100644
--- a/en_US/guide/dashboard.html
+++ b/en_US/guide/dashboard.html
@@ -36,7 +36,7 @@ proxy /terminal/* http://ip:8008 {
websocket
}
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
Commonly used in requirements such as batch installation of Agents, where you can modify the database directly.
Please note that not everything can be modified in the database, wrong modification will lead to data confusion and failure to start Dashboard, please do not modify the database at will!
WARNING
Again, please do not modify the database at will!
If you need to modify the data in the database, please stop the Dashboard container before modifying it.
The database type is sqlite3, located in /opt/nezha/dashboard/data/sqlite.db
, please backup before modifying the data
The documentation does not provide an explanation of the database. If you have the ability to modify the database, you should be able to read it with a little thinking.
The Agent normally updates automatically, but the Dashboard does not and needs to be updated manually.
Run the script . /nezha.sh
and select restart Dashboard and update
- + diff --git a/en_US/guide/dashboardq.html b/en_US/guide/dashboardq.html index e1b853ee..76962e4e 100644 --- a/en_US/guide/dashboardq.html +++ b/en_US/guide/dashboardq.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/loginq.html b/en_US/guide/loginq.html index 61af8071..a906121d 100644 --- a/en_US/guide/loginq.html +++ b/en_US/guide/loginq.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/notifications.html b/en_US/guide/notifications.html index dda2e576..23669156 100644 --- a/en_US/guide/notifications.html +++ b/en_US/guide/notifications.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/q2.html b/en_US/guide/q2.html index 59d7b185..70179a73 100644 --- a/en_US/guide/q2.html +++ b/en_US/guide/q2.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/q3.html b/en_US/guide/q3.html index fee04e5e..59ebe3f8 100644 --- a/en_US/guide/q3.html +++ b/en_US/guide/q3.html @@ -38,7 +38,7 @@ } }
Dashboard Configuration
CDN Bypassed Domain/IP
with the domain name you configured in Nginx or Caddy, for example data.example.com
, and save it./opt/nezha/dashboard/data/config.yaml
file in the panel server and change proxygrpcport
to the port that Nginx or Caddy is listening on, such as 443
as set in the previous step. Since we have SSL/TLS enabled in Nginx or Caddy, we need to set tls
to true
, restart the panel when you are done.Agent Configuration
Enable Cloudflare CDN (optional)
According to Cloudflare gRPC requirements: gRPC services must listen on port 443 and must support TLS and HTTP/2. So if you need to enable CDN, you must use port 443 when configuring Nginx or Caddy reverse proxy gRPC and configure the certificate (Caddy will automatically apply and configure the certificate).
Network
page and turn on the gRPC
switch, then go to the DNS
page, find the resolution record of the domain with gRPC configuration, and turn on the orange cloud icon to enable CDN.- + diff --git a/en_US/guide/q4.html b/en_US/guide/q4.html index e1fa3e1e..26fd3936 100644 --- a/en_US/guide/q4.html +++ b/en_US/guide/q4.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/q5.html b/en_US/guide/q5.html index 7fee6183..ec32e6c7 100644 --- a/en_US/guide/q5.html +++ b/en_US/guide/q5.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/servers.html b/en_US/guide/servers.html index 490969fe..a9edfeaa 100644 --- a/en_US/guide/servers.html +++ b/en_US/guide/servers.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/services.html b/en_US/guide/services.html index 6355a1db..3503ddcc 100644 --- a/en_US/guide/services.html +++ b/en_US/guide/services.html @@ -14,7 +14,7 @@
diff --git a/en_US/guide/settings.html b/en_US/guide/settings.html index 1185694e..e8c1680f 100644 --- a/en_US/guide/settings.html +++ b/en_US/guide/settings.html @@ -57,7 +57,7 @@ avatar.style} </style>
If you don't want to show your homepage directly, you can set a access password here
After setting the password, you need to enter the password to access the homepage
This setting is a prerequisite for using the one-click script to install the Agent, see here for details
If you want to be notified when a server's ip changes, you can set it up here
Select a rule here to determine which servers need to be monitored, and you can choose according to your needs
In conjunction with the coverage settings, set the exclusions for the selected rule here
Select the notification method, please set the notification method in the "Notifications" page
WARNING
When the settings are completed, the notification takes effect when enabled
is activated
WARNING
IP Change Alert does not show ip by default, if you don't want to hide it, you can activate "Do NOT desensitize Server IP In Notification Messages"
- + diff --git a/en_US/guide/tasks.html b/en_US/guide/tasks.html index 0a5ea33b..fa034912 100644 --- a/en_US/guide/tasks.html +++ b/en_US/guide/tasks.html @@ -14,7 +14,7 @@
diff --git a/en_US/index.html b/en_US/index.html index 8e23c70e..6d56984f 100644 --- a/en_US/index.html +++ b/en_US/index.html @@ -14,7 +14,7 @@
diff --git a/guide/agent.html b/guide/agent.html index 486779f8..adbaf013 100644 --- a/guide/agent.html +++ b/guide/agent.html @@ -37,7 +37,7 @@ start }
chmod +x /etc/init.d/nezha-service
赋予执行权限/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start
/opt/nezha/agent/nezha-agent --edit-agent-config
来选择自定义的网卡和分区,然后重启 Agent 即可生效通过执行 ./nezha-agent --help
查看支持的参数,如果你使用了一键脚本安装Agent,可以编辑 /etc/systemd/system/nezha-agent.service
,在 ExecStart=
这一行的末尾加上以下参数
--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 时,需要启用该项配置)Agent 目前没有推出 Docker 镜像。
Agent 的设计思路和 Dashboard 相反,Dashboard 要尽可能不影响宿主机工作,但 Agent 则需要在宿主机中执行监控服务和运行命令。
将 Agent 放入容器中确实可以继续执行监控任务,但 WebShell 等功能无法正常运行,因此不提供 Docker 镜像。
- + diff --git a/guide/agentq.html b/guide/agentq.html index 4f72eaae..949eab60 100644 --- a/guide/agentq.html +++ b/guide/agentq.html @@ -14,7 +14,7 @@
diff --git a/guide/api.html b/guide/api.html index 8a468b71..2d7ea449 100644 --- a/guide/api.html +++ b/guide/api.html @@ -126,7 +126,7 @@ Authorization: Token ] }
-
+
diff --git a/guide/dashboard.html b/guide/dashboard.html
index 39037c3b..62fd9b7b 100644
--- a/guide/dashboard.html
+++ b/guide/dashboard.html
@@ -37,7 +37,7 @@ proxy /terminal/* http://ip:8008 {
websocket
}
首先,先暂时关闭反向代理
正如在其他网站中配置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" ,不更改此项可能会导致你无法登录面板后台
常见于批量插入 Agent 等需求中,可以直接修改数据库。
请注意,数据库中并非什么都可以修改,错误的修改会导致数据混乱无法启动Dashboard,请勿随意修改数据库!
WARNING
再重复一遍,请勿随意修改数据库!
如需要在数据库中修改数据,请先停止面板容器再修改。
数据库类型是 sqlite3,位于 /opt/nezha/dashboard/data/sqlite.db
,修改前请备份
文档不提供数据库解释,有能力修改数据库的稍加分析应该就足以看懂。
Agent通常情况下会自动更新,但Dashboard并不会,需要手动更新。
运行脚本 ./nezha.sh
,选择重启面板并更新
- + diff --git a/guide/dashboardq.html b/guide/dashboardq.html index 5293338d..c62cd29f 100644 --- a/guide/dashboardq.html +++ b/guide/dashboardq.html @@ -20,7 +20,7 @@ systemctl restart docker systemctl status docker
重启后尝试重新安装面板。
若依然出现iptables...等错误,则考虑是否直接关闭iptables甚至移除iptables。
这个问题也可能由内核引起,也可以尝试更换官方内核。
- + diff --git a/guide/loginq.html b/guide/loginq.html index 460b9434..e2a309c0 100644 --- a/guide/loginq.html +++ b/guide/loginq.html @@ -3,18 +3,18 @@
-
+
- + - - + +
diff --git a/guide/notifications.html b/guide/notifications.html index 8de384c3..bd75cd24 100644 --- a/guide/notifications.html +++ b/guide/notifications.html @@ -14,7 +14,7 @@
diff --git a/guide/q1.html b/guide/q1.html index 48a044cf..d834596a 100644 --- a/guide/q1.html +++ b/guide/q1.html @@ -60,7 +60,7 @@ ufw allow proto tcp from serverIp to any port 443443 -j DROP iptables -I INPUT -s serverIp -p tcp --dport 443 -j ACCEPT
- + diff --git a/guide/q2.html b/guide/q2.html index 2aafc104..404b5418 100644 --- a/guide/q2.html +++ b/guide/q2.html @@ -14,7 +14,7 @@
diff --git a/guide/q3.html b/guide/q3.html index 102a7716..c54bbeea 100644 --- a/guide/q3.html +++ b/guide/q3.html @@ -38,7 +38,7 @@ } }
Dashboard 面板端配置
未接入CDN的面板服务器域名/IP
中填入上一步在 Nginx 或 Caddy 中配置的域名 比如 data.example.com
,并保存。proxygrpcport
修改为 Nginx 或 Caddy 监听的端口,比如上一步设置的 443
;因为我们在 Nginx 或 Caddy 中开启了 SSL/TLS,所以需要将 tls
设置为 true
;修改完成后重启面板。Agent 端配置
开启 Cloudflare CDN(可选)
根据 Cloudflare gRPC 的要求:gRPC 服务必须侦听 443 端口 且必须支持 TLS 和 HTTP/2。 所以如果需要开启 CDN,必须在配置 Nginx 或者 Caddy 反向代理 gRPC 时使用 443 端口,并配置证书(Caddy 会自动申请并配置证书)。
网络
选项将 gRPC
开关打开,打开 DNS
选项,找到 Nginx 或 Caddy 反代 gRPC 配置的域名的解析记录,打开橙色云启用 CDN。- + diff --git a/guide/q4.html b/guide/q4.html index 1037ca3a..3c5c32cc 100644 --- a/guide/q4.html +++ b/guide/q4.html @@ -14,7 +14,7 @@
diff --git a/guide/q5.html b/guide/q5.html index eb87310c..e4998ed8 100644 --- a/guide/q5.html +++ b/guide/q5.html @@ -14,7 +14,7 @@
diff --git a/guide/servers.html b/guide/servers.html index 539b8052..21df6cee 100644 --- a/guide/servers.html +++ b/guide/servers.html @@ -14,7 +14,7 @@
diff --git a/guide/services.html b/guide/services.html index b646040f..114aa84d 100644 --- a/guide/services.html +++ b/guide/services.html @@ -14,7 +14,7 @@
diff --git a/guide/settings.html b/guide/settings.html index c7e0c3d4..4fb7cab5 100644 --- a/guide/settings.html +++ b/guide/settings.html @@ -57,7 +57,7 @@ avatar.style} </style>
如果你不想直接展示你的主页,你可以在这里设置一个查看密码
设置密码后,需要输入密码才可以访问主页
此项设置是使用一键脚本安装 Agent 的前提,详情请查看这里
如果你希望当某个服务器的ip发生变更时收到通知,可以在这里进行设置
在这里选择一条规则,来确定需要监控哪些服务器,可以根据自己的需求进行选择
配合覆盖范围的设置,在这里设置选定规则的排除项
选择通知方式,通知方式请提前在 “报警” 页内设置
WARNING
设置完成后,勾选启用时,通知生效
WARNING
IP变更通知默认打码,如果你不希望打码,可以勾选 “通知信息IP不打码”
- + diff --git a/guide/tasks.html b/guide/tasks.html index be5a9e12..48eaf0ca 100644 --- a/guide/tasks.html +++ b/guide/tasks.html @@ -14,7 +14,7 @@
diff --git a/hashmap.json b/hashmap.json index 021e91f6..0b79f937 100644 --- a/hashmap.json +++ b/hashmap.json @@ -1 +1 @@ -{"developer_index.md":"73745970","developer_l10n.md":"84df007d","developer_theme.md":"10393f71","en_us_developer_index.md":"df68d0e0","en_us_developer_l10n.md":"ccda64e7","en_us_developer_theme.md":"269a5170","en_us_guide_agent.md":"405e94e9","en_us_guide_agentq.md":"094fcb6f","en_us_guide_api.md":"fde8c0a6","en_us_guide_dashboard.md":"661726af","en_us_guide_dashboardq.md":"ac04f4d0","en_us_guide_loginq.md":"0379f96c","en_us_guide_notifications.md":"f2f143b0","en_us_guide_q2.md":"bbad7ab9","en_us_guide_q3.md":"37e5f372","en_us_guide_q4.md":"72447cee","en_us_guide_q5.md":"4bd8b06a","en_us_guide_servers.md":"f083b70a","en_us_guide_services.md":"c8ca2548","en_us_guide_settings.md":"91296351","en_us_guide_tasks.md":"5bd4651e","en_us_index.md":"3aaf4a98","guide_agent.md":"48a9c7b9","guide_agentq.md":"c0c374da","guide_api.md":"d9d6bcb1","guide_dashboard.md":"8f5dc9da","guide_dashboardq.md":"08b34d6b","guide_loginq.md":"25aade1d","guide_notifications.md":"b7a587bd","guide_q1.md":"eae9ada6","guide_q2.md":"8c395f8c","guide_q3.md":"393bb3f1","guide_q4.md":"f2a6e087","guide_q5.md":"efdadad4","guide_servers.md":"236b045e","guide_services.md":"218f0dfd","guide_settings.md":"c386562b","guide_tasks.md":"c3d40967","index.md":"1bec4c22"} +{"developer_index.md":"73745970","developer_l10n.md":"84df007d","developer_theme.md":"10393f71","en_us_developer_index.md":"df68d0e0","en_us_developer_l10n.md":"ccda64e7","en_us_developer_theme.md":"269a5170","en_us_guide_agent.md":"405e94e9","en_us_guide_agentq.md":"094fcb6f","en_us_guide_api.md":"fde8c0a6","en_us_guide_dashboard.md":"661726af","en_us_guide_dashboardq.md":"ac04f4d0","en_us_guide_loginq.md":"0379f96c","en_us_guide_notifications.md":"f2f143b0","en_us_guide_q2.md":"bbad7ab9","en_us_guide_q3.md":"37e5f372","en_us_guide_q4.md":"72447cee","en_us_guide_q5.md":"4bd8b06a","en_us_guide_servers.md":"f083b70a","en_us_guide_services.md":"c8ca2548","en_us_guide_settings.md":"91296351","en_us_guide_tasks.md":"5bd4651e","en_us_index.md":"3aaf4a98","guide_agent.md":"48a9c7b9","guide_agentq.md":"c0c374da","guide_api.md":"d9d6bcb1","guide_dashboard.md":"8f5dc9da","guide_dashboardq.md":"08b34d6b","guide_loginq.md":"9e45095c","guide_notifications.md":"b7a587bd","guide_q1.md":"eae9ada6","guide_q2.md":"8c395f8c","guide_q3.md":"393bb3f1","guide_q4.md":"f2a6e087","guide_q5.md":"efdadad4","guide_servers.md":"236b045e","guide_services.md":"218f0dfd","guide_settings.md":"c386562b","guide_tasks.md":"c3d40967","index.md":"1bec4c22"} diff --git a/index.html b/index.html index 5c68feff..c80c91a7 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@