Have you ever wondered what’s actually happening inside a Linux server?
As a DevOps engineer and learner, you will eventually move past "just running commands" to actually observing your infrastructure to know what is happening under the hood.
So I built a simple observability stack using Prometheus and Grafana, which I called "Linux Health Sentinel". This guide walks you through that exact beginner-friendly setup to see how data flows from a raw event to a visual graph.
🔍 Monitoring vs. Observability: What's the Difference?
Before diving in, it's important to understand these two core concepts in DevOps and cloud environments:
- Monitoring: Tells you if a system is working and/or if something is broken (e.g., "Is the CPU over 80%?").
- Observability: helps you understand why. by looking at the data—the "signals"—the system emits.
Observability is a system, not just a tool:
sensors → data pipeline → dashboard
The 4 phases of observability
- Phase 1 → Instrumentation (Sensors) Tools that emit signals from infrastructure and apps. (on the target)
- Phase 2 → Collection (The Pipeline) Collectors clean, label, and route the data.
- Phase 3 → Storage (The Library) Metrics, logs, and traces live in optimised databases.
- Phase 4 → Visualisation & Alerting Dashboards + alerts turn data into action.
Project Goal
Visualise the real-time CPU, memory, and disc health of an Ubuntu VM using the industry-standard Prometheus and Grafana stack.
🛠️ The Tech Stack
Target → VM
Control Center → Laptop
To build my sentinel, I used the "Golden Trio" of open-source observability:
- Node Exporter: The "spy/sensor and collector" on the VM (target) that gathers hardware stats.
- Prometheus: The "brain and storage" that pulls data and stores it in a time-series database.
- Grafana: The "face" that turns raw numbers into beautiful, readable dashboards.
🚀 Step-by-Step Implementation
Step 1: Set Up the "Target" (VirtualBox VM)
This VM represents a production server in a data centre.
a. Network Setup (Crucial): * In VirtualBox, select your VM > Settings > Network.
- Change "Attached to" from NAT to Bridged Adapter.
- Why? This gives the VM an IP address on your home network so your laptop can "talk" to it.
b. Start the VM and find its IP address:
hostname -I
Note this down; let's assume it is 192.168.1.50
c. Install the "Spy" (Node Exporter):
Node Exporter is a small tool that translates Linux system stats into a format Prometheus understands.
sudo apt update
sudo apt install prometheus-node-exporter -y
d. Verify: Open the browser on your laptop and go to http://192.168.1.50:9100/metrics. If you see a wall of text, the spy is active.
Step 2: Set Up the "Control Center" (Your Laptop)
Your laptop will act as the monitoring server that "pulls" data from the VM.
a. Install Prometheus (The Database):
sudo apt update
sudo apt install prometheus -y
b. Configure Prometheus to watch the VM: Edit the configuration file:
sudo nano /etc/prometheus/prometheus.yml
Scroll to the end and add this "job":
- job_name: 'ubuntu_vm'
static_configs:
- targets: ['192.168.1.50:9100']
Save and Exit (Ctrl+O, Enter, Ctrl+X).
c. Restart Prometheus:
sudo systemctl restart prometheus
Step 3: Visualise with Grafana
a. Install Grafana:
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/grafana.gpg > /dev/null
sudo apt update && sudo apt install grafana -y
sudo systemctl enable --now grafana-server
b. Access Grafana: Open http://localhost:3000 (User/Pass: admin/admin).
c. Connect the dots:
- Go to Connections > Data Sources > Add Data Source.
- Select Prometheus.
- Set URL to http://localhost:9090. Click Save & Test.
d. Import the Pro Dashboard:
- Click the + (top right) > Import.
- Enter ID 1860 (this is the community standard for Node Exporter).
- Select your Prometheus data source and click Import.
💡 The Result
With just a VM, Prometheus, and Grafana, we built a real observability pipeline.
We can now see CPU, memory, and disk metrics in real time, exactly how production monitoring works in professional environments.
This small project is the foundation of modern DevOps observability. From here, you can explore:
- alerting with Alertmanager
- container monitoring
- Kubernetes observability
- logs and distributed tracing
Observability isn’t just about dashboards; it’s about understanding your systems deeply.



Top comments (0)