A complete Docker stack to run a Grafana Dashboard on a Synology NAS.
Grafana | Prometheus | cAdvisor | Speedtest Exporter | Node Exporter | SNMP Exporter | UPS stats
If you find this tool helpful, consider supporting its development:
Your support helps maintain and improve this free, open-source tool!
For each NAS you want to collect the data from, follow the steps below.
Before you start, make sure you have the Container Manager package installed via the Synology DSM.
Check if your Firewall is enabled: Control Panel -> Security -> Firewall
If the Enable firewall checkbox is not ticked, move to the next section.
If the checkbox is ticked, do the following:
-
Under Firewall Profile click the Edit Rules button
-
Under Firewll Rules click the Create button
-
Set Ports to All
-
Under Source IP select Specific IP and click the Select button
-
Choose the Subnet option and enter IP address
172.22.0.0
and Subnet mask255.255.0.0
and press OK -
Set the Action to Allow, make sure the Enabled checkbox is ticked, and click OK
-
Make sure this newly created rule is on top of all the other Firewall Rules. Drag and drop it to the top.
-
Open Control Panel -> Terminal and SNMP -> SNMP and tick the Enable SNMP service checkbox.
-
Tick the SNMPv3 service checkbox. Set the username to
exporter
, protocol toMD5
, and pick a password. -
Tick the Enable SNMP privacy checkbox. Set protocol to DES and pick a second, different password.
-
Edit the
snmp.yml
file and replace thesnmpv3_password_placeholder
andsnmp_priv_password_placeholder
with the passwords you just picked. Keep the quotation marks around the password.
Replace the your_real_host_ip
placeholder with your own local NAS IP (for example 192.168.0.10). Do not add any port number after it, just the IP address is enough.
Now, pick a user you'd like to dedicate for running Docker on your NAS. It can be an existing user, or you can create a brand new user just for that.
You will need to enable SSH and then SSH into your system and check the user's gid and uid. You can do that by running the command id username
. For example, if I have a user called dockeruser
, I will run id dockeruser
and see the output uid=1028(dockeruser) gid=100(users) groups=100(users)
.
Depending on whether you're deploying on your main NAS that will also host the Grafana frontend (master), or a second or third device you want to add to the pool (slave), pick the right compose.yaml
file. Open the file in an editor and replace all instances of the user_id:group_id
placeholder with the uid and gid, for example 1028:100
.
In this step, you will need to make sure all the necessary directories and files are in place.
-
Using the DSM File Station, navigate to the docker shared folder. Inside the docker share, create an empty directory called
metrics
. Inside themetrics
directory you just created, create three more empty directories:grafana
,prometheus
, andsnmp
. -
Upload your modified
prometheus.yml
andsnmp.yml
files into themetrics
directory -
Your final file structure should look something like this:
volume1
└── docker
└── metrics
├── prometheus.yml
├── snmp.yml
├── prometheus
├── grafana
└── snmp
-
Open Container Manager -> Project and click Create
-
Enter the Project name
metrics
-
Set the Path to
/docker/metrics
-
Upload the
master/compose.yaml
orslave/compose.yaml
file depending on whether it is your main or secondary NAS. -
Deploy the project!
-
Go to http://your-nas-ip:3340/ (replace
your-nas-ip
with your actual NAS IP address or domain name) -
Log in to Grafana with the default user
admin
and passwordadmin
-
You will be prompted to select a new password. Make sure you write it down somewhere!
-
Go to Home -> Connections -> Add new connection
-
Search for Prometheus
-
Click Add new data source on the top right
-
Choose and enter a name for the NAS (e.g.
nas1
ornas2
) and enter the Prometheus server URL:
- If this is your master NAS (running Grafana), enter
http://prometheus:9090
- If this is your slave NAS (no Grafana, only Prometheus), enter
http://your-nas-ip:9090/
but make sure to replaceyour-nas-ip
with the IP address of the remote (slave) NAS
- Leave everything else as default and click Save & test
This is an additional step you only need to follow once on your master NAS.
-
Open Grafana (http://your-nas-ip:3340/) and on the left side menu select Dashboards
-
On the top right click New -> Import
-
Click Upload dashboard JSON file and upload the
Synology_Dashboard.json
file -
Click Import. You should see your Dashboard now!