Skip to content

Instantly share code, notes, and snippets.

@ssplatt
Last active March 12, 2024 20:28
Show Gist options
  • Save ssplatt/90adad25e8a18c58e749a8475f8f5a83 to your computer and use it in GitHub Desktop.
Save ssplatt/90adad25e8a18c58e749a8475f8f5a83 to your computer and use it in GitHub Desktop.
docker - prometheus with snmp_exporter, node_exporter, and cadvisor
version: "3"
services:
prometheus:
image: prom/prometheus
volumes:
- /opt/docker-persist/prometheus/data:/prometheus-data
ports:
- 9090:9090
restart: always
command: --config.file=/prometheus-data/prometheus.yml
snmp:
image: quay.io/prometheus/snmp-exporter
volumes:
- /opt/docker-persist/snmp-exporter:/etc/snmp_exporter
ports:
- 9116:9116
- 116:116/udp
restart: always
command: --config.file=/etc/snmp_exporter/snmp.yml
node_exporter:
image: quay.io/prometheus/node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
ports:
- 9100:9100
network_mode: host
restart: always
command:
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
- --collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)"
cadvisor:
image: google/cadvisor:latest
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
ports:
- 8084:8080
restart: always
@mbayat82
Copy link

Shouldn't the snmp UDP port be 161?

@dablyputs
Copy link

dablyputs commented Nov 13, 2023

Shouldn't the snmp UDP port be 161?

snmp can be configured to listen on a different port but 161 is the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment