falcon-agent运行出错解决方法一
错误1:在一些机器上agent运行时会因机器的系统等原因造成的报以下错误:
当前的机器配置为:centos系统为8.1,内核为4.18
[root@xxxx agent]# cat var/app.log
2020/08/18 14:51:11 cfg.go:178: read config file: cfg.json successfully
2020/08/18 14:51:11 http.go:92: listening 127.0.0.1:1988
panic: runtime error: index out of range [1] with length 1
goroutine 19 [running]:
github.com/open-falcon/falcon-plus/modules/agent/vendor/github.com/toolkits/nux.SocketStatSummary(0x0, 0x0, 0x48)
/home/centos/go/src/github.com/open-falcon/falcon-plus/modules/agent/vendor/github.com/toolkits/nux/ss_s.go:49 +0x796
github.com/open-falcon/falcon-plus/modules/agent/funcs.SocketStatSummaryMetrics(0x0, 0x0, 0x0)
/home/centos/go/src/github.com/open-falcon/falcon-plus/modules/agent/funcs/sockstat.go:24 +0x37
github.com/open-falcon/falcon-plus/modules/agent/cron.collect(0x3c, 0xc00000f260, 0x3, 0x3)
/home/centos/go/src/github.com/open-falcon/falcon-plus/modules/agent/cron/collector.go:73 +0xe3
created by github.com/open-falcon/falcon-plus/modules/agent/cron.Collect
/home/centos/go/src/github.com/open-falcon/falcon-plus/modules/agent/cron/collector.go:55 +0xbf
[root@xxxx agent]#
解决办法:
这是因为agent的nux库还不支持所有系列的centos系统,所以需要更友好的系统装到机器上
将系统版本降到7.5,内核版本降至3.10
再次按照agent并运行即可。