Skip to content

Instantly share code, notes, and snippets.

@arsalanses
Last active October 12, 2025 08:24
Show Gist options
  • Select an option

  • Save arsalanses/26f5660068b6adcc2f28906bf31512b2 to your computer and use it in GitHub Desktop.

Select an option

Save arsalanses/26f5660068b6adcc2f28906bf31512b2 to your computer and use it in GitHub Desktop.
node-exporter
services:
node_exporter:
image: prom/node-exporter:latest
container_name: node_exporter
ports:
- "127.0.0.1:9100:9100"
command:
- '--web.config.file=/opt/web-config.yml'
- '--path.rootfs=/host'
- '--collector.disable-defaults'
- '--collector.cpu'
- '--collector.meminfo'
- '--collector.netdev'
- '--collector.diskstats'
- '--collector.filesystem'
- '--collector.uname'
- '--collector.loadavg'
- '--collector.netstat'
- '--collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($$|/)'
# network_mode: host
pid: host
restart: unless-stopped
volumes:
- '/:/host:ro,rslave'
- './web-config.yml:/opt/web-config.yml'
scrape_configs:
# =========================================
# ===============> node exporters
# =========================================
- job_name: 'node-exporter'
static_configs:
- targets: ['255.255.255.255:9100']
labels:
instance: 'server1'
- targets: ['255.255.255.255:9200']
labels:
instance: 'server2'
basic_auth:
username: 'admin'
password: 'admin'
basic_auth_users:
admin: $2y$10$98vNJ8bnR.pOoftAu51G4ODisZL6R9kRDiAXwLjvYVDM2W.OWsoCW
# htpasswd -nBC 10 "" | tr -d ':\n'
# 1234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment