Difference between revisions of "Grafana"
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Originally written by Grant Reed | Originally written by Grant Reed | ||
+ | |||
+ | (you will need '''gnupg''') | ||
==How To Install Grafana on Linux Mint 20== | ==How To Install Grafana on Linux Mint 20== | ||
Line 51: | Line 53: | ||
Default user is admin/admin and it will make you change the password | Default user is admin/admin and it will make you change the password | ||
− | + | ==Using this with Node Red== | |
+ | [[Node-RED - with Grafana|Watch this space...]] | ||
==Connecting with InfluxDB== | ==Connecting with InfluxDB== | ||
Line 89: | Line 92: | ||
There IS a solution! | There IS a solution! | ||
− | * Duplicate the tab | + | *Duplicate the tab |
− | * Login on the duplicate tab | + | *Login on the duplicate tab |
− | * Return to the one you were working in | + | *Return to the one you were working in |
− | * & pretend it never happened. | + | *& pretend it never happened. |
+ | |||
+ | And a way to decrease the annoyance (found [https://community.grafana.com/t/admin-getting-logged-out-frequently/37953/3 here]): | ||
+ | |||
+ | *Edit the [https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/ configuration] | ||
+ | **<code>sudo vi /etc/grafana/grafana.ini</code> | ||
+ | *Change <code>token_rotation_interval_minutes</code> to something larger than the default of '''10''' minutes. | ||
+ | *There also seems to be mention of changing <code>login_maximum_inactive_lifetime_days</code> but it doesn't seem to exist. (Possibly <code>login_maximum_inactive_lifetime_duration</code>?) | ||
+ | |||
+ | The documentation does not seem to mention it, but I suspect you need to restart Grafana after editing the configuration... | ||
+ | |||
+ | *<code>sudo systemctl start grafana-server</code> |
Latest revision as of 19:03, 12 March 2023
Originally written by Grant Reed
(you will need gnupg)
Contents
How To Install Grafana on Linux Mint 20
https://grafana.com/docs/grafana/latest/installation/debian/
Installation was tested on a fresh VM of Mint 20 so if i screwed something up, it wasn't going to be my Automation server
There are 2 versions that could be installed -OSS and Enterprise. It is suggested by Grafana to install the Enterprise version for stability. We will be installing the latest version in this setup. Run the following in a teminal window that is local or SSH'd into your system that will host it...
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
Add the repository to the list and install
echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana-enterprise
Start the Server
sudo systemctl daemon-reload
sudo systemctl start grafana-server
Verify that its running properly
sudo systemctl status grafana-server
Now configure it to start at boot
sudo systemctl enable grafana-server.service
Package details
- Installs binary to
/usr/sbin/grafana-server
- Installs Init.d script to
/etc/init.d/grafana-server
- Creates default file (environment vars) to
/etc/default/grafana-server
- Installs configuration file to
/etc/grafana/grafana.ini
- Installs systemd service (if systemd is available) name
grafana-server.service
- The default configuration sets the log file at
/var/log/grafana/grafana.log
- The default configuration specifies a SQLite3 db at
/var/lib/grafana/grafana.db
- Installs HTML/JS/CSS and other Grafana files at
/usr/share/grafana
Getting Started with Grafana
The home for this information is here:
https://grafana.com/docs/grafana/latest/getting-started/getting-started/
Open a browser to your new Grafana install, in my case its 192.168.1.139:3000
Default user is admin/admin and it will make you change the password
Using this with Node Red
Connecting with InfluxDB
https://grafana.com/docs/grafana/latest/datasources/influxdb/
Open up the Web-GUI for Grafana ('ServerName:3000). Log in and click on the Configuration icon (looks like a gear) on the left tab. One of the options will be Data Sources. Click that and select Add Data Source.
Give the data source a meaningful name. I gave mine 'InfluxDB'. Select InfluxDB under Time series databases.
My databases are not set up for authorization or credentials since this setup will not be allowed to go play in the streets so all auth is turned off.
This will open a screen titled Data Sources / InfluxDB
Give this new data source a Name (or leave it as the default of InfluxDB).
Leave Query Language as the default InfluxQL.
Fill in the URL box with the address of your database server. (On a typical installation, with the database & Grafana on a single machine, this will be http://localhost:8086)
Scroll down to InfluxDB Details.
Put in the name of your new database.
Put in the username and password.
Optional: Select the type of http access you want. The simple version is GET. If you are going to be doing long requests then select 'POST.
Hit Save and Test.
You should get a green bar that says Data source is working.
You are connected to the proper database and all is well.
Oddities & Issues
If you keep the UI web page open for a while, sometimes it'll log you out without giving ANY indication that it's done so. If you happen to have a dashboard open that you're working on & try to save it, Grafana will say "NO!". At this point, attempting to log in will throw away your edits.
There IS a solution!
- Duplicate the tab
- Login on the duplicate tab
- Return to the one you were working in
- & pretend it never happened.
And a way to decrease the annoyance (found here):
- Edit the configuration
sudo vi /etc/grafana/grafana.ini
- Change
token_rotation_interval_minutes
to something larger than the default of 10 minutes. - There also seems to be mention of changing
login_maximum_inactive_lifetime_days
but it doesn't seem to exist. (Possiblylogin_maximum_inactive_lifetime_duration
?)
The documentation does not seem to mention it, but I suspect you need to restart Grafana after editing the configuration...
sudo systemctl start grafana-server