dstatus agent 安装

本文适合需要为 dstatus 监控面板部署客户端 agent 的服务器管理员。你会学到:下载 neko-status 二进制、写入配置文件、注册 systemd 服务并开机自启。

下载 agent

wget https://github.com/fev125/dstatus/releases/download/v1.1/neko-status_linux_amd64

安装到系统目录

mv neko-status_linux_amd64  neko-status
chmod +x neko-status 
mv neko-status /usr/bin/

编写配置文件

mkdir  /etc/neko-status/
nano  /etc/neko-status/config.yaml

写入以下内容(key 替换为面板分配的密钥):

key: 密钥
port: 9999
debug: false

创建 systemd 服务

nano /etc/systemd/system/nekonekostatus.service
[Unit]
Description=DStatus客户端服务
After=network.target
[Service]
Restart=always
RestartSec=5
ExecStart=/usr/bin/neko-status -c /etc/neko-status/config.yaml
[Install]
WantedBy=multi-user.target

启动服务

systemctl daemon-reload 
systemctl start nekonekostatus.service 
systemctl status  nekonekostatus.service 

验证与自查

  1. systemctl status nekonekostatus.service 显示 active (running) 且无报错
  2. 检查监听端口:ss -tlnp | grep 9999 能看到 neko-status 进程
  3. 在 dstatus 面板上能看到该节点上报状态(密钥与面板配置一致)
  4. 重启服务器后服务自动拉起(systemctl is-enabled nekonekostatus.service 返回 enabled

参考