[collectd] Reading from a single value file?

Richard Weinberger richard.weinberger at gmail.com
Tue Dec 2 23:54:08 CET 2014


On Tue, Dec 2, 2014 at 11:27 PM, Bill Schwanitz <bilsch at gmail.com> wrote:
>
>> 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.

This is what I use currently.
The table plugin works too but for single value files it seems clumsy.

> 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?

25.6°C :)

-- 
Thanks,
//richard



More information about the collectd mailing list