Maverickcdn
Senior Member
Simple HND Router CPU temperature logging
Polls CPU temp at set interval and calculates period average for set logging interval. Records time/date/temp of CPU Alltime High/Low Temps.
To download, scripts must be enabled, from an SSH terminal, copy/paste
To start polling the CPU Temperature and begin automatic logging
To manually log currently polled temps (forces new logging period)
Default install will log every 6 hours with 20s CPU temperature polling. Edit the variables within tempmon.sh to suit your desires. (4 times per/day is less spammy than hourly but better averages than 1 day logging)
Polling monitor does not survive reboots, if you wish to have script run on reboot, call this script with the start polling command in the background within a /jffs/scripts/services-start script
All time High/Low CPU temps do not survive reboots, they're meant to reflect uptime high/low
Try not to set low poll rates (eg 2sec) with long log periods (eg days) polled temps are saved to /tmp (ram) and unsure how long it would take to run the logging
Github
Happy routing.
V1.10 May 8 2024 Changed the way the output logging looks, added date/time for high/low temps
(use nano and edit these lines in the file for log_interval log_interval_unit and poll_freq)
Polls CPU temp at set interval and calculates period average for set logging interval. Records time/date/temp of CPU Alltime High/Low Temps.
To download, scripts must be enabled, from an SSH terminal, copy/paste
Code:
curl --retry 3 "https://raw.githubusercontent.com/maverickcdn/tempmon/master/tempmon.sh" -o "/jffs/scripts/tempmon.sh" && chmod a+rx "/jffs/scripts/tempmon.sh"
To start polling the CPU Temperature and begin automatic logging
Code:
sh /jffs/scripts/tempmon.sh
Code:
sh /jffs/scripts/tempmon.sh logging
Default install will log every 6 hours with 20s CPU temperature polling. Edit the variables within tempmon.sh to suit your desires. (4 times per/day is less spammy than hourly but better averages than 1 day logging)
Polling monitor does not survive reboots, if you wish to have script run on reboot, call this script with the start polling command in the background within a /jffs/scripts/services-start script
Sass:
sh /jffs/scripts/tempmon.sh &
All time High/Low CPU temps do not survive reboots, they're meant to reflect uptime high/low
Try not to set low poll rates (eg 2sec) with long log periods (eg days) polled temps are saved to /tmp (ram) and unsure how long it would take to run the logging
Github
Happy routing.
V1.10 May 8 2024 Changed the way the output logging looks, added date/time for high/low temps
(use nano and edit these lines in the file for log_interval log_interval_unit and poll_freq)
Last edited: