Giter VIP home page Giter VIP logo

synology-nas-monitoring's Introduction

Synology NAS monitoring

alt text

The main points of this project are:

  • Persistence is supported via mounting volumes to a Docker container.
  • Grafana will store its data in SQLite files instead of a MySQL.
  • Added snmp packages and Synology NAS MIBS.
  • Enable

Enable SNMP

  1. From Control panel in your Synology NAS go to Terminal & SNMP
  2. Click on SNMP tab, and enable SNMPv1, SNMPv2 service
  3. in Community input put public
  4. Save

Run Docker image in your Synology

  1. Install Docker from Synology package center
  2. Create two empty folders in your Synology influxdb and grafana, we need to use it later to mount it to our container.
  3. Open Docker client from Synology > Image > Add > Add from url and paste Hub page url "https://hub.docker.com/r/alhazmy13/telegraf-influxdb-grafana"
  4. Wait until it finishes downloading the image
  5. Click on the image "alhazmy13/telegraf-influxdb-grafana" and then click on Launch
  6. Network Tab keep it in bridge mode
  7. Check "Enable auto-restart."
  8. Port settings, just change Local port for 3003 from Auto to 3003, and port 514 from Auto to 5144
  9. In Volume settings, click Add folder and select the first folder that we created, "grafana" and on mount Path, paste /var/lib/grafana
  10. In Volume settings again, click Add Folder and select the second folder that we created "influxdb" and on mount Path paste /var/lib/influxdb
  11. [OPTIONAL] Environment Tab > Add new variable "TZ" with your local time zone ignore this if you want to use the default UTC
  12. Apply, Next, Done and your container should be ready.

Start Grafana

  1. Open http://YOUR_LOCAL_NAS_IP:3003 and login with the default username root and password root
  2. You need to import the dashboard. To do this, go to http://YOUR_LOCAL_NAS_IP:3003/dashboard/import and put 14590 in "Import via grafana.com" input
  3. Click on load and complete the process

Enable Logging

  1. Install Log center From Synology package center
  2. Open Log center app
  3. Click on Log Sending > check "Send log to syslog server"
  4. Set Server = localhost, port = 5144, Protocol = UDP, Format = BSD (RFC 3164)
  5. For testing, click on "Send test log"
  6. Apply

Configure Firewall

If the firewall is enabled, then you need to add a new rule for port UDP/161, This is mandatory otherwise, some data will be missing from the dashboard #7 .

  1. Open Control panel
  2. Security -> Firewall
  3. Edit Rules -> Create New Rule
  4. In the ports section, select from a built-in applications and chose SNMP service
  5. In the IP section select Spesifc IP -> subnet -> Source: 172.12.0.0 / subnet: 255.255.0.0
  6. Action = Allow
  7. Disable and re-enable the firewall for it to take effect

synology-nas-monitoring's People

Contributors

alhazmy13 avatar cmboii avatar eugenegghq avatar patikoija avatar vpicone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synology-nas-monitoring's Issues

influxdb crashing

Hi,
I installed everything as described in the readme. However, the container log is full of logs like (repeating every second):
INFO spawned: 'influxdb' with pid 6250 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) INFO exited: influxdb (exit status 1; not expected) INFO spawned: 'influxdb' with pid 6269 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) INFO exited: influxdb (exit status 1; not expected) INFO spawned: 'influxdb' with pid 6288 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) INFO exited: influxdb (exit status 1; not expected)
It looks like influxdb is working, at least Grafana shows data.

Some Data are missing

Hey thanks for the packeg.
Was very easy to set it up and looks very good but a few datas are missing:
image
Not sure if this ist due to DSM 7 or because i use the NVME SSDs as a second volume.

Any idea?

trouble accessing grafana after installation

I downloaded the image succesfully, and tried to launch it according to the instructions given. it seems to be up and running now, however when looking at the docker container logs, i can see its shutting down various services, meaning i am not able to access grafana because it is not running anyway. Is your system still operational?

2022-05-25 11:28:52,873 INFO exited: syslog (exit status 0; expected)

2022-05-25 11:57:32,174 INFO exited: syslog (exit status 0; expected)
[84 items.](https://192-168-178-249.redmarbos.direct.quickconnect.to:5001/#)

2022-05-25 11:28:52,873 INFO exited: syslog (exit status 0; expected)

2022-05-25 11:32:51,349 INFO reaped unknown pid 39

2022-05-25 11:53:25,835 WARN received SIGTERM indicating exit request

2022-05-25 11:53:26,081 INFO waiting for sshd, chronograf to die

2022-05-25 11:53:27,106 INFO stopped: chronograf (terminated by SIGTERM)

2022-05-25 11:53:29,110 INFO waiting for sshd to die

2022-05-25 11:53:31,512 INFO stopped: sshd (exit status 0)

/usr/lib/python3/dist-packages/supervisor/options.py:470: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.

self.warnings.warn(

2022-05-25 11:56:55,987 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.

2022-05-25 11:56:55,988 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing

2022-05-25 11:56:55,997 INFO RPC interface 'supervisor' initialized

2022-05-25 11:56:55,998 CRIT Server 'unix_http_server' running without any HTTP authentication checking

2022-05-25 11:56:55,998 INFO supervisord started with pid 1

2022-05-25 11:56:57,000 INFO spawned: 'sshd' with pid 8

2022-05-25 11:56:58,403 INFO spawned: 'influxdb' with pid 9

2022-05-25 11:56:58,405 INFO spawned: 'syslog' with pid 10

2022-05-25 11:56:58,407 INFO spawned: 'telegraf' with pid 11

2022-05-25 11:56:58,414 INFO spawned: 'grafana' with pid 12

2022-05-25 11:56:58,416 INFO spawned: 'chronograf' with pid 13

2022-05-25 11:56:58,426 INFO spawned: 'snmpwalk' with pid 14

2022-05-25 11:56:58,822 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,525 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,525 INFO success: syslog entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,525 INFO success: telegraf entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,526 INFO success: grafana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,526 INFO success: chronograf entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,526 INFO success: snmpwalk entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:00,526 INFO exited: influxdb (exit status 1; not expected)

2022-05-25 11:57:00,526 INFO exited: grafana (exit status 1; not expected)

2022-05-25 11:57:00,528 INFO spawned: 'influxdb' with pid 67

2022-05-25 11:57:00,530 INFO spawned: 'grafana' with pid 68

2022-05-25 11:57:01,562 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:02,400 INFO success: grafana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:02,400 INFO exited: snmpwalk (exit status 0; expected)

2022-05-25 11:57:02,400 INFO exited: influxdb (exit status 1; not expected)

2022-05-25 11:57:02,403 INFO spawned: 'influxdb' with pid 92

2022-05-25 11:57:03,459 INFO success: influxdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2022-05-25 11:57:05,200 INFO exited: grafana (exit status 0; expected)

2022-05-25 11:57:06,201 INFO reaped unknown pid 103

2022-05-25 11:57:08,263 INFO reaped unknown pid 43

2022-05-25 11:57:08,986 INFO exited: influxdb (exit status 0; expected)

2022-05-25 11:57:12,997 INFO reaped unknown pid 46

2022-05-25 11:57:29,159 INFO exited: telegraf (exit status 0; expected)

2022-05-25 11:57:32,174 INFO exited: syslog (exit status 0; expected)

docker-compose port 5144:514 needs /udp appending

As title. I provided the docker-compose file for you on Reddit, off the top of my head. Having run it, I realised that - 5144:514 needs to actually be - 5144:514/udp to function. Once this change is made, logging now works. Sorry for the mistake.

Wrong Temps of SYS on random syno....

Hello dear, why the system temp on my 918 shows 25C+ - degrees higher than the real. May be can add CPU Temp separeted?
Example:
echo "Case Temp";cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input
or multicore temps Examle:
echo "Core 1 Temp";cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp2_input
echo "Core 2 Temp";cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp3_input
echo "Core 3 Temp";cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp4_input
echo "Core 4 Temp";cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp5_input
best regards!

snmp v3

First, thank you so much for the incredible solution.
Second, Not a bug, but wanted to ask. Is there a way to use this with SNMP v3 vs v1/2 with public?
Thank you so much !

Grafana crashing

I had this successfully running on my Synology previously, but re-initialized the volume and cannot get it to work again. When following the directions on this repo I get the following logs from supervisord ad infinitum.

2022-12-20 04:11:10,233 INFO spawned: 'grafana' with pid 5185
2022-12-20 04:11:11,256 INFO success: grafana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-12-20 04:11:11,731 INFO exited: grafana (exit status 1; not expected)
2022-12-20 04:11:11,731 INFO reaped unknown pid 5196
2022-12-20 04:11:11,733 INFO spawned: 'grafana' with pid 5205
2022-12-20 04:11:12,756 INFO success: grafana entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2022-12-20 04:11:12,757 INFO reaped unknown pid 5216
2022-12-20 04:11:12,767 INFO exited: grafana (exit status 1; not expected)

Looking in the grafana log I see complaints about the database being locked initially:

logger=settings t=2022-12-20T04:05:14.515925475Z level=info msg="Starting Grafana" version=9.1.3 commit=f3f9a818c2 branch=HEAD compiled=2022-09-05T15:59:46Z
logger=settings t=2022-12-20T04:05:14.516336991Z level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
logger=settings t=2022-12-20T04:05:14.516396709Z level=info msg="Config loaded from" file=/etc/grafana/grafana.ini
logger=settings t=2022-12-20T04:05:14.516425871Z level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
logger=settings t=2022-12-20T04:05:14.516454471Z level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
logger=settings t=2022-12-20T04:05:14.516483262Z level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
logger=settings t=2022-12-20T04:05:14.516511072Z level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
logger=settings t=2022-12-20T04:05:14.516539953Z level=info msg="Config overridden from Environment variable" var="GF_DATABASE_TYPE=sqlite3"
logger=settings t=2022-12-20T04:05:14.516568518Z level=info msg="Path Home" path=/usr/share/grafana
logger=settings t=2022-12-20T04:05:14.516595898Z level=info msg="Path Data" path=/var/lib/grafana
logger=settings t=2022-12-20T04:05:14.516622801Z level=info msg="Path Logs" path=/var/log/grafana
logger=settings t=2022-12-20T04:05:14.516649685Z level=info msg="Path Plugins" path=/var/lib/grafana/plugins
logger=settings t=2022-12-20T04:05:14.51667711Z level=info msg="Path Provisioning" path=/etc/grafana/provisioning
logger=settings t=2022-12-20T04:05:14.516704603Z level=info msg="App mode production"
logger=sqlstore t=2022-12-20T04:05:14.516869675Z level=info msg="Connecting to DB" dbtype=sqlite3
logger=sqlstore t=2022-12-20T04:05:14.516922141Z level=warn msg="SQLite database file has broader permissions than it should" path=/var/lib/grafana/grafana.db mode=-rwxr-xr-x expected=-rw-r-----
logger=migrator t=2022-12-20T04:05:15.021613642Z level=info msg="Executing migration" id="create index IDX_temp_user_email - v1-7"
logger=settings t=2022-12-20T04:05:15.574853239Z level=info msg="Starting Grafana" version=9.1.3 commit=f3f9a818c2 branch=HEAD compiled=2022-09-05T15:59:46Z
logger=settings t=2022-12-20T04:05:15.575354207Z level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
logger=settings t=2022-12-20T04:05:15.575429981Z level=info msg="Config loaded from" file=/etc/grafana/grafana.ini
logger=settings t=2022-12-20T04:05:15.575478012Z level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
logger=settings t=2022-12-20T04:05:15.57550559Z level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
logger=settings t=2022-12-20T04:05:15.575532263Z level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
logger=settings t=2022-12-20T04:05:15.575559553Z level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
logger=settings t=2022-12-20T04:05:15.575587645Z level=info msg="Config overridden from Environment variable" var="GF_DATABASE_TYPE=sqlite3"
logger=settings t=2022-12-20T04:05:15.57561536Z level=info msg="Path Home" path=/usr/share/grafana
logger=settings t=2022-12-20T04:05:15.575641907Z level=info msg="Path Data" path=/var/lib/grafana
logger=settings t=2022-12-20T04:05:15.57566846Z level=info msg="Path Logs" path=/var/log/grafana
logger=settings t=2022-12-20T04:05:15.575694686Z level=info msg="Path Plugins" path=/var/lib/grafana/plugins
logger=settings t=2022-12-20T04:05:15.575721178Z level=info msg="Path Provisioning" path=/etc/grafana/provisioning
logger=settings t=2022-12-20T04:05:15.57574836Z level=info msg="App mode production"
logger=sqlstore t=2022-12-20T04:05:15.575924431Z level=info msg="Connecting to DB" dbtype=sqlite3
logger=sqlstore t=2022-12-20T04:05:15.575976855Z level=warn msg="SQLite database file has broader permissions than it should" path=/var/lib/grafana/grafana.db mode=-rwxr-xr-x expected=-rw-r-----
logger=migrator t=2022-12-20T04:05:15.588282961Z level=info msg="Executing migration" id="create index IDX_temp_user_org_id - v1-7"
logger=migrator t=2022-12-20T04:05:16.419610267Z level=error msg="alert migration failure: could not get migration log" error="failed to check table existence: database is locked"
logger=migrator t=2022-12-20T04:05:16.548090565Z level=info msg="Executing migration" id="create index IDX_temp_user_code - v1-7"

This lasts about 5 minutes, after which it no longer complains, but gets stuck in a loop without any apparent errors:

logger=settings t=2022-12-20T04:15:12.661900194Z level=info msg="Starting Grafana" version=9.1.3 commit=f3f9a818c2 branch=HEAD compiled=2022-09-05T15:59:46Z
logger=settings t=2022-12-20T04:15:12.662414423Z level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini
logger=settings t=2022-12-20T04:15:12.662468342Z level=info msg="Config loaded from" file=/etc/grafana/grafana.ini
logger=settings t=2022-12-20T04:15:12.662495231Z level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"
logger=settings t=2022-12-20T04:15:12.662522201Z level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"
logger=settings t=2022-12-20T04:15:12.662551291Z level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"
logger=settings t=2022-12-20T04:15:12.662578604Z level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"
logger=settings t=2022-12-20T04:15:12.662605697Z level=info msg="Config overridden from Environment variable" var="GF_DATABASE_TYPE=sqlite3"
logger=settings t=2022-12-20T04:15:12.662632568Z level=info msg="Path Home" path=/usr/share/grafana
logger=settings t=2022-12-20T04:15:12.662658035Z level=info msg="Path Data" path=/var/lib/grafana
logger=settings t=2022-12-20T04:15:12.662683229Z level=info msg="Path Logs" path=/var/log/grafana
logger=settings t=2022-12-20T04:15:12.662718377Z level=info msg="Path Plugins" path=/var/lib/grafana/plugins
logger=settings t=2022-12-20T04:15:12.66274584Z level=info msg="Path Provisioning" path=/etc/grafana/provisioning
logger=settings t=2022-12-20T04:15:12.6627715Z level=info msg="App mode production"
logger=sqlstore t=2022-12-20T04:15:12.662938787Z level=info msg="Connecting to DB" dbtype=sqlite3
logger=sqlstore t=2022-12-20T04:15:12.662989201Z level=warn msg="SQLite database file has broader permissions than it should" path=/var/lib/grafana/grafana.db mode=-rwxr-xr-x expected=-rw-r-----
logger=migrator t=2022-12-20T04:15:12.71598385Z level=info msg="Starting DB migrations"
logger=migrator t=2022-12-20T04:15:12.734386423Z level=info msg="migrations completed" performed=0 skipped=443 duration=1.184758ms

Owner of /var/lib/grafana is grafana:grafana. The telegraf service is running, but reporting errors writing to influxdb.

2022-12-20T04:05:29Z I! Starting Telegraf 1.16.3
2022-12-20T04:05:29Z I! Loaded inputs: cpu disk diskio kernel mem processes snmp statsd swap syslog system
2022-12-20T04:05:29Z I! Loaded aggregators:
2022-12-20T04:05:29Z I! Loaded processors:
2022-12-20T04:05:29Z I! Loaded outputs: influxdb
2022-12-20T04:05:29Z I! Tags enabled: host=telegraf-influxdb-grafana
2022-12-20T04:05:29Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"telegraf-influxdb-grafana", Flush Interval:10s
2022-12-20T04:05:29Z I! [inputs.statsd] UDP listening on "[::]:8125"
2022-12-20T04:05:29Z I! [inputs.statsd] Started the statsd service on ":8125"
2022-12-20T04:05:44Z E! [outputs.influxdb] When writing to [http://localhost:8086]: Post "http://localhost:8086/write?db=telegraf": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
2022-12-20T04:05:44Z E! [agent] Error writing to outputs.influxdb: could not write any address

Any idea what's happening? This was tested with the same result both on latest and develop.

Suggestion: Celsius to Fahrenheit

If you want the temperature gauges to show F instead of C:
Edit the gauge
Modify the unit from C to F (on the right bar)
Add math calculation of * 9 / 5 + 32 in the select field on to bottom side
Match to the image below
Save the changes
Save the dashboard
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.