14 Nov 2015, 17:24

Grafana 2.6.0 sur Raspberry Pi (arm)

Après l'installation d'InfluxDB (d'ailleurs mis à jour pour la version 0.9.4), voici le tutoriel pour installer Grafana sur un Raspberry Pi 2 sous Debian Jessie.

# Install fpm (used to build deb/rpm package)
$ sudo apt install ruby-dev gcc rpm
$ sudo gem install fpm
# Install node from adafruit : https://learn.adafruit.com/node-embedded-development/installing-node-dot-js
$ curl -sLS https://apt.adafruit.com/add | sudo bash
$ sudo apt install node
# Install Go
$ wget https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer
$ chmod +x gvm-installer 
$ ./gvm-installer
$ source /home/pi/.gvm/scripts/gvm
$ gvm install go1.4.2 ; https://github.com/moovweb/gvm/issues/155
Downloading Go source...
Installing go1.4.2...
 * Compiling...
# Set default version of go
$ gvm use go1.4.2 --default
Now using version go1.4.2
$ gvm install go1.5.2 
Updating Go source... 
Installing go1.5.2... 
* Compiling... 
# Set default version of go 
$ gvm use go1.5.2 --default 
Now using version go1.5.2
$ gvm pkgset create grafana
$ gvm pkgset use  grafana
Now using version go1.5.2@grafana
$ go get github.com/tools/godep
$ go get -t -d github.com/grafana/grafana
$ cd .gvm/pkgsets/go1.5.2/grafana/src/github.com/grafana/grafana/
$ git checkout tags/v2.6.0
$ go run build.go setup
$ godep restore
# In package.json, remove/comment the karma-phantomjs-launcher line - cf https://github.com/grafana/grafana/issues/3515
$ npm install
$ sudo npm install -g grunt-cli
# Change build.go file, line 76, with grunt("--force","release") to bypass an issue with phantomjs (cf. https://github.com/grafana/grafana/issues/2683).
grunt("--force","release")
# Then fix a timeout issue:
$ sed -i 's/baseUrl: '\''.\/app'\'',/baseUrl: '\''.\/app'\'',waitSeconds: 0,/' tasks/options/requirejs.js
# In tasks/default_task.js and tasks/build_task.js, remove/comment the karma:test and phantomjs occurences 
# as phantomjs does not exist on arm yet - cf https://github.com/grafana/grafana/issues/3515
# Build package
$ go run build.go build package
# Install package
$ sudo dpkg -i dist/grafana_2.6.0_armhf.deb
# Launch Grafana
$ sudo systemctl enable grafana-server
$ sudo systemctl start grafana-server
# Acess Grafana
=> http://rasp.ip:3000/

Sources :

Edition du 14/12/2015 - Mise à jour pour Grafana 2.6 / Go 1.5+