Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Car data on Grafana #161

Closed
user-e opened this issue Jun 23, 2021 · 3 comments
Closed

Car data on Grafana #161

user-e opened this issue Jun 23, 2021 · 3 comments

Comments

@user-e
Copy link

user-e commented Jun 23, 2021

Not an issue, just some tips on how to send the car data to a DB and then plot it on Grafana.
(Only Linux)

  1. Install InfluxDB
sudo apt-get update && sudo apt-get install influxdb
sudo systemctl unmask influxdb.service
sudo systemctl start influxdb
  1. Install telegraf for InfluxDB
sudo apt-get update && sudo apt-get install telegraf
sudo systemctl start telegraf
  1. Install Grafana
sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana
sudo systemctl enable grafana-server.service
  • Next step is to configure InfluxDB:

sudo nano /etc/influxdb/influxdb.conf

Under [http] section, edit this line:

# Determines whether HTTP endpoint is enabled.
enabled = true
# The bind address used by the HTTP service.
bind-address = ":8086"
# Determines whether user authentication is enabled over HTTP/HTTPS.
auth-enabled = false
# The default realm sent back when issuing a basic auth challenge.
# realm = "InfluxDB"
# Determines whether HTTP request logging is enabled.
log-enabled = true
  • Then, telegraf:

sudo nano /etc/telegraf/telegraf.conf

Under [agent] section edit this line:

interval = "300s"
flush_interval = "30s"

Under [[outputs.influxdb]] this line:

[[outputs.influxdb]]

urls = ["http://127.0.0.1:8086"]
database = "Corsa-e"
skip_database_creation = false

And last, under [[inputs.http]] this line:

[[inputs.http]]

urls = ["http://127.0.0.1:5000/get_vehicleinfo/YOURVINHERE"]
method = "GET"
insecure_skip_verify = true
timeout = "5s"
data_format = "json"

Reload the service:

sudo systemctl restart influxdb
sudo systemctl restart telegraf

And now log-in on Grafana: http://Your_IP:3000
The default user and password usually are "admin" / "admin"

  • Now add a new data source, InfluxDB in that case:
    g3
    g2
    g1

And then you have just to create a new panel/dashboard with the data that you want!

g5
g6

Have fun!

PS:
Feel free to correct my English

@flobz
Copy link
Owner

flobz commented Jun 23, 2021

Good job!
Thanks for sharing :)

@flobz
Copy link
Owner

flobz commented Jul 1, 2021

I add a link to this tutorial in the README. Thanks again.

@flobz flobz closed this as completed Jul 1, 2021
@SinaDD
Copy link

SinaDD commented Apr 23, 2022

Thankyou very much for sharing!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants