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.
STEP 5
Install Docker (second NAS) via Synology “Package Center”.
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.
STEP 8
A new window will open click Create. Follow the instructions in the image below.
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.
STEP 10
From the Built-in Applications check SNMP service then click OK. Follow the instructions in the image below.
STEP 11
After you click OK at STEP 10, choose “Specific IP” then click Select. Follow the instructions in the image below.
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.
STEP 13
Click OK. Follow the instructions in the image below.
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.
STEP 15
Click OK. Follow the instructions in the image below.
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.
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.
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.
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.
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.
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.
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.
STEP 23
In the Name field type in dashboard2. Follow the instructions in the image below.
version: "3.9" 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.
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.
STEP 25
If everything goes right, you will see the following message at the top right of your screen: “Success Stack successfully deployed“.
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. On the left sidebar click on the Settings icon then Data Sources. Follow the instructions in the image below.
STEP 29
Click on Prometheus. Follow the instructions in the image below.
STEP 30
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.
STEP 31
Click Save & test. Follow the instructions in the image below.
STEP 32
You are Done! Now you can switch between your NAS Servers.
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 30.
STEP 33
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: 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 Tuesday / February 14th, 2023 at 6:29 PM