项目地址
1·下载最新的Releases
client-x86_64-unknown-linux-musl.zip
server-x86_64-unknown-linux-musl.zip2·默认路径安装
mkdir -p opt/ServerStatus3·配置systemctl
stat_client.service文件
[Unit] Description=ServerStatus-Rust Client After=network.target [Service] User=root Group=root Environment="RUST_BACKTRACE=1" WorkingDirectory=/opt/ServerStatus # EnvironmentFile=/opt/ServerStatus/.env ExecStart=/opt/ServerStatus/stat_client -a "http://客户端IP:8080/report" -u 用户名 -p 密码 ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure [Install] WantedBy=multi-user.target # /etc/systemd/system/stat_client.service # journalctl -u stat_client -f -n 100- stat_server.service文件
一般无需修改
4·配置客户端config.toml
设置账号密码
# 管理员账号,不设置默认随机生成,用于查看 /detail, /map jwt_secret = "" # 修改这个, 使用 openssl rand -base64 16 生成 secret admin_user = "xxxx" admin_pass = "xxxx"添加服务器
hosts = [ {name = "用户名1", password = "密码1", alias = "服务器1", location = "hk"}, {name = "用户名2", password = "密码2", alias = "服务器2", location = "hk"}, {name = "用户名n", password = "密码n", alias = "服务器n", location = "hk"}, ]
5·测试配置文件
./stat_server -c config.toml -t./stat_server -c config.toml --notify-test6·客户端启动
修改config.toml,必须重新启动
./stat_server -c config.tomlsystemctl restart stat_serversystemctl restart stat_client 