Telegraf.d directory empty

Dear reader,

Currently I am getting started with telegraf, influxdb and grafana so I am a beginner. I have three containers running of these instances on my raspberry pi as I want to monitor temperature sensor data. However, my first step is to understand. That’s why I decided I first want to read raspberry data such as temperature, cpu, ram etc. Having used a tutorial to install all this I did not get any data in my grafana dashboard. I decided to take a look inside my containers. One thing I found is that my influxdb users were not created and the database was not created. So I did this and checked. But then, still no data was appearing. I decided to take a look in my telegraf container and found that when running telegraf it could not find any plugins (but the telegraf.conf file is present). I found that these plugins should be present in the telegraf.d folder. The telegraf github told me that during initialization of telegraf I can generate plugins with

telegraf --section-filter agent:inputs:outputs --input-filter cpu --output-filter influxdb config

but then, how do I need to rewrite this line to match my system and get more data such a ram, gpu, storage and more? And, will executing only this line already solve this problem?

Thanks in advance.

I decided I first want to read raspberry data such as temperature, cpu, ram
etc. Having used a tutorial

Please show us what instructions you followed.

One thing I found is that my influxdb users were not created and the database
was not created. So I did this and checked.

What did you do?

How did you check?

when running telegraf it could not find any plugins (but the
telegraf.conf file is present). I found that these plugins should be
present in the telegraf.d folder.

And - are they there?

How did you install telegraf?

The telegraf github told me that during initialization of telegraf I can
generate plugins with

telegraf --section-filter agent:inputs:outputs --input-filter cpu
--output-filter influxdb config

but then, how do I need to rewrite this line to match my system and get
more data such a ram, gpu, storage and more?

Let’s start simple and build things up once something is working. Don’t try
to do everything all at once.

Help us to help you by telling us enough about what you actually did so that
we could, if necessary, repeat the steps for ourselves. Otherwise we are just
guessing about what we think you should have done and this may not match up
with what you actually did.

Antony.

1 Like

exec in my influxdb and add a database and user with CREATE DATABASE and CREATE USER

SHOW USERS
SHOW DATABASES

Yes, this worked!

Just a docker pull for which I ensured a telegraf.conf was also created in my container. I have synchronized the folders of the host and the container correctly in the docker-compose file. This is verified by editing the telegraf.conf file in the host and checking whether the file is changed in the container. This is the case so this works. It points at the correct directory.

UPDATE
I edited my telegraf.conf file in my host with other [[input.]]-instances and it appears my grafana is now actually retrieving data. However, somehow I still cannot obtain GPU temperature. The weird thing is, in the docker container itself there are no plugins defined in the etc/telegraf/telegraf.d folder. How does this then work?

This code used to obtain GPU temps:

[[inputs.exec]]
commands = [ "/opt/vc/bin/vcgencmd measure_temp" ]
name_override = "gpu_temperature"
data_format = "grok"
grok_patterns = ["%{NUMBER:value:float}"]

Josh,
I am using exactly the same code to gather the gpu_temperature but I am running into a strange issue.
My setup, I have 6 RASPI running a few different things, each has the same telegraf config. The issue that I am facing, If I try to view each separate page only the first pi shows it’s gpu temperature, all the other 5 show N/A. It seems that the data extracted from each pi is all put into the same table, but do not have a link to the related server.
I will only show the first and second screenshot, all of the other pis show the same as the 2nd.
image

I was thinking of having each pi write to it’s own table, but I cannot figure out how to have the table created and written to.

so any advice would be much appreciated.
Thanks
Lawrence

This is the second screenshot

image

Lawrence