Docker:prometheus/exporter/Grafana/Other Docker pull

載入Docker:

docker pull prom/alertmanager:latest
docker pull prom/collectd-exporter:latest
docker pull prom/container-exporter:latest
docker pull prom/prometheus:latest
docker pull prom/snmp-exporter:latest
docker pull grafana/grafana
docker pull clawsicus/dump1090exporter

建立資料夾:

mkdir /prometheus-data

建立設定檔:

nano /prometheus-data/prometheus.yml
global:
  scrape_interval:     30s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 20s # Evaluate rules every 15 seconds. The default is every 1 minute.

alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093
rule_files:
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
  - job_name: 'node'
    static_configs:
      - targets: ['10.0.1.114:9100']
  - job_name: 'pve'
    static_configs:
      - targets: ['10.0.1.114:9221']

建立Docker(註:9090如果有被Cockpit佔用請改用9091):

docker run -p 9090:9090 -v /prometheus-data/prometheus.yml:/etc/prometheus/prometheus.yml -v /prometheus-data  prom/prometheus

9091:
docker run -p 9091:9090 -v /prometheus-data/prometheus.yml:/etc/prometheus/prometheus.yml -v /prometheus-data  prom/prometheus

Grafana:

docker run -d --name=grafana -p 3000:3000 grafana/grafana

docker pull:

docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:rw \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--publish=8001:8080 \
--detach=true \
--restart always \
--name=cadvisor \
google/cadvisor:latest

docker run --restart always -p 9104:9104 -v /sys/fs/cgroup:/cgroup \
           -v /var/run/docker.sock:/var/run/docker.sock prom/container-exporter

docker run -d --name chrome -p 8083:8083 -p 5900:5900 oldiy/chrome-novnc:latest
docker run -p 9105:9105   --detach   --restart always clawsicus/dump1090exporter --url=http://dump1090_IP:8080  --latitude=緯度  --longitude=經度

Ubuntu 18.04 Xface NoVNC:

mkdir ubuntu-xfce-vnc && nano docker-compose.yml

version: '3.5'

services:
    ubuntu-xfce-vnc:
        container_name: xfce
        image: imlala/ubuntu-xfce-vnc-novnc:latest
        shm_size: "1gb"
        ports:
            - 5900:5900
            - 6080:6080
        environment: 
            - VNC_PASSWD=
            - GEOMETRY=1280x768
            - DEPTH=24
        volumes: 
            - ./Downloads:/root/Downloads
        restart: unless-stopped
阅读剩余
THE END