Granadilla: Difference between revisions

From Sea of Fate
Jump to navigationJump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Introduction==
==Introduction==


Granadilla on x.x.x.13 in the Infra network is the host to the Grafana installation that is used to view the data collected by Prometheus on '''[[Pineapple]]'''. It will also display the historical data from Victoria Metrics stored on Victoria
Granadilla on x.x.x.13 in the Infra network is the host to the Grafana installation that is used to view the data collected by Prometheus on '''[[Pineapple]]'''. It will also display the historical data from Victoria Metrics stored on Victoria. A more general overview of the capabilities available with a pairing of '''[[Prometheus & Grafana ]]''' can be found '''[[Prometheus & Grafana | here]]'''


==Installation of Grafana==
==Installation of Grafana==


The purpose to provide a web-based user interface for visualizing and analyzing metrics collected by Prometheus (and stored in VictoriaMetrics).Grafana will be installed using Grafana's official APT repository (recommended for latest stable versions and easy updates on Ubuntu). We will need to add the Grafana repository
The purpose to provide a web-based user interface for visualizing and analyzing metrics collected by Prometheus (and stored in VictoriaMetrics).Grafana will be installed using Grafana's official APT repository (recommended for latest stable versions and easy updates on Ubuntu). We will need to add the Grafana repository. There are a few steps to adding a new repository that we will need to do before we actually start on the Graffana installation.
=== Install the Grafana Repository===
The first step is the well known
sudo apt update && sudo apt upgrade -y
Installed necessary dependencies for adding repositories:
sudo apt install -y apt-transport-https software-properties-common wget
Downloaded and added Grafana's GPG public key:
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/grafana.gpg > /dev/null
and finally add the stable Grafana repository to APT sources:
echo "deb [signed-by=/usr/share/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
we now do an APT update so with the new recognized the new repository:
sudo apt update
===Install Grafana===
We can now install Grafana from the newly added repository :
sudo apt install -y grafana
With the Grafana application installed we can now start the service, have it start on boot and, of course, check the status
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
sudo systemctl status grafana-server
The status should show the service as active and running.
===Configure Gafanaa===
The base install will have Grafana's webserver listening on port 3000. Unless that has been changed we should now use Lemon to http://granadilla:3000. The Login credentials are admin / admin. The first thing to do is to add the Prometheus sever as a data source, navigate to Connections -> Data Sources -> Add data source -> Prometheus. The URL should be the Ip address of  Pinapple:9090 (exactly the same as the webserver) http://x.x.x.x:9090. to finish adding the data source the is a button at the bottom  marked "save & test" If we have already set up VictoriaMetrics we can set that as a data source as well by following the exact same instructions as above except the URL will be Victoria's IP address and port 8428 with the /prometheus directory so it will be http://x.x.x.x:8428/prometheus. This works for VictoriaMetrics because it follows the same API as Prometheus.
With the data sources added we can now add a few dashboards. Navigate to Dashboards -> New -> Import and in the "Find and import dashboards for common applications at grafana.com/dashboards" box enter 1860. 1860 is the Node_exporter dashboard other dashboards that are likely to be useful are
* For MySQL use 7362
* For Nginx use 12604
* For Apache use 1869
* For Windows  use 11074
* For ZFS use  7968
* For SMART use 22604
 
With the addition of the dashboards the install is complete. From her we will need to look at changing data sources and modifying that dashboards themselves but that is a much longer process and will need to read some of the documentation for Garafana and https://grafana.com/docs/ would be a good place to start.

Latest revision as of 12:40, 6 June 2025

Introduction

Granadilla on x.x.x.13 in the Infra network is the host to the Grafana installation that is used to view the data collected by Prometheus on Pineapple. It will also display the historical data from Victoria Metrics stored on Victoria. A more general overview of the capabilities available with a pairing of Prometheus & Grafana can be found here

Installation of Grafana

The purpose to provide a web-based user interface for visualizing and analyzing metrics collected by Prometheus (and stored in VictoriaMetrics).Grafana will be installed using Grafana's official APT repository (recommended for latest stable versions and easy updates on Ubuntu). We will need to add the Grafana repository. There are a few steps to adding a new repository that we will need to do before we actually start on the Graffana installation.

Install the Grafana Repository

The first step is the well known

sudo apt update && sudo apt upgrade -y

Installed necessary dependencies for adding repositories:

sudo apt install -y apt-transport-https software-properties-common wget

Downloaded and added Grafana's GPG public key:

wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/grafana.gpg > /dev/null 

and finally add the stable Grafana repository to APT sources:

echo "deb [signed-by=/usr/share/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list

we now do an APT update so with the new recognized the new repository:

sudo apt update

Install Grafana

We can now install Grafana from the newly added repository :

sudo apt install -y grafana

With the Grafana application installed we can now start the service, have it start on boot and, of course, check the status

sudo systemctl start grafana-server
sudo systemctl enable grafana-server
sudo systemctl status grafana-server

The status should show the service as active and running.

Configure Gafanaa

The base install will have Grafana's webserver listening on port 3000. Unless that has been changed we should now use Lemon to http://granadilla:3000. The Login credentials are admin / admin. The first thing to do is to add the Prometheus sever as a data source, navigate to Connections -> Data Sources -> Add data source -> Prometheus. The URL should be the Ip address of Pinapple:9090 (exactly the same as the webserver) http://x.x.x.x:9090. to finish adding the data source the is a button at the bottom marked "save & test" If we have already set up VictoriaMetrics we can set that as a data source as well by following the exact same instructions as above except the URL will be Victoria's IP address and port 8428 with the /prometheus directory so it will be http://x.x.x.x:8428/prometheus. This works for VictoriaMetrics because it follows the same API as Prometheus. With the data sources added we can now add a few dashboards. Navigate to Dashboards -> New -> Import and in the "Find and import dashboards for common applications at grafana.com/dashboards" box enter 1860. 1860 is the Node_exporter dashboard other dashboards that are likely to be useful are

  • For MySQL use 7362
  • For Nginx use 12604
  • For Apache use 1869
  • For Windows use 11074
  • For ZFS use 7968
  • For SMART use 22604

With the addition of the dashboards the install is complete. From her we will need to look at changing data sources and modifying that dashboards themselves but that is a much longer process and will need to read some of the documentation for Garafana and https://grafana.com/docs/ would be a good place to start.