Introduction: Overview of Grafana, Prometheus, and Node Exporter

Tool Description

Grafana: Grafana is an open-source platform for monitoring and observability that allows you to create, explore, and share dashboards and data visualizations.

Prometheus: Prometheus is an open-source monitoring and alerting toolkit designed for reliability and scalability, known for its dimensional data model and powerful query language (PromQL).

Node Exporter: Node Exporter is a Prometheus exporter for system metrics, exposing various system-level metrics about CPU, memory, disk usage, and more, which Prometheus can then scrape and store.

Benefits of using these tools together

Prerequisites

Necessary permissions and access

Firewall Rules (UFW): Open port 3000 for Grafana: sudo ufw allow 3000.

Hosts File Configuration: Modify /etc/hosts to include:

127.0.0.1:3000      172.16.x.xxx

Replace 172.16.x.xxx with your IP address.

Installing Grafana on Ubuntu

Downloading Grafana for Ubuntu: Download Grafana OSS edition if not using Docker.

Setting up Grafana:

Installing Prometheus on Ubuntu

Downloading Prometheus for Ubuntu: Download tar.gz from the Prometheus download page.

Installing Prometheus:

Installing Node Exporter on Ubuntu

Downloading Node Exporter for Ubuntu: Download from Node Exporter download page.

Installing Node Exporter:

Configuring Node Exporter as a service

Remove existing prometheus.yml file:

rm -rf /etc/prometheus/prometheus.yml

Create a new file and enter the following:

vi /etc/prometheus/prometheus.yml
global:
  scrape_interval: 15s

scrape_configs:
  - job_name: node
    static_configs:
      - targets: ['172.16.1.141:9100'] # Replace with your own IP

Reload systemd, start Prometheus, and check status:

systemctl daemon-reload
systemctl restart prometheus
systemctl status prometheus

Accessing Grafana and Creating a New Connection

Access Grafana: Open your browser and go to http://<your_ip>:3000 (e.g., http://172.16.1.141:3000).

Create a New Connection:


Written by A.M. Rinas