Hi @davidgs,
I’m trying to install Telegraf (and then the full TICK stack) on a Raspberry Pi via resin.io
For @chris : the debian packages probably works if you are doing a manual install on raspbian, but if you are using resin .io, you can’t interact with systemd during Docker image build, you have to do it in a start .sh script in the CMD part of the Dockerfile.
About systemd, I’m really stuck at making it start my telegraf process, even if it says all is ok (I’m using the provided telegraf.service as is), I could use some help.
In my Dockerfile, I have :
# Install telegraf
&& wget -O /tmp/telegraf.deb https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}_armhf.deb \
&& dpkg -i /tmp/telegraf.deb \
&& rm /tmp/telegraf.deb \
&& cp /usr/lib/telegraf/scripts/telegraf.service /usr/lib/systemd/system/telegraf.service
When I try a manual start (as root), all is perfect :
root@d367deb:/# telegraf -config /etc/telegraf/telegraf.conf
2017-09-05T16:53:12Z I! Starting Telegraf (version 1.3.5)
2017-09-05T16:53:12Z I! Loaded outputs: file
2017-09-05T16:53:12Z I! Loaded inputs: inputs.cpu inputs.disk inputs.mem inputs.swap
2017-09-05T16:53:12Z I! Tags enabled: host=d367deb
2017-09-05T16:53:12Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"d367deb", Flush Interval:10s
and then it writes my data to stdout and to /tmp/metrics.out every 10 seconds, as configured.
BUT when I do :
systecmctl enable telegraf
systecmctl daemon-reload
systecmctl start telegraf
systecmctl status telegraf
It says :
root@d367deb:/# systemctl status telegraf
● telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2017-09-05 17:52:33 CEST; 1h 3min ago
Docs: https://github.com/influxdata/telegraf
CGroup: /docker/6710270aa1d60c01a30b13143c3ff727785260ea52f51632fbf0c2811f696f41/system.slice/telegraf.service
Sep 05 17:52:32 d367deb systemd[1]: Starting LSB: Start telegraf at boot time...
Sep 05 17:52:32 d367deb telegraf[49]: Starting the process telegraf [ OK ]
Sep 05 17:52:33 d367deb telegraf[49]: telegraf process was started [ OK ]
Sep 05 17:52:33 d367deb systemd[1]: Started LSB: Start telegraf at boot time.
But despite all the “OK”, nothing is running and nothing is written in /tmp/metrics.out.
Where could I find logs about this issue ? systemd logs are empty and /var/log/telegraf logs are empty as well.
Should I configure something in the provided telegraf.service ?
I guess it’s some permission issue when running as user “telegraf”, but I’d really like to see some errors logged about this.
UPDATE :
Also I’d like to say permissions don’t seem to be an issue, so maybe it’s a pure systemd config problem :
sudo -u telegraf bash -c 'telegraf -config /etc/telegraf/telegraf.conf'
works perfectly.