Prometheus vs Zabbix: Install, Configure & Visualize with Grafana
This article compares Prometheus with Zabbix, walks through downloading and installing Prometheus, explains the key sections of prometheus.yml, shows how to add a node_exporter for machine metrics, and demonstrates integrating Grafana to create rich monitoring dashboards.
1. Prometheus vs Zabbix
Both are open‑source monitoring systems, but Prometheus is more modular and flexible. Its components (alerting, exporters, etc.) can be configured independently, while Zabbix provides a monolithic, heavyweight installation. Prometheus uses a pull model and stores data locally, whereas Zabbix relies on push agents.
2. Installing Prometheus
Download the latest tarball from the official site, extract it, and run the server directly:
$ wget https://github.com/prometheus/prometheus/releases/download/v2.7.2/prometheus-2.7.2.linux-amd64.tar.gz
$ tar xvfz prometheus-2.7.2.linux-amd64.tar.gz
$ cd prometheus-2.7.2.linux-amd64
$ ./prometheus --version # verify
$ ./prometheus --config.file=prometheus.yml # start serverThe
prometheus.ymlfile in the same directory holds the configuration.
3. Configuring Prometheus
The configuration file is divided into four main sections:
global : sets
scrape_intervaland
evaluation_interval.
alerting : configures Alertmanager (not installed in this guide).
rule_files : lists rule files for alerting.
scrape_configs : defines the targets to scrape. By default it monitors the Prometheus server itself.
Example snippet:
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']4. Prometheus UI
After starting the server, open
http://<i>host</i>:9090in a browser. The interface shows tabs for Alerts, Graph, and Status. The Graph tab can query metrics such as
promhttp_metric_handler_requests_total.
5. Adding Machine‑State Monitoring
Install the
node_exporterto expose hardware metrics:
$ wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
$ tar xvfz node_exporter-0.17.0.linux-amd64.tar.gz
$ cd node_exporter-0.17.0.linux-amd64
$ ./node_exporter # runs on port 9100Update
prometheus.ymlto scrape the new target:
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']Reload Prometheus and verify the new target appears as “UP” in the Status → Targets page.
6. Installing Grafana
Download and extract the binary package, then start the server:
$ wget https://dl.grafana.com/oss/release/grafana-6.0.0.linux-amd64.tar.gz
$ tar -zxvf grafana-6.0.0.linux-amd64.tar.gz
$ cd grafana-6.0.0
$ ./bin/grafana-server webGrafana runs on port 3000 by default.
7. Visualizing Metrics in Grafana
Log in (admin/admin), add a Prometheus data source pointing to
http://localhost:9090, then import ready‑made dashboards (e.g., “Prometheus 2.0 Stats” or a node_exporter dashboard). After loading the dashboard, you can see system‑level graphs such as CPU, memory, and disk usage.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.