zottelbeyer / QNAP-collectdinfluxdbgrafana

A simple to use Grafana Dashboard for your QNAP NAS
66 stars 6 forks source link

how do I collect data from multiple qnap servers? #11

Closed needforspeed closed 3 years ago

needforspeed commented 3 years ago

For example I have one qnap 192.168.1.2, and another one 192.168.1.3. Where should I change to have a centralized dashboard to view both nases?

Thanks in advance

zottelbeyer commented 3 years ago

So to answer your question in case you accidentally closed this and for others wondering the same here is the basic concept:

run 1 collectd instances on each NAS - 2 total run 1 influxdb and 1 grafana instance on either NAS or independent computer

influxdb has to be reachable from both NAS which means you have to adjust your collectd config in some places.

  1. Hostname both for data sent to influxdb as well as data collected via SNMP:

https://github.com/zottelbeyer/QNAP-collectdinfluxdbgrafana/blob/785a9ed786190ded800a4ece3662bcb6ad0952e3/qnap-collectd/collectd.conf.d/sample.conf#L5-L7

https://github.com/zottelbeyer/QNAP-collectdinfluxdbgrafana/blob/785a9ed786190ded800a4ece3662bcb6ad0952e3/qnap-collectd/collectd.conf.d/sample.conf#L125-L126

  1. The influxdb instance to send the data to:

https://github.com/zottelbeyer/QNAP-collectdinfluxdbgrafana/blob/785a9ed786190ded800a4ece3662bcb6ad0952e3/qnap-collectd/collectd.conf.d/sample.conf#L18-L20

once that is done you can use the "Hostname" variable in Grafana to switch between both NAS (top left corner): image

If you wanted to have a panels for each NAS side by side you can simply create a new dashboard, copy the panels over and modify the query to use hard coded variables:

image

image

Be aware of Docker DNS difficulties this setup might bring along which take some studying of the Docker documentation to understand and probably some adjustments to the docker-compose.yml

Hope that helps.

needforspeed commented 3 years ago

Thanks for the detailed reply. I figured it out last night, so I closed the issue.

I'm totally new to collectd, and I noticed there are a few plugins not seem to used, like users, uptime, load, etc. Are those needed?

zottelbeyer commented 3 years ago

most of these are default plugins and could be removed: users, uptime, exec, processes. load monitors cpu usage and is used in one of the panels.

needforspeed commented 3 years ago

Got it. Thanks a lot