Monitoring Linux Servers with Prometheus and Node Exporter

Prometheus has become the de facto standard for metrics collection in cloud-native and self-hosted Linux environments — a pull-based model that’s genuinely different from older push-based monitoring tools.

# node_exporter exposes host-level metrics (CPU, memory, disk, network)
wget https://github.com/prometheus/node_exporter/releases/latest/download/node_exporter-linux-amd64.tar.gz
tar xzf node_exporter-linux-amd64.tar.gz
./node_exporter &
# Metrics now available at http://localhost:9100/metrics
scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['localhost:9100']
    scrape_interval: 15s

Pull vs Push

Prometheus actively scrapes (pulls) metrics from targets on a schedule, rather than waiting for agents to push data to it — this makes it trivially easy to see whether a target is even reachable (a failed scrape is itself a signal), and avoids the need for every monitored host to know where to send its data.

Querying with PromQL

# Average CPU usage over the last 5 minutes
100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)

PromQL’s time-series-aware query language is what makes Prometheus genuinely powerful for alerting — you’re not just reading current values, you’re querying rates of change and trends over arbitrary time windows.