27 lines
19 KiB
JavaScript
27 lines
19 KiB
JavaScript
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":1728186808000}'),t={name:"en_US/guide/servers.md"},n=a(`<h1 id="server-management" tabindex="-1">Server Management <a class="header-anchor" href="#server-management" aria-label="Permalink to "Server Management""></a></h1><h2 id="introduction" tabindex="-1">Introduction <a class="header-anchor" href="#introduction" aria-label="Permalink to "Introduction""></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 "Adding a Server""></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'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 "Installing the Agent""></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 "Forced Update""></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 "Data Columns""></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 "WebSSH Terminal""></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>.</p><h2 id="fm" tabindex="-1">FM <a class="header-anchor" href="#fm" aria-label="Permalink to "FM""></a></h2><p>Added in Dashboard v0.19.1 / Agent v0.19.0. A pseudo file manager embedded in WebShell, supports file download/upload, directory navigation and copying current path. Access it by clicking the blue button in the bottom-right corner of the WebShell.</p><h2 id="ddns-functionality" tabindex="-1">DDNS Functionality <a class="header-anchor" href="#ddns-functionality" aria-label="Permalink to "DDNS Functionality""></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's DDNS Functionality? <a class="header-anchor" href="#why-use-nezha-monitoring-s-ddns-functionality" aria-label="Permalink to "Why Use Nezha Monitoring's DDNS Functionality?""></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 "Configuration Instructions""></a></h3><p>You can choose to use profiles or not; If no profile is set, all Agent servers will use the same configuration to update DDNS. If profiles are used, each server can have a specific configuration for updating DDNS, providing greater flexibility.</p><h4 id="without-profiles" tabindex="-1">Without Profiles <a class="header-anchor" href="#without-profiles" aria-label="Permalink to "Without Profiles""></a></h4><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>This configuration is deprecated and will be removed in a future release. Please switch to using profiles instead.</p></div><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;">"webhook"</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;">""</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;">""</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;">""</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;">""</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;">""</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;">""</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 placeholders:</p><ul><li><code>{ip}</code>: The current IP of the server.</li><li><code>{domain}</code>: The DDNS domain. If used with <code>WebhookURL</code>, only query values will be replaced.</li><li><code>{type}</code>: The IP type, either "ipv4" or "ipv6".</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;">'{"domain": "{domain}", "ip": "{ip}", "type": "{type}"}'</span></span></code></pre></div><h4 id="with-profiles" tabindex="-1">With Profiles <a class="header-anchor" href="#with-profiles" aria-label="Permalink to "With Profiles""></a></h4><p>When using profiles, leave the <code>DDNS.Provider</code> value empty. If <code>DDNS.Provider</code> is not empty, this configuration 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;">""</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;">""</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;">""</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;">""</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;">""</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;">""</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;">""</span></span></code></pre></div><ul><li><code>Profiles</code>: Profile field.</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="#Without-Profiles">Without Profiles</a> section.</p><h4 id="dashboard-configuration" tabindex="-1">Dashboard Configuration <a class="header-anchor" href="#dashboard-configuration" aria-label="Permalink to "Dashboard Configuration""></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 all options in the DDNS field will be set with a default value (see <a href="#Without-Profiles">Without Profiles</a>).</p><ul><li>If not using profiles, configure <code>DDNS.Provider</code> and ignore the <code>Profiles</code> options.</li><li>To use profiles, leave <code>DDNS.Provider</code> empty. If <code>DDNS.Provider</code> is not empty, the <code>Profiles</code> field 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 "Viewing Logs""></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;">>></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;">>></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>`,42),o=[n];function l(h,r,d,p,c,k){return s(),e("div",null,o)}const E=i(t,[["render",l]]);export{g as __pageData,E as default};
|