lukasmalkmus / rpi_exporter

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

Add support for Rock Pi GPU temp #14

Open jorkzijlstra opened 4 years ago

jorkzijlstra commented 4 years ago

Hello,

Currently I'm using a Rock Pi 4B with your arm_exporter. Its working great for the CPU temperature. Its only logging an exception for the gpu temperature:

time="2020-10-19T20:04:32Z" level=error msg="gpu collector failed after 0.006953s: exit status 255" source="collector.go:142"

The reason is because the files aren't there on the Ubuntu.

CPU temp:

x@x:/sys/class/thermal/thermal_zone0$ cat type 
soc-thermal
x@x:/sys/class/thermal/thermal_zone0$ cat temp 
46250

GPU temp

x@x:/sys/class/thermal/thermal_zone1$ cat type 
gpu-thermal
x@x:/sys/class/thermal/thermal_zone1$ cat temp 
42777

Would it be possible to include these in the gpu exporter.

lukasmalkmus commented 4 years ago

I could look into that. This would require some additional checks. Do you feel confident building from source so you can check it is working on the actual hardware if I bring up a PR?

Till then, maybe you can tinker around with this: https://gist.github.com/lukasmalkmus/410232035c3e831cb780347e77ae5382

jorkzijlstra commented 4 years ago

@lukasmalkmus I'm a programmer but just not used to Go. I already had a look into the code and my plan was to return a specific collector based upon the existence of the files in the NewGPUCollector method but I haven't had the change to actually make a change let alone a PR.

So I'm fine building it from scratch.