小米open-falcon agent脚本无法运行,导致agent挂掉

1 出错现象如下:

2020/07/28 14:15:44 scheduler.go:71: plugin started: /opt/open-falcon/agent/script/livy/60_livy.py
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x72e5e3]

goroutine 30 [running]:
github.com/open-falcon/falcon-plus/vendor/github.com/toolkits/sys.CmdRunWithTimeout(0xc42037a160, 0xdda79f300, 0x2, 0xc4203f8670, 0x0)
        /home/dc2-user/gopath/src/github.com/open-falcon/falcon-plus/vendor/github.com/toolkits/sys/cmd.go:41 +0x43
github.com/open-falcon/falcon-plus/modules/agent/plugins.PluginRun(0xc42023e500)
        /home/dc2-user/gopath/src/github.com/open-falcon/falcon-plus/modules/agent/plugins/scheduler.go:74 +0x276
github.com/open-falcon/falcon-plus/modules/agent/plugins.(*PluginScheduler).Schedule.func1(0xc42023e5e0)
        /home/dc2-user/gopath/src/github.com/open-falcon/falcon-plus/modules/agent/plugins/scheduler.go:35 +0xc4
created by github.com/open-falcon/falcon-plus/modules/agent/plugins.(*PluginScheduler).Schedule
        /home/dc2-user/gopath/src/github.com/open-falcon/falcon-plus/modules/agent/plugins/scheduler.go:41 +0x3f

2.此时查看open-falcon-agent进程,发现已经挂掉

小米open-falcon agent脚本无法运行,导致agent挂掉_第1张图片

3.改脚本直接运行是可以的:

小米open-falcon agent脚本无法运行,导致agent挂掉_第2张图片

4.一番折腾后发现,py脚本开头少了一句话:

#!/usr/bin/env python

加上这句话后,问题解决了,然后尝试删除,发现立马报错,真的是心塞呀.........

 

你可能感兴趣的:(小米open-falcon agent脚本无法运行,导致agent挂掉)