Skip to content

Instantly share code, notes, and snippets.

@OSCUK
Created March 12, 2022 16:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save OSCUK/c90222753d215ad57dae7b039f7d300a to your computer and use it in GitHub Desktop.
Save OSCUK/c90222753d215ad57dae7b039f7d300a to your computer and use it in GitHub Desktop.
Sudo su
Install Node Exporter:
docker run -d --net="host" --pid="host" -v "/:/host:ro,rslave" quay.io/prometheus/node-exporter:latest --path.rootfs=/host
Create Prometheus Config:
nano prometheus.yml
Insert below
--------------------------
global:
scrape_interval: 5s
external_labels:
monitor: 'node'
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['192.168.1.137:9090']
- job_name: 'node-exporter'
static_configs:
- targets: ['192.168.1.137:9100']
-------------------------------------
Install Prometheus:
docker run -d --name prometheus -p 9090:9090 -v /home/al/prometheus.yml prom/prometheus
Install Grafana:
docker run -d --name=grafana -p 3456:3000 grafana/grafana
Additional Notes
Select DataSource on home page. Select Prometheus.
Search for: "node exporter grafana dashboards" on Google
Look for results on grafana.com
Find ID of the dashboard you like
Dashboard types https://grafana.com/grafana/dashboards
Dashboard Codes: 11074 - 12559 - 9614
Import ID in Grafana
docker run \
-p 9090:9090 \
-v /opt/prometheus/prometheus.yml:/opt/prometheus/prometheus.yml \
prom/prometheus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment