Prerequisites
InfluxDB
Install dependencies
$ sudo apt-get install ruby-dev gcc
$ sudo gem install fpmBuild package
Let's build InfluxDB 0.9.4.
Setup a gvm package set:
$ gvm pkgset create influxdb
$ gvm pkgset use influxdbCheckout sources:
$ mkdir -p ~/.gvm/pkgsets/go1.5/influxdb/src/github.com/influxdb
$ cd ~/.gvm/pkgsets/go1.5/influxdb/src/github.com/influxdb
$ git clone https://github.com/influxdb/influxdb.gitBuild debian package:
$ cd influxdb
$ ./package.sh -t deb -p 0.9.4Install
Install package:
$ sudo dpkg -i influxdb_0.9.4_armhf.debStart server:
$ sudo service influxdb startTest server:
$ /opt/influxdb/influxNote: configuration file is located at: /etc/opt/influxdb/influxdb.conf
Telegraf
Install dependencies
$ sudo apt-get install rpmBuild package
Let's build Telegraf 0.1.9.
Setup a gvm package set:
$ gvm pkgset create telegraf
$ gvm pkgset use telegrafInstall godep:
$ go get github.com/tools/godepCheckout sources:
$ mkdir -p ~/.gvm/pkgsets/go1.5/telegraf/src/github.com/influxdb
$ cd ~/.gvm/pkgsets/go1.5/telegraf/src/github.com/influxdb
$ git clone https://github.com/influxdb/telegraf.gitBuild debian package:
$ cd telegraf
$ ./scripts/package.shRespond to questions:
...
Commence creation of unknown packages, version 0.1.9-27-gb4e8a23? [Y/n] Y
...
Publish packages to S3? [y/N] N
...
Install
Install package:
$ sudo dpkg -i telegraf_0.1.9-27-gb4e8a23_armhf.debStart server:
$ sudo service telegraf startConfiguration file is located at: /etc/opt/telegraf/telegraf.conf
Grafana
Install dependencies
$ sudo apt-get install ruby-dev rpm
$ sudo gem install fpmInstall nodejs
NOTE: You can skip that part if you already have node.js installed
Install pre-built binaries. In that case, we fetch the armv7l package for a Raspberry Pi 2:
$ sudo mkdir /opt/node
$ wget https://nodejs.org/dist/v4.1.2/node-v4.1.2-linux-armv7l.tar.gz
$ tar zxvf node-v4.1.2-linux-armv7l.tar.gz
$ sudo cp -r node-v4.1.2-linux-armv7l/* /opt/node
$ rm node-v4.1.2-linux-armv7l.tar.gzAdds those lines to /etc/profile juste before export PATH:
NODE_JS_HOME="/opt/node"
PATH="$PATH:$NODE_JS_HOME/bin"
Build package
Let's build Grafana 2.1.3.
Setup a gvm package set:
$ gvm pkgset create grafana
$ gvm pkgset use grafanaFetch sources:
$ go get github.com/grafana/grafana
$ cd ~/.gvm/pkgsets/go1.5/grafana/src/github.com/grafana/grafana/
$ git checkout tags/v2.1.3Setup build:
$ go run build.go setup
$ godep restore
$ npm install
$ sudo /opt/node/bin/npm install -g grunt-cliChange build.go file, line 76, with grunt("--force","release") to bypass an issue with phantomjs (cf. https://github.com/grafana/grafana/issues/2683).
Then fix a timeout issue:
$ sed -i 's/baseUrl: '\''.\/app'\'',/baseUrl: '\''.\/app'\'',waitSeconds: 0,/' tasks/options/requirejs.jsBuild package:
$ go run build.go build packageInstall
Install package:
$ sudo dpkg -i dist/grafana_2.1.3_armhf.debSetup service:
$ sudo update-rc.d grafana-server defaults 95 10Start server:
$ sudo service grafana-server startConfiguration files are located at: /etc/default/grafana-server and /etc/grafana/grafana.ini.
Create dashboards
Navigate with a browser to: http://RPI_IP:3000/
Authenticate with admin / admin credendials then change password at: http://RPI_IP:3000/profile/password.
Add the telegraf influxdb datasource as explained at: http://docs.grafana.org/datasources/influxdb/:
- Name: RPI-NAME
- Default: checked
- Type: InfluxDB 0.9.x
- Url: http://localhost:8086/
- Access: proxy
- Basic Auth: NOT checked
- Database: telegraf
- User: admin
- Password: admin
You can now create cool grafana dashboards. Enjoy.
