Configuration files and tutorial on how to monitor your Synology NAS using SNMP, Telegraf, InfluxDB and Grafana.
There are already few SNMP/Grafana monitoring solutions available. However, they are usually:
This Synology NAS monitoring uses InfluxDB 2 with Flux query language and the dashboard is configurable with virtually zero hard coded values.
Enable SNMP service on Synology NAS. In DSM:
Control Panel
-> Terminal & SMNP
-> SNMP
tabEnable SNMP service
SNMPv1, SNMPv2c service
public
[Apply]
Warning: this setting is not secure, especially if your NAS is exposed to the Internet. For more security, choose different
Community
(e.g. random string) or enable and configureSNMPv3 service
. Note that if you changeCommunity
or enableSNMPv3 service
, you have to make appropriate changes to the Telegraf configuration. Please, consult the documentation.
telegraf
,
influxdb
and
grafana/grafana
images from the Docker registry
latest
tag for all imagestelegraf
and influxdb
folders from this repository into the docker
shared folder on the NASinfluxdb
containerIn Advanced Settings
:
Enable auto-restart
docker/influxdb/var/lib/influxdb2
-> /var/lib/influxdb2
(as read-write)Use the same network as Docker Host
DOCKER_INFLUXDB_INIT_MODE
-> setup
DOCKER_INFLUXDB_INIT_USERNAME
-> my-user
DOCKER_INFLUXDB_INIT_PASSWORD
-> my-password
DOCKER_INFLUXDB_INIT_ORG
-> NAS
DOCKER_INFLUXDB_INIT_BUCKET
-> telegraf
InfluxDB should be now available at http://your-nas:8086/
.
telegraf
containerIn Advanced Settings
:
Enable auto-restart
docker/telegraf/etc/telegraf/telegraf.conf
-> /etc/telegraf/telegraf.conf
(as read-only)docker/telegraf/mibs
-> /mibs
(as read-only)Use the same network as Docker Host
Before running the container:
docker/telegraf/etc/telegraf/telegraf.conf
appropriately
[[outputs.influxdb_v2]]
, you must change urls
& token
(eventually organisation
& bucket
if you wish
to change them)
http://your-nas:8086/
, in the Data
menu (on the left), on the API Tokens
tab, after clicking on my-user's Token
[[inputs.snmp]]
, you must change agents
(you can choose IP or hostname)
grafana
containerIn Advanced Settings
:
Enable auto-restart
Use the same network as Docker Host
Grafana should be now available at http://your-nas:3000/
.
Default credentials are admin
:admin
. After login, it will ask you for a new password.
After logging into Grafana web interface:
Configuration
-> Data sources
Add data source
-> InfluxDB
Default
Query Language
-> Flux
HTTP
URL
-> http://your-nas:8086
Auth
Basic auth
InfluxDB Details
Organization
-> NAS
(or whatever specified previously in DOCKER_INFLUXDB_INIT_ORG
)Token
-> Your InfluxDB token (as described above)Default Bucket
-> telegraf
[Save & test]
Create [+]
-> Import
(http://your-nas:3000/dashboard/import
)
[Upload JSON file]
grafana/dashboard.json
[Import]
If not selected by default, choose appropriate Data source
at the top.
Content of this repository - except the telegraf/mibs
folder - is open-source under the MIT license. See the LICENSE.txt file in this repository.
telegraf/mibs
folder contains following files:
HOST-RESOURCES-MIB.txt
, IF-MIB.txt
, SNMPv2-MIB.txt
, SNMPv2-SMI.txt
and
UCD-SNMP-MIB.txt
from the net-snmp github repositoryIf you find this project interesting, you can buy me a coffee
BTC 3GwZMNGvLCZMi7mjL8K6iyj6qGbhkVMNMF
LTC MQn5YC7bZd4KSsaj8snSg4TetmdKDkeCYk