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 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.
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. šNote: Support my work to unlock the password. You can use this password to download any file on mariushosting forever!
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!
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.
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. At the top left of the page click Home. Under Connections click Add new connection. Follow the instructions in the image below.
STEP 29
Search for Prometheus. When you find it, click Prometheus. Follow the instructions in the image below.
STEP 30
At the top right of the page click Add new data source.Ā Follow the instructions in the image below.
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.
STEP 32
Click Save & test. Follow the instructions in the image below.
STEP 33
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 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