Open main menu

DAVE Developer's Wiki β

Changes

no edit summary
The IoT device is an [[MISC-TN-004:_Running_Debian_(armbian)_on_SBCSPG|SBCSPG IIoT gateway]] running Debian [[MISC-TN-026:_Automated_test_equipment_(ATE)_monitoring_with_SBCSPG_gateway,_ThingsBoard_IoT,_and_Fledge|Bullseye]]. An instance of Glances runs on SBCSPG for collecting data (CPU load, memory usage, network traffic, etc.). These data are pushed into InfluxDB. Grafana retrieves these data from the database and shows them in a beautiful dashboard.
For the sake of simplicity, Grafana and InfluxDB were installed on the same hostrunning Ubuntu 20.04, but they can indeed run on different machines. ==Installing InfluxDB 2.0 and Grafana==Please follow the instructions available [https://medium.com/@nanditasahu031/integration-of-influxdb2-with-grafana-28b4aebb3368 here], but refer to [https://repos.influxdata.com/ these page] for the InfluxDB GPG key. For convenience, a ready-to-use dashboard was installed, which is available [https://grafana.com/grafana/dashboards/2387-glances-for-flux/ here]. For accessing the bucket, use the API token provided by InfluxDB. It can be copied from the page shown in the following picture.
==Setting up InfluxDB 2.0 and Grafana==
[[File:Sbcspg-glances-grafana-2.png|center|thumb|600px|Getting the API token from Grafana]]
[[File:Sbcspg-glances-grafana-1.png|center|thumb|600px|Grafana dashboard showing collected data]]
==Installing Glances on the IoT device==
For convenience, a Python 3 virtual environment was created on the device first. Then, all the necessary packages were installed as illustrated in the following dump.
 
 
 
<pre class="board-terminal">
armbian@sbcspg:~/devel/glances$ python3 -m venv ~/devel/glances/venv/
armbian@sbcspg:~/devel/glances$ source env/bin/activate
-bash: env/bin/activate: No such file or directory
armbian@sbcspg:~/devel/glances$ source venv/bin/activate
(venv) armbian@sbcspg:~/devel/glances$ pip install glances bottle influxdb
Installing collected packages: typing-extensions, reactivex, influxdb-client, ciso8601
Successfully installed ciso8601-2.3.0 influxdb-client-1.37.0 reactivex-4.0.4 typing-extensions-4.8.0
</pre>
(venv) armbian@sbcspg:~/.config/glances$ cp -v ~/devel/glances/venv/share/doc/glances/glances.conf .
'/home/armbian/devel/glances/venv/share/doc/glances/glances.conf' -> './glances.conf'
(venv) armbian@sbcspg:~/.config/glances$ glances -q --export influxdb2
 
[[File:Sbcspg-glances-grafana-1.png|center|thumb|600px|Grafana dashboard showing collected data]]
4,650
edits