Installing Telegraf RPi - Error running agent

Hi All,

I want to learn how to make a simple TIG stack (or similar) to monitor some data. Perhaps starting with my computers metric (cpu, ram usage etc) but eventually from a sensor.

I now have a RPi ready to go running Rasbian and the first step is installing Telegraf to collect some data.

I’m trying to follow this:

But I’ve gotten stuck at the first hurdle - Install Telegraf.

Just a side note, I’m completely new to the world of Influx, and only basic proficiency on the Raspberry Pi.

I’ve managed to download Telegraf Binary and unzip.

I navigate to

cd /home/pi/telegraf/usr/bin

then

./telegraf

It says starting telegraf. Then Error running agent no config file specified…

Any thoughts appreciated :slight_smile:

You will need to create a config file, then start Telegraf with it: ./telegraf --config telegraf.conf

I recommend trying the .deb file since it is setup to run Telegraf as a service using a config in /etc/telegraf/telegraf.conf, this is a bit nicer once you get past the early testing stage.

1 Like

Ok thanks for the reply, seem to have something happening now.

I did…
./telegraf -sample-config -input-filter cpu:mem -output-filter influxdb > telegraf.conf
Instead of
telegraf -sample-config -input-filter cpu:mem -output-filter influxdb > telegraf.conf

as the tutorial suggested, to monitor cpu and mem usage. Probably obvious to others but I’m quiet new.

I then started telegraf as you suggested.

However, it now says " Error writing output… could not write to any address…connection refused"

Is this to do with permissions on the RPi perhaps?

Hi ,
that is because Telegraf expects an influx database up and running ,
because of the outputs part in the config.
Do you have Influxdb installed ?

best regards

Hi,

Sorry for the really late reply on this - I’ve been on other projects of late.

I see, no I don’t have Influxdb installed. I’ve now downloaded Influx1.7.6 but am having trouble installing.

I’ve run…

wget https://dl.influxdata.com/influxdb/releases/influxdb-1.7.6_linux_armhf.tar.gz
tar xvfz influxdb-1.7.6_linux_armhf.tar.gz

This has unzipped the files on my Raspberry Pi home. I can see a bin folder with lots of executables. Not sure how to install though.

As described I’m quiet new to RPi.

Any pointers most welcome :slight_smile:

Cheers

I’ve run…

wget

https://dl.influxdata.com/influxdb/releases/influxdb-1.7.6_linux_armhf.tar
.gz tar xvfz influxdb-1.7.6_linux_armhf.tar.gz

This has unzipped the files on my Raspberry Pi home. I can see a bin folder
with lots of executables. Not sure how to install though.

Isn’t influx available as a Raspbian package?

As described I’m quiet new to RPi.

Any pointers most welcome :slight_smile:

What does “aptitude search influx” tell you?

If it gives an error, please confirm what Operating System you’ve installed on
the Raspberry.

Antony.

Hi

aptitude search influx

returns
E: the list of sources could not be read

I am running Rasbian OS.

Does this mean I need to follow Debian from install page?..

https://portal.influxdata.com/downloads/

Hi

aptitude search influx

returns
E: the list of sources could not be read

Oh dear, that’s bad - it means you can’t install new software, update existing
software, or obtain security updates for your Raspberry.

I am running Rasbian OS.

I wonder how you installed it…

Does this mean I need to follow Debian from install page?..

It means you should check the contents of:

/etc/apt/sources.list

/etc/apt/sources.list.d/*

You should also make sure you have a working Internet connection to the
Raspberry (which I guess is true because you managed the wget) and a working
DNS service (ditto).

Antony.

Ok so

/etc/apt/sources.list

is a file with three lines that says to un-comment bottom line to enable apt-get source

and

/etc/apt/sources.list.d/*

Has a similar file as described above called raspi.list and an influxdb.list file.

Internet connection is fine.

Should I un-comment the bottom lines in these files?

Ok so

/etc/apt/sources.list

is a file with three lines that says to un-comment bottom line to enable
apt-get source

What exactly does it say?

It’s nothing confidential - there’s no reason not to post it to a public
mailing list.

It should be a working sources.list file, from wherever you installed
Raspian, but it sounds like there’s a problem.

and /etc/apt/sources.list.d/* has a similar file as described above called
raspi.list and an influxdb.list file.

How similar? I know this is getting off-topic for InfluxDB, but post the
contents of those files as well.

Internet connection is fine.

Good.

Should I un-comment the bottom lines in these files?

I don’t know until I know exactly what they say.

Antony.

sources.list

deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

Uncomment line below then ‘apt-get update’ to enable ‘apt-get source’

#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

and sources.list.d/raspi.list

deb http://archive.raspberrypi.org/debian/ stretch main ui

Uncomment line below then ‘apt-get update’ to enable ‘apt-get source’

#deb-src http://archive.raspberrypi.org/debian/ stretch main ui

also there is a sources.list.d/influxdb.list file

Does this make more sense?

And the influxdb file just one line

@deb https://repos.influxdata.com/debian stretch stable@