️ fix Agent 重复取进程数

This commit is contained in:
naiba
2021-08-19 23:57:45 +08:00
parent 88b904b013
commit 0fde19d290
3 changed files with 2 additions and 30 deletions

View File

@@ -79,7 +79,6 @@ func main() {
flag.StringVar(&server, "s", "localhost:5555", "管理面板RPC端口")
flag.StringVar(&clientSecret, "p", "", "Agent连接Secret")
flag.BoolVar(&stateConf.SkipConnectionCount, "kconn", false, "不监控连接数")
flag.BoolVar(&stateConf.SkipProcessCount, "kprocess", false, "不监控进程数")
flag.Parse()
if server == "" || clientSecret == "" {
@@ -323,6 +322,7 @@ func handleCommandTask(task *pb.Task, result *pb.TaskResult) {
} else {
cmd = exec.Command("sh", "-c", task.GetData())
}
cmd.Env = os.Environ()
pg.AddProcess(cmd)
go func() {
select {