1. 7.Secondary Development

1.1. The construction of go development environment:

cd ~
wget http://dinp.qiniudn.com/go1.4.1.linux-amd64.tar.gz
tar zxf go1.4.1.linux-amd64.tar.gz
mkdir -p workspace/src
echo "" >> .bashrcecho 'export GOROOT=$HOME/go' >> .bashrcecho 'export GOPATH=$HOME/workspace' >> .bashrcecho 'export PATH=$GOROOT/bin:$GOPATH/bin:$PATH' >> .bashrcecho "" >> .bashrc
source .bashrc

1.2. clone code

cd $GOPATH/src
mkdir github.comcd github.com
git clone --recursive https://github.com/XiaoMi/open-falcon.git

1.3. compiling an element(taking agent as an example)

cd $GOPATH/src/github.com/open-falcon/agent
go get ./...
./control build

1.4. User defined modification filing strategy

Modify open-falcon/graph/rrdtool/rrdtool.go

1.5. picture

Compile element graph again, and replace the original binary

Eliminate all the original rrd files(under /home/work/data/6070/ by default)

1.6. Plugin mechanism

1.Find a git to store all the plugins of company

2.Download the repo plugin to the local by calling the /plugin/update interface of agent

3.Deploy which hosts can execute which plugins in portal

4.The naming way of plugin: $step_xx.yy, which needs the execute permission to save to the each directory by classification

5.Print the collected data to stdout

6.You may modify the agent and download the plugin.tar.gz from a http address at fixed period if you find the git way inconvenient

Copyright © 2017 FalconPlus Community all right reserved,powered by Gitbook该文件修订时间: 2017-10-31 11:08:03