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":1722868783000}'),n={name:"en_US/guide/servers.md"},t=a(`

Server Management

Introduction

The server section is responsible for managing Agents, forming the most fundamental part of Nezha monitoring and serving as the basis for other functionalities.

Adding a Server

The first step is to add a server, where you can customize the name, group, sorting, and notes.
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.

Installing the Agent

Please refer to the previous section on installing the Agent.
It is recommended to use the one-click installation. After configuring the parameters, click the corresponding system icon in the one-click installation column of the server to copy the installation command and execute it on the respective server.

Forced Update

Agent update-related parameters include --disable-auto-update and --disable-force-update as described in Custom Agent Monitoring Projects.
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.
The forced update will not work if disable-force-update is enabled.

Data Columns

WebSSH Terminal

This is WebShell; the feature will not work if disable-command-execute is enabled.
It is available for both Linux and Windows and supports Ctrl+Shift+V for pasting.
If the connection fails, refer to Real-Time Channel Disconnection/Online Terminal Connection Failure.
Note that in the WebSSH terminal function, the Agent connects to the public access domain via WebSocket, not through gRPC.

DDNS Functionality

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.

Why Use Nezha Monitoring's DDNS Functionality?

Configuration Instructions

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.

Single Configuration

yaml
DDNS:
  Enable: true
  Provider: "webhook"
  AccessID: ""
  AccessSecret: ""
  WebhookMethod: ""
  WebhookURL: ""
  WebhookRequestBody: ""
  WebhookHeaders: ""
  MaxRetries: 3
  Profiles: null

The WebhookURL, WebhookRequestBody, and WebhookHeaders can include the following parameters:

Example Configuration:

yaml
WebhookHeaders: |
    a:{access_id}
    b:{access_secret}
WebhookRequestBody: '{"domain": "{domain}", "ip": "{ip}", "type": "{type}"}'

Multiple Configurations

When using multiple configurations, leave the DDNS.Provider value empty. If DDNS.Provider is not empty, the multiple configuration settings will be ignored.

yaml
DDNS:
  Enable: true
  MaxRetries: 3
  Profiles:
    example:
      Provider: ""
      AccessID: ""
      AccessSecret: ""
      WebhookMethod: ""
      WebhookURL: ""
      WebhookRequestBody: ""
      WebhookHeaders: ""

Other options can be referenced from the Single Configuration section.

Dashboard Configuration

After modifying the configuration file, you also need to modify the server settings in the Dashboard for the DDNS to take effect.

DDNS related options:

WARNING

When you modify the configuration and save it in the Dashboard settings, it will populate the default configuration options in config.yaml, and both single and multiple configurations will exist in the DDNS section.

Viewing Logs

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.

shell
dashboard_1  | 2024/03/16 23:16:25 NEZHA>> 正在尝试更新域名(ddns.example.com)DDNS(1/3) # Attempting to update domain (ddns.example.com) DDNS (1/3)
dashboard_1  | 2024/03/16 23:16:28 NEZHA>> 尝试更新域名(ddns.example.com)DDNS成功 # Successfully updated domain (ddns.example.com) DDNS
`,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};