前言
在做测试的过程中,想实时关注下服务器状态,命令行工具界面比较难看。看够了,就想找一下有没有现成的,部署方便的单机监控。可以通过web界面展示当前服务状态,发现了 Goploy-Agent ,比较符合我的需求。启动也非常简单,特此记录使用过程。
配置
修改配置
启动
screen ./goploy-agent
优化
修改代码
//controller/Controller.go 281行
if !strings.HasPrefix(fields[0], "eth") && !strings.HasPrefix(fields[0], "em") && !strings.HasPrefix(fields[0], "lo") {
continue
}
//task/Task.go 363行
if strings.HasPrefix(fields1[0], "eth") || strings.HasPrefix(fields1[0], "em"){
logType = model.TypePubNet
} else if strings.HasPrefix(fields1[0], "lo") {
logType = model.TypeLoNet
} else {
continue
}
重新编译
# 编译vue前端
cd web/
npm install vite
npm run build
# 编译go,然后将生成的二进制文件上传服务器替换即可
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
评论 (0)