lukasmalkmus / rpi_exporter

A Raspberry Pi CPU temperature exporter.
Apache License 2.0
78 stars 17 forks source link

Feature: Get values from file(s) #10

Open ruzickap opened 5 years ago

ruzickap commented 5 years ago

I have a suggestion for new feature for rpi_exporter.

Would it be possible to implement option like:

--collector.textfile.sources="/sys/bus/iio/devices/iio:device0/in_temp_input,/sys/bus/iio/devices/iio:device0/in_pressure_input"

Some sensors store it's values in /sys/ filesystem and data can be read easily from single file(s) for example:

# cat /sys/bus/iio/devices/iio:device0/in_pressure_input
99.606386718

# cat /sys/bus/iio/devices/iio:device0/in_temp_input
26320

Maybe such "feature", where you can specify multiple files to read, can be implemented in the feature...

paulfantom commented 4 years ago

I was going to suggest something similar, but for /sys/devices/platform/soc/soc:firmware/get_throttled. Such feature could replace https://github.com/custom-components/sensor.rpi_power for me.


OT: If someone needs it, I wrote an ansible role to install this exporter. Available at https://github.com/paulfantom/ansible-rpi-exporter and https://galaxy.ansible.com/paulfantom/rpi_exporter. It also includes a bit more secure version of systemd service file (https://github.com/paulfantom/ansible-rpi-exporter/blob/master/templates/rpi_exporter.service.j2)

lukasmalkmus commented 4 years ago

I'll look into that if I have some time around holidays.

Two questions:

  1. Can I link your ansible role in the README?
  2. Can I copy your improved systemd service file?
paulfantom commented 4 years ago

Can I link your ansible role in the README?

Yes

Can I copy your improved systemd service file?

Yes :)