


Use the text editor of your choice to create this script directly on your Raspberry Pi, or create the script locally and copy to the home folder of the pi user using SCP. It will then store those values in the "internetspeed" database in Influx. This script will use the speedtest-cli package we installed in Step #2 to gather download, upload, and ping (latency) values. In the next step, we'll create a python script called speedtest.py in the home directory of the pi user. Install the python library to interact with InfluxDB: sudo apt-get install python3-influxdbġ5. Assign the "speedmonitor" user all privileges to the "internetspeed" database: GRANT ALL ON "internetspeed" to "speedmonitor"ġ4. Take note of the password you select in this step, as we will need to enter it again when we configure our database connection in Grafana: CREATE USER "speedmonitor" WITH PASSWORD 'mysecurepassword123'ġ2. Change the password below to whatever you would like to use for this user. Create a user called "speedmonitor" to interact with the database. Create a database called "internetspeed" CREATE DATABASE internetspeedġ1. Next, we'll create our database to store the results of the speedtest-cli. Enable Grafana to start at boot time, then start the Grafana server: sudo systemctl enable grafana-serverĩ. Next, install Grafana: sudo apt-get install grafanaĨ. Configure InfluxDB to start at boot time, then start the InfluxDB server: sudo systemctl unmask influxdbħ. Update your packages using the entries to the sources list, then install InfluxDB: sudo apt-get updateĦ. Add the InfluxDB and Grafana repositories to the sources list: echo "deb buster stable" | sudo tee /etc/apt//influxdb.listĮcho "deb stable main" | sudo tee -a /etc/apt//grafana.listĥ. Add the repository keys for InfluxDB and Grafana: wget -qO- | sudo apt-key add -Ĥ. Next, install python and the speedtest-cli package: sudo apt-get install python3-pipģ.
