- 安装 golang [1.4+]
yum install golang - 下载 falcon 文件,以及相关部署 GOPATH是go语言运行的环境,go 命令时的程序路径就是此路径
export GOPATH=/root/go
mkdir -p $GOPATH/src/github.com/open-falcon
cd $GOPATH/src/github.com/open-falcon
git clone https://github.com/open-falcon/falcon-plus.git
cd falcon-plus/modules/agent
go get - 编译
部署交叉编译工具链 [arm-2013.11]
arm-linux-gnueabi-gcc -v
[CentOS]安装软件:/lib/ld-linux.so.2: bad ELF interpreter 解决
bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
解决办法:yum install glibc.i686
参考链接:https://blog.csdn.net/orangleliu/article/details/8869626
CGO_ENABLED=1 GOOS=linux GOARCH=arm CC=arm-linux-gnueabi-gcc go build
-
打包 falcon-agent
打包 agent,cfg.json 两个文件 -
运行 falcon-agent
修改 cfg.json hostname:必须唯一
{
"debug": true,
"hostname": "parkin",
"ip": "",
"plugin": {
"enabled": false,
"dir": "./plugin",
"git": "https://github.com/open-falcon/plugin.git",
"logs": "./logs"
},
"heartbeat": {
"enabled": true,
"addr": "127.0.0.1:6030",
"interval": 60,
"timeout": 1000
},
"transfer": {
"enabled": true,
"addrs": [
"127.0.0.1:8433",
"127.0.0.1:8433"
],
"interval": 60,
"timeout": 1000
},
"http": {
"enabled": true,
"listen": ":1988",
"backdoor": false
},
"collector": {
"ifacePrefix": ["eth", "em"],
"mountPoint": []
},
"default_tags": {
},
"ignore": {
"cpu.busy": true,
"df.bytes.free": true,
"df.bytes.total": true,
"df.bytes.used": true,
"df.bytes.used.percent": true,
"df.inodes.total": true,
"df.inodes.free": true,
"df.inodes.used": true,
"df.inodes.used.percent": true,
"mem.memtotal": true,
"mem.memused": true,
"mem.memused.percent": true,
"mem.memfree": true,
"mem.swaptotal": true,
"mem.swapused": true,
"mem.swapfree": true
}
}
./agent -c cfg.json
可能缺少 arm-linux-gnueabi-gcc 环境的链接文件 ld-linux.so,以及相关依赖库