Open skysolf2 opened 1 month ago
my compose.yaml
version: "3.9"
services:
grafana:
image: grafana/grafana:latest
container_name: Grafana
hostname: grafana
networks:
- grafana_net
mem_limit: 512m
cpu_shares: 512
security_opt:
- no-new-privileges:true
user: 0:0
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:3000/api/health
ports:
- 3340:3000
volumes:
- /volume1/docker/metrics/grafana:/var/lib/grafana:rw
environment:
TZ: Asia/Shanghai
GF_INSTALL_PLUGINS: grafana-clock-panel,grafana-simple-json-datasource,natel-discrete-panel,grafana-piechart-panel
restart: unless-stopped
prometheus:
image: prom/prometheus
command:
- '--storage.tsdb.retention.time=60d'
- '--config.file=/etc/prometheus/prometheus.yml'
container_name: Prometheus
hostname: prometheus
networks:
- grafana_net
- prometheus_net
mem_limit: 1g
cpu_shares: 768
security_opt:
- no-new-privileges=true
user: 0:0
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:9090/ || exit 1
volumes:
- /volume1/docker/metrics/prometheus:/prometheus:rw
- /volume1/docker/metrics/prometheus.yml:/etc/prometheus/prometheus.yml:ro
restart: unless-stopped
node-exporter:
image: prom/node-exporter:latest
command:
- --collector.disable-defaults
- --collector.stat
- --collector.time
- --collector.cpu
- --collector.loadavg
- --collector.hwmon
- --collector.meminfo
- --collector.diskstats
container_name: Node_Exporter
hostname: nodeexporter
networks:
- prometheus_net
mem_limit: 256m
mem_reservation: 64m
cpu_shares: 512
security_opt:
- no-new-privileges=true
read_only: true
user: 0:0
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:9100/
restart: unless-stopped
snmp-exporter:
image: prom/snmp-exporter:latest
command:
- '--config.file=/etc/snmp_exporter/snmp.yml'
container_name: SNMP_Exporter
hostname: snmp
networks:
- prometheus_net
mem_limit: 256m
mem_reservation: 64m
cpu_shares: 512
security_opt:
- no-new-privileges:true
read_only: true
user: 0:0
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:9116/ || exit 1
volumes:
- /volume1/docker/metrics/snmp.yml:/etc/snmp_exporter/snmp.yml:ro
restart: unless-stopped
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
command:
- '--docker_only=true'
container_name: cAdvisor
hostname: cadvisor
networks:
- prometheus_net
mem_limit: 256m
mem_reservation: 64m
cpu_shares: 512
security_opt:
- no-new-privileges=true
read_only: true
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
speedtest_exporter:
image: ghcr.io/danopstech/speedtest_exporter:latest
container_name: speedtest_exporter
hostname: speedtest
networks:
- prometheus_net
security_opt:
- no-new-privileges=true
read_only: true
user: 0:0
restart: unless-stopped
networks:
grafana_net:
name: grafana_net
ipam:
config:
- subnet: 172.22.1.0/24
prometheus_net:
name: prometheus_net
ipam:
config:
- subnet: 172.22.0.0/24
I am sorry, I am not able to provide individual support and debug for non-standard configurations because that would mean I have to replicate this on my Synology first.
Things that are not following the instruction:
There might be more, I haven't seen the rest of your setup. Try following the instructions exactly and it really should just work because it works for most users. If you do follow all the instructions exactly and still encounter an issue, I will be able to help. It is possible you hit some corner case that does not work for your setup, but I won't be able to figure out what exactly is causing the issue if we change 10 other things at the same time.
I would start off by making sure firewall settings are okay (or fw is off completely), this is usually the number one reason for things not working in Docker.
I do everything follow your readme file. enable synology snmp v3,set user name is zhangsan,and en set two diff password
change snmp.yaml username,password,and priv_password
change your_real_host_ip to my nas ip 192.168.31.2
after run it container snmp-expertor allways shows error: ts=2024-07-24T15:55:53.555Z caller=collector.go:367 level=info auth=snmpv3 target=192.168.31.2 source_address= worker=0 module=synology msg="Error scraping target" err="scrape cancelled after 5.000240416s (possible timeout) getting target 192.168.31.2"