# 服务器

## 支持类型

大部分基于 Linux, 可提供 ssh 连接访问的服务器, 如 Debian, Centos, ProxmoxVE, 群晖, 威联通, UNRaid 如果需要在监控信息页查看信息, 则需要安装 sysstat 和 vnstat 2.0+

## 添加服务器

进入 下载服务 - 服务器

* 别名 给服务器取一个好记的名字
* 启用 选择是否启用服务器
* IP / 域名 服务器的 IP: 192.168.1.1 或域名: my.seed.box
* 绑定下载器 可选, 服务器绑定的下载器, 将在监控页提供链接
* 用户名 填写 ssh 登录服务器所需的用户名
* 密码 填写 ssh 登录服务器所需的密码
* 端口 填写 ssh 登录服务器所需的端口
* 重连次数 最大的 ssh 自动重连次数, 执行操作遇到错误时会自动重连, 默认为 10

## 安装 sysstat 与 vnstat

### 群晖

移步 => [看这里](https://blog.shutu736.com/archives/qun-hui-an-zhuang-vertex-he-sysstat)

### 威联通

由 HaroldXin 提供

1. 下载entware包管理器，2022.03的最新版本地址是 `https://bin.entware.net/other/Entware_1.03std.qpkg`
2. 在威联通app center中添加entware  注意：由于威联通定制Linux系统原因，/opt/bin 并没有加到环境变量中，所以在 shell 中直接运行 opkg 将不能被识别，需要在AppCenter重启 Entware-std 应用甚至重启 NAS 才能直接识别，也可以使用绝对路径（/opt/bin/opkg）直接运行。
3. 执行 `/opt/bin/opkg update && /opt/bin/opkg install vnstat && /opt/bin/opkg install sysstat` 安装后重启即可

### unraid

前置条件 NerdPack 就不多赘述了, 玩 unraid 肯定也安装了 进入 NerdPack 之后搜索 stat, 安装 sysstat 以及 vnstat

安装之后 vnstat 不会自动启动, 需要进入 ssh 执行以下命令

```bash
  chmod +x /etc/rc.d/rc.vnstat
  /etc/rc.d/rc.vnstat start
```

unraid 重启后会还原设置, 可以在启动脚本内加入这两行代码

### Debian

#### Debian 10

* sysstat 可以直接 apt 安装

```bash
apt install sysstat
```

* vnstat 因为 apt 安装的 vnstat 版本低于 2.0, 因此需要编译安装

```bash
bash <(curl -Ls "https://gitlab.lswl.in/lswl/lswl/-/raw/main/script/vnstatCompileInstaller.sh")
```

安装完成后会显示本机的 网卡信息, 需要将 `/etc/vnstat.conf` 内的 `Interface` 修改为对应的网卡名称&#x20;

#### Debian 11+

* sysstat 与 vnstat 均可通过 apt 安装

```bash
apt install sysstat vnstat
```

### CentOS

#### CentOS 7.9

```bash
yum group install "Development Tools" -y
yum install gd gd-devel sqlite-devel -y
yum install epel-release -y
yum install sysstat -y
wget https://github.com/vergoh/vnstat/releases/download/v2.6/vnstat-2.6.tar.gz
tar zxvf vnstat-2.6.tar.gz
cd vnstat-2.6 && ./configure --prefix=/usr --sysconfdir=/etc
make clean && make install
cp -v examples/systemd/vnstat.service /etc/systemd/system/
systemctl enable vnstat  
systemctl start vnstat
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.vertex-app.top/zhu-yao-mo-kuai/fu-wu-qi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
