Skip to content

installing 05 grafana

yOyOeK1 edited this page Jan 31, 2022 · 2 revisions

Grafana is a service to analyze data in some way. It's a set of tools to easy create what you want to see next to another.

We will start in termux terminal or ssh to it. Command

$ pkp install proot-distro

it will install proot - we need it to have even more linux enviroment. We will get debian :) we will do it by next command

$ proot-distro install debian

it will make all steps to install proot with debian. Let's login to it by using command.

$ proot-distro login debian

you need to notice that prompt changed from $ | to root@localhost:# |

we are in debian now. First let's update it by using command

@proot-debian$ apt update

@proot-debian$ apt upgrade

@proot-debian$ apt install wget libfontconfig1

now you can check what is the newest version of grafana at grafana.com I will use 8.3.4 for debian for armhf

you can check what you need for your need by entering command

@proot-debian@ uname -a

look for arm

for me it's

Linux localhost 5.4.0-faked #1 SMP PREEMPT Fri Aug 14 14:03:29 KST 2020 armv7l GNU/Linux

so I can see arm7vl and when I was installing wget and libfontconfig1 there was a lot of armhf. It's for me hint that I need armv7 or armhf

at https://grafana.com/grafana/download?platform=arm you can find debian ubuntu armv7

for me it's https://dl.grafana.com/enterprise/release/grafana-enterprise_8.3.4_armhf.deb I will download it by using

@proot-debian$ wget "https://dl.grafana.com/enterprise/release/grafana-enterprise_8.3.4_armhf.deb"

it will download it. And then to install it you need to run

@proot-debian$ dpkg -i ./grafana-enterprise_8.3.4_armhf.deb

we need to set some config file by using command

@proot-debian$ nano /etc/grafana/grafana.ini

find line ";data = ..." set it to

data = /usr/share/grafana

find ";protocal = ..." set it to

protocol = http

find ";http_port = ..." set it to

http_port = 3000

find ";domain = ...." set it to

domain = localhost

Ok now save changes by pressing CTRL-x and y and confirm by entre. Let's test it.

testing grafana

Assuming that we are still in proot-distro of debian we need to change directory to grafana home directory.

@proot-debian$ cd /usr/share/grafana

@proot-debian$ grafana-server

you should see a lot of logs info logs on a screen. When it quiets down open web browser and go to http://192.168.43.241:3000 your ip address can be different. You should be welcomed witch grafana login screen. :)

ok

now we need to make it starting by it self. To kill process CTRL-c in the terminal were we enterd grafana-server command. Ender command

@proot-debian$ cd

to go to home directory

_@proot-debian$ nano ./sGrafana.sh

enter this into file

`#!/bin/bash

cd /usr/share/grafana

grafana-server `

to save CTRL-x and y and enter to confirm. next permissions to execute this as a script is.

@proot-debian$ chmod +x ./sGrafana.sh

file is now executable.

exit proot-debian by writing

@proot-debian$ exit

you will get logout and prompt will go back to ~$ | you are in termux terminal. Now add grafana as a service in termux. command.

$ nano ./startGrafana.sh

` #!/data/data/com.termux/files/usr/bin/sh

proot-distro login debian -- /root/sGrafana.sh `

and CTRL-X and y and confirm with enter to exit.

Change permissions by executing.

$ chmod +x ./startGrafana.sh

So now we have a script in termux terminal to start proot-debian and after login to it it will start grafana. Nice!

Wee need to add all of this to services.

$ cd $PREFIX/var/service/

$ mkdir grafana

$ mkdir -p ./grafana/log

$ ln -sf $PREFIX/share/termux-services/svlogger $PREFIX/var/service/grafana/log/run

$ nano ./grafana/run

in file we need to add

`#!/data/data/com.termux/files/usr/bin/sh

exec /data/data/com.termux/files/home/startGrafana.sh 2>&1 `

to save CTRL-x and y and enter to confirm. Commands

$ chmod +x ./grafana/run

to make it executable :)

$ sv up grafana

$ sv-enable grafana

Restart termux and check if all is ok by going to web browser and adress http://192.168.43.241:3000

Clone this wiki locally