Sample Header Ad - 728x90

script to log temperature on armbian

1 vote
2 answers
1772 views
I am aware that there are other questions asking very similar questions, but none seems to answer my problem. I am running an odroid hc2 sbc with armbian for a nextcloud instance. Two days ago, it crashed, for the first time, after running stable for over a year. To rule out overheating as a reason, I'd like to write a script to monitor temperature, i.e. running the built in function "armbianmonitor", which creates this continous output: Stop monitoring using [ctrl]-[c] Time big.LITTLE load %cpu %sys %usr %nice %io %irq CPU C.St. 09:52:33: 600/ 600MHz 0.23 12% 1% 10% 0% 0% 0% 53.0°C 0/13 09:52:38: 1400/ 600MHz 0.21 2% 0% 1% 0% 0% 0% 53.0°C 0/13 09:52:43: 1400/ 600MHz 0.20 2% 0% 1% 0% 0% 0% 53.0°C 0/13^C with: sudo armbianmonitor -m | awk '$11 ~ "°C" {print $1; print $1;exit1}' ORS=' ' I get this results: 09:57:48: 53.0°C 09:57:53: 51.0°C 09:57:58: 51.0°C 09:58:03: 51.0°C but... I'd like to have only one pair (time and temperature) per run of the script. In other word, awk and /or (?) armbianmonitor are supposed to stop after they return the first pair. I've also tried to pipe the output of a script invoking this command to a file, but the file remains blank, maybe because armbianmonitor creates a continuous output?
Asked by Beres (53 rep)
Aug 12, 2020, 10:08 AM
Last activity: May 5, 2023, 08:12 PM