[collectd] Reading from a single value file?

Bill Schwanitz bilsch at gmail.com
Tue Dec 2 23:27:28 CET 2014


> On Dec 2, 2014, at 4:58 PM, Richard Weinberger <richard.weinberger at gmail.com> wrote:
> 
> Hi!
> 
> What is the best way to read from a single value file?
> i.e. a file like:
> # cat /sys/bus/iio/devices/iio:device1/in_temp_input
> 25600

I would just use the exec plugin (https://collectd.org/wiki/index.php/Plugin:Exec) for something like this.

Basically you need to decide if it is a counter, gauge or derivative, then adjust the output.

while(true)
do
  echo "PUTVAL \”${hostname}/sensor-${instance}/gauge-${label}\" interval=$COLLECTD_INTERVAL N:${recorded_value}”
  sleep $COLLECTD_INTERVAL
done

do you know what the value data is? 25600 seems a high input temperature. What is the scale?





More information about the collectd mailing list