Synology: Grafana and Prometheus Dashboard Part 2

Synology Grafana and Prometheus Dashboard Part 2

Have you installed Grafana monitored by Prometheus following my step by step guide to display system metrics for your Synology NAS server? After countless requests, guide number two has arrived. In today’s guide I will show you how to add more NAS devices metrics to your Grafana dashboard installed on your main NAS.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Grafana and Prometheus Dashboard on your main NAS system.

  • STEP 3

Use the guide below to Install Prometheus on your second NAS that you want to monitor on your main NAS. Note: Do not confuse and do not install Grafana on the second NAS. You should install Grafana only on the main NAS.

  • STEP 4

Install Text Editor (second NAS) via Synology ā€œPackage Centerā€. (Mandatory STEP.) If you already have Text Editor installed on your Synology NAS, skip this STEP.

Synology Install Text Editor 2023

  • STEP 5

Install Container Manager (second NAS) via Synology ā€œPackage Centerā€. If you run an older DSM version (under 7.2), search forĀ DockerĀ instead of Container Manager.

Download Container Manager Synology Docker

  • STEP 6

Install (second NAS)Ā Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 7

Firewall Setup (second NAS):Ā If your Synology NAS Firewall is deactivated, Skip the guide from STEP 7 to STEP 15. If your Synology NAS Firewall is activated, go to Control Panel / Security / Firewall tab then click Edit Rules on your current Firewall profile. Follow the instructions in the image below. Note: You can also move the SNMP firewall Rule above the deny Rule and map your internal network.

1 Synology Grafana Dashboard Part 2

  • STEP 8

A new window will open click Create. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 2 new

  • STEP 9

After you click Create at STEP 8 a new window will open. Choose “Select from a list of built-in applications” then click Select. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 3 new

  • STEP 10

From the Built-in Applications check SNMP service then click OK. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 4new

  • STEP 11

After you click OK at STEP 10, choose “Specific IP” then click Select. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 4 new

  • STEP 12

Choose IP range. Add From: 192.168.49.0 To: 192.168.52.0 then click OK. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 5new

  • STEP 13

Click OK. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 6 new

  • STEP 14

Your new Docker Firewall rule will be ABOVEĀ theĀ Deny rule. Move it from the last position to the third position or any position above the Deny rule. Click OKĀ to save the Firewall Settings. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 7new

  • STEP 15

Click OK. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 2 Part 8 new

  • STEP 16

Go toĀ File Station (second NAS) and open the docker folder. Inside the docker folder, create one new folder and name it prometheus. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

8 Synology Grafana Dashboard Part 2

  • STEP 17

Now create two new folders (second NAS) inside the prometheus folder that you created at STEP 16Ā and name themĀ prometheus andĀ snmp.Ā Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

9 Synology Grafana Dashboard Part 2

  • STEP 18

Download (click on the blue link below) then upload the prometheus.yml file below in the prometheus folder that you have previously created at STEP 16. Follow the instructions in the image below. šŸ”’Note: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!

šŸ‘‰šŸ»Download prometheus.yml

10 Synology Grafana Dashboard Part 2

  • STEP 19

Download (click on the blue link below) then upload the snmp.yml file below in the snmp folder that you have previously created at STEP 17. Follow the instructions in the image below. šŸ”’Note: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!

šŸ‘‰šŸ»Download snmp.yml

11 Synology Grafana Dashboard Part 2

  • STEP 20

Make sure you have installed Synology Text Editor as per the instructions at STEP 4. Double click on the prometheus.yml file (second NAS) then type in your own local NAS IP instead of 192.168.1.132 which is my own local NAS IP. Click X to save the file. Follow the instructions in the image below.

12 Synology Grafana Dashboard Part 2 new

  • STEP 21

Make sure you have installed Synology Text Editor as per the instructions at STEP 4. Double click on the snmp.yml file (second NAS) that you have previously uploaded at STEP 19. Go to Control Panel / Terminal & SNMP / SNMP tab / Check Enable SNMP service. Check SNMPv3 service. Check Enable SNMP privacy. Copy paste the username and passwords from the snmp.yml file in the SNMP fields, then click Apply. Follow the instructions in the image below.

Synology Grafana Prometheus Dashboard 16 new

  • STEP 22

Log into Portainer using your username and password (second NAS). On the left sidebar in Portainer, click on StacksĀ thenĀ + Add stack. Follow the instructions in the image below.

1 Synology Portainer Add Stack

  • STEP 23

In the Name field type in dashboard2. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

services:
  prometheus:
    image: prom/prometheus
    command:
      - '--storage.tsdb.retention.time=60d'
      - '--config.file=/etc/prometheus/prometheus.yml'
    container_name: Prometheus
    hostname: prometheus-docker
    networks:
      - prometheus-net
    mem_limit: 1g
    cpu_shares: 768
    security_opt:
      - no-new-privileges=true
    user: 1026:100
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:9090/ || exit 1
    ports:
      - 12090:9090
    volumes:
      - /volume1/docker/prometheus/prometheus:/prometheus:rw
      - /volume1/docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
    restart: on-failure:5

  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: Prometheus-Node
    hostname: prometheus-node
    networks:
      - prometheus-net
    mem_limit: 256m
    mem_reservation: 64m
    cpu_shares: 512
    security_opt:
      - no-new-privileges=true
    read_only: true
    user: 1026:100
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:9100/
    restart: on-failure:5

  snmp-exporter:
    image: prom/snmp-exporter:latest
    command:
      - "--config.file=/etc/snmp_exporter/snmp.yml"
    container_name: Prometheus-SNMP
    hostname: prometheus-snmp
    networks:
      - prometheus-net
    mem_limit: 256m
    mem_reservation: 64m
    cpu_shares: 512
    security_opt:
      - no-new-privileges:true
    read_only: true
    user: 1026:100
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:9116/ || exit 1
    volumes:
      - /volume1/docker/prometheus/snmp:/etc/snmp_exporter/:ro
    restart: on-failure:5

  cadvisor:
    image: gcr.io/cadvisor/cadvisor:latest
    command:
      - '--docker_only=true'
    container_name: Prometheus-cAdvisor
    hostname: prometheus-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: on-failure:5

networks:
  prometheus-net:
    name: prometheus-net
    ipam:
      config:
       - subnet: 192.168.51.0/24

Note: Before you paste the code above in the Web editor area below, change the value numbers for user with your own UID and GID values. (Follow my step by step guide on how to do this.) 1026 is my personal UID value and 100 is my personal GID value. You have to type in your own values.

15 Synology Grafana Dashboard Part 2 new 2025

  • STEP 24

Scroll down on the page until you see a button namedĀ Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

14 Synology Grafana Dashboard Part 2 new 2025

  • STEP 25

If everything goes right, you will see the following message at the top right of your screen: ā€œSuccess Stack successfully deployedā€œ.

16 Synology Grafana Dashboard Part 2

  • STEP 26

Go back toĀ STEP 1Ā or you will deal with karma šŸ™‚

  • STEP 27

The installation process can take up to a few seconds/minutes. It will depend on your Internet speed connection.

  • STEP 28

Open Grafana on your main NAS. At the top left of the page click Home. Under Connections click Add new connection. Follow the instructions in the image below.

1 Synology Grafana Prometheus Dashboard 22 new 2024

  • STEP 29

Search for Prometheus. When you find it, click Prometheus. Follow the instructions in the image below.

2 Synology Grafana Prometheus Dashboard 23 new2 2024

  • STEP 30

At the top right of the page click Add new data source.Ā Follow the instructions in the image below.

3 Synology Grafana Prometheus Dashboard 23 new3 2024

  • STEP 31

On the URL area type in http://YourNASIP:12090 instead of http://localhost:9090. Note: This will be the IP of the NAS you want to monitor (second NAS). Scroll down the page a little bit. Also, you can change the name Prometheus and use your NAS name instead. In my case, I have added “MY SECOND NAS”. Follow the instructions in the image below.

20-Synology-Grafana-Dashboard-Part-2-new2-2027

  • STEP 32

Click Save & test. Follow the instructions in the image below.

5 Synology Grafana Prometheus Dashboard 23 new5 2024

  • STEP 33

You are Done! Now you can switch between your NAS Servers.

22 Synology Grafana Dashboard Part 2 new 2025

Enjoy your awesome Synology Dashboard powered by Prometheus! You can use this guide to Install Prometheus on every NAS device that you want to monitor. Just remember to change the http://LocalNASIP followed by :12090 at STEP 31.

  • STEP 34

If you won’t be able to see all of your NAS data at STEP 20, instead of the IP address of your NAS, add the address of your Docker bridge Gateway, which can be 172.17.0.1 – You will find Docker bridge by opening Docker or Container Manager then left sidebar / Network. Save the prometheus.yml file then restart all the containers in Portainer.

  • STEP 35

If you want to integrate Watchtower in the Container Updates area where it says No data, follow my step by step guide on how to integrate Watchtower into Grafana Dashboard on a Synology NAS.

Note: Can I run Docker on my Synology NAS?Ā See the supported models.
Note: How to Back Up Docker Containers on your Synology NAS.
Note: Find outĀ how to update the Prometheus containerĀ with the latest image.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Sunday / September 8th, 2024 at 5:50 PM