nezhahq.github.io/assets/en_US_guide_servers.md.BAcGNfli.js
2024-07-19 14:01:46 +00:00

27 lines
19 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as i,c as e,o as s,a4 as a}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Server Management","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/servers.md","filePath":"en_US/guide/servers.md","lastUpdated":1721397664000}'),n={name:"en_US/guide/servers.md"},t=a(`<h1 id="server-management" tabindex="-1">Server Management <a class="header-anchor" href="#server-management" aria-label="Permalink to &quot;Server Management&quot;"></a></h1><h2 id="introduction" tabindex="-1">Introduction <a class="header-anchor" href="#introduction" aria-label="Permalink to &quot;Introduction&quot;"></a></h2><p>The server section is responsible for managing Agents, forming the most fundamental part of Nezha monitoring and serving as the basis for other functionalities.</p><h2 id="adding-a-server" tabindex="-1">Adding a Server <a class="header-anchor" href="#adding-a-server" aria-label="Permalink to &quot;Adding a Server&quot;"></a></h2><p>The first step is to add a server, where you can customize the name, group, sorting, and notes.<br> Servers in the same group will be displayed together in supported themes. Notes will only be visible in the Admin Panel, so there&#39;s no need to worry about leaking information.</p><h2 id="installing-the-agent" tabindex="-1">Installing the Agent <a class="header-anchor" href="#installing-the-agent" aria-label="Permalink to &quot;Installing the Agent&quot;"></a></h2><p>Please refer to the previous section on <a href="/en_US/guide/agent.html">installing the Agent</a>.<br> It is recommended to use the one-click installation. After configuring the parameters, click the corresponding system icon in the <strong>one-click installation</strong> column of the server to copy the installation command and execute it on the respective server.</p><h2 id="forced-update" tabindex="-1">Forced Update <a class="header-anchor" href="#forced-update" aria-label="Permalink to &quot;Forced Update&quot;"></a></h2><p>Agent update-related parameters include <code>--disable-auto-update</code> and <code>--disable-force-update</code> as described in <a href="/en_US/guide/q7.html">Custom Agent Monitoring Projects</a>.<br> 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.<br> The forced update will not work if <code>disable-force-update</code> is enabled.</p><h2 id="data-columns" tabindex="-1">Data Columns <a class="header-anchor" href="#data-columns" aria-label="Permalink to &quot;Data Columns&quot;"></a></h2><ul><li>Version: Records the current version of the Agent.</li><li>Hide from Guests: When true, guests cannot see this server in the Dashboard.</li><li>Enable DDNS: When true, if the server IP changes, the Dashboard will automatically update the DNS records.</li><li>DDNS Domain: The DDNS domain configured for this server.</li><li>Secret: The secret/key used for configuring the Agent, which is used to verify communication between the Agent and the Dashboard.</li><li>One-Click Install: Click the corresponding system button to copy the command and execute it on the server for a one-click installation.</li><li>Management: Connects to WebShell, modifies server configuration, or deletes the server.</li></ul><h2 id="webssh-terminal" tabindex="-1">WebSSH Terminal <a class="header-anchor" href="#webssh-terminal" aria-label="Permalink to &quot;WebSSH Terminal&quot;"></a></h2><p>This is WebShell; the feature will not work if <code>disable-command-execute</code> is enabled.<br> It is available for both Linux and Windows and supports Ctrl+Shift+V for pasting.<br> If the connection fails, refer to <a href="/en_US/guide/q4.html">Real-Time Channel Disconnection/Online Terminal Connection Failure</a>.<br> Note that in the WebSSH terminal function, the Agent connects to the <strong>public access domain</strong> via WebSocket, not through gRPC.</p><h2 id="ddns-functionality" tabindex="-1">DDNS Functionality <a class="header-anchor" href="#ddns-functionality" aria-label="Permalink to &quot;DDNS Functionality&quot;"></a></h2><p>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.</p><h3 id="why-use-nezha-monitoring-s-ddns-functionality" tabindex="-1">Why Use Nezha Monitoring&#39;s DDNS Functionality? <a class="header-anchor" href="#why-use-nezha-monitoring-s-ddns-functionality" aria-label="Permalink to &quot;Why Use Nezha Monitoring&#39;s DDNS Functionality?&quot;"></a></h3><ul><li>Centralized management of DDNS settings instead of deploying a DDNS service on each server.</li><li>Confidential information is only stored on the Dashboard server, preventing leakage.</li></ul><h3 id="configuration-instructions" tabindex="-1">Configuration Instructions <a class="header-anchor" href="#configuration-instructions" aria-label="Permalink to &quot;Configuration Instructions&quot;"></a></h3><p>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.</p><h4 id="single-configuration" tabindex="-1">Single Configuration <a class="header-anchor" href="#single-configuration" aria-label="Permalink to &quot;Single Configuration&quot;"></a></h4><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">DDNS</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> Enable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> Provider</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;webhook&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> AccessID</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> AccessSecret</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookMethod</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookURL</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookRequestBody</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookHeaders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> MaxRetries</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> Profiles</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span></span></code></pre></div><ul><li><code>Enable</code>: Boolean value to enable or disable the DDNS functionality.</li><li><code>Provider</code>: The name of the DDNS provider; currently supports <code>webhook</code>, <code>cloudflare</code>, and <code>tencentcloud</code>.</li><li><code>AccessID</code>: Token ID for the DDNS provider; only applicable to the <code>tencentcloud</code> provider.</li><li><code>AccessSecret</code>: Token Secret for the DDNS provider; only applicable to the <code>cloudflare</code> and <code>tencentcloud</code> providers.</li><li><code>WebhookMethod</code>: The request method for the webhook, such as <code>GET</code> or <code>POST</code>; only applicable to the <code>webhook</code> provider.</li><li><code>WebhookURL</code>: The request URL for the webhook; only applicable to the <code>webhook</code> provider.</li><li><code>WebhookRequestBody</code>: The request body for the webhook; only applicable to the <code>webhook</code> provider.</li><li><code>WebhookHeaders</code>: The request headers for the webhook; only applicable to the <code>webhook</code> provider.</li><li><code>MaxRetries</code>: The number of retry attempts when a request fails.</li><li><code>Profiles</code>: Multi-configuration settings; ignored in single configuration settings.</li></ul><p>The <code>WebhookURL</code>, <code>WebhookRequestBody</code>, and <code>WebhookHeaders</code> can include the following parameters:</p><ul><li><code>{ip}</code>: The current IP of the server.</li><li><code>{domain}</code>: The DDNS domain.</li><li><code>{type}</code>: The IP type, which could be &quot;ipv4&quot; or &quot;ipv6&quot;.</li><li><code>{access_id}</code>: Credential 1.</li><li><code>{access_secret}</code>: Credential 2.</li></ul><p>Example Configuration:</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">WebhookHeaders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> a:{access_id}</span></span>
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> b:{access_secret}</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">WebhookRequestBody</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;{&quot;domain&quot;: &quot;{domain}&quot;, &quot;ip&quot;: &quot;{ip}&quot;, &quot;type&quot;: &quot;{type}&quot;}&#39;</span></span></code></pre></div><h4 id="multiple-configurations" tabindex="-1">Multiple Configurations <a class="header-anchor" href="#multiple-configurations" aria-label="Permalink to &quot;Multiple Configurations&quot;"></a></h4><p>When using multiple configurations, leave the <code>DDNS.Provider</code> value empty. If <code>DDNS.Provider</code> is not empty, the multiple configuration settings will be ignored.</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">DDNS</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> Enable</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> MaxRetries</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> Profiles</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> example</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> Provider</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> AccessID</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> AccessSecret</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookMethod</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookURL</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookRequestBody</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;"> WebhookHeaders</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span></span></code></pre></div><ul><li><code>Profiles</code>: Multi-configuration settings.</li><li><code>example</code>: Can be replaced with any string as the DDNS configuration name.</li></ul><p>Other options can be referenced from the <a href="#Single-Configuration">Single Configuration</a> section.</p><h4 id="dashboard-configuration" tabindex="-1">Dashboard Configuration <a class="header-anchor" href="#dashboard-configuration" aria-label="Permalink to &quot;Dashboard Configuration&quot;"></a></h4><p>After modifying the configuration file, you also need to modify the server settings in the Dashboard for the DDNS to take effect.</p><p>DDNS related options:</p><ul><li><code>Enable DDNS</code>: Enable the DDNS functionality for this server.</li><li><code>Enable DDNS IPv4</code>: Enable IPv4 resolution when updating DDNS records.</li><li><code>Enable DDNS IPv6</code>: Enable IPv6 resolution when updating DDNS records.</li><li><code>DDNS Domain</code>: The domain the record points to.</li><li><code>DDNS Configuration</code>: The DDNS configuration name to use in multiple configurations.</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>When you modify the configuration and save it in the Dashboard settings, it will populate the default configuration options in <code>config.yaml</code>, and both single and multiple configurations will exist in the DDNS section.</p><ul><li>To use single configuration, configure <code>DDNS.Provider</code> and ignore the <code>Profiles</code> options.</li><li>To use multiple configurations, leave <code>DDNS.Provider</code> empty. If <code>DDNS.Provider</code> is not empty, the multiple configuration settings will be ignored.</li></ul></div><h4 id="viewing-logs" tabindex="-1">Viewing Logs <a class="header-anchor" href="#viewing-logs" aria-label="Permalink to &quot;Viewing Logs&quot;"></a></h4><p>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.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">dashboard_1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> 2024/03/16</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 23:16:25</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> NEZH</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">A</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 正在尝试更新域名</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ddns.example.com</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">DDNS</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">1/3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Attempting to update domain (ddns.example.com) DDNS (1/3)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">dashboard_1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> 2024/03/16</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 23:16:28</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> NEZH</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">A</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 尝试更新域名</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ddns.example.com</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">DDNS成功</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Successfully updated domain (ddns.example.com) DDNS</span></span></code></pre></div>`,39),o=[t];function l(h,r,d,p,c,k){return s(),e("div",null,o)}const E=i(n,[["render",l]]);export{g as __pageData,E as default};