Improve temperature messages

This commit is contained in:
Andrea Mazzoleni 2025-10-26 11:34:59 +01:00
parent ac986579d7
commit a145ab5674
4 changed files with 17 additions and 20 deletions

View file

@ -205,13 +205,13 @@ void state_thermal(struct snapraid_state* state, time_t now)
if (temp < 0) if (temp < 0)
continue; continue;
log_tag("thermal:ambient:candidate:%d\n", temp); log_tag("thermal:system:candidate:%d\n", temp);
if (state->thermal_ambient_temperature == 0 || state->thermal_ambient_temperature > temp) if (state->thermal_ambient_temperature == 0 || state->thermal_ambient_temperature > temp)
state->thermal_ambient_temperature = temp; state->thermal_ambient_temperature = temp;
} }
log_tag("thermal:ambient:final:%d\n", state->thermal_ambient_temperature); log_tag("thermal:system:final:%d\n", state->thermal_ambient_temperature);
} }
int highest_temperature = 0; int highest_temperature = 0;
@ -351,11 +351,11 @@ int state_thermal_begin(struct snapraid_state* state, time_t now)
state_thermal(state, now); state_thermal(state, now);
if (state->thermal_ambient_temperature != 0) { if (state->thermal_ambient_temperature != 0) {
printf("Ambient temperature %u\n", state->thermal_ambient_temperature); printf("System temperature is %u degrees\n", state->thermal_ambient_temperature);
if (state->thermal_temperature_limit != 0 && state->thermal_temperature_limit <= state->thermal_ambient_temperature) { if (state->thermal_temperature_limit != 0 && state->thermal_temperature_limit <= state->thermal_ambient_temperature) {
/* LCOV_EXCL_START */ /* LCOV_EXCL_START */
log_fatal("DANGER! Ambient temperature %d higher than the temperature limit %d. Impossible to proceeed!\n", state->thermal_ambient_temperature, state->thermal_temperature_limit); log_fatal("DANGER! System temperature of %d degrees is higher than the temperature limit of %d degrees. Unable to proceeed!\n", state->thermal_ambient_temperature, state->thermal_temperature_limit);
log_flush(); log_flush();
return 0; return 0;
/* LCOV_EXCL_STOP */ /* LCOV_EXCL_STOP */
@ -364,7 +364,7 @@ int state_thermal_begin(struct snapraid_state* state, time_t now)
if (state_thermal_alarm(state)) { if (state_thermal_alarm(state)) {
/* LCOV_EXCL_START */ /* LCOV_EXCL_START */
log_fatal("DANGER! Hard disk temperature %d is already outside the operating range. Impossible to proceeed!\n", state->thermal_highest_temperature); log_fatal("DANGER! Hard disk temperature of %d degrees is already outside the operating range. Unable to proceeed!\n", state->thermal_highest_temperature);
log_flush(); log_flush();
return 0; return 0;
/* LCOV_EXCL_STOP */ /* LCOV_EXCL_STOP */

View file

@ -1514,11 +1514,10 @@ adequate. This estimated temperature is for informational purposes
only and has no effect on the behavior of SnapRAID. The program\'s only and has no effect on the behavior of SnapRAID. The program\'s
actions are based solely on the actual measured disk temperatures. actions are based solely on the actual measured disk temperatures.
.PP .PP
To perform this analysis, SnapRAID needs a reference for the ambient To perform this analysis, SnapRAID needs a reference for the system
system temperature. It first attempts to read it from available temperature. It first attempts to read it from available hardware
hardware sensors. If no system sensor can be accessed, it uses the sensors. If no system sensor can be accessed, it uses the lowest disk
lowest disk temperature measured at the start of the run as a fallback temperature measured at the start of the run as a fallback reference.
reference.
.PP .PP
Normally, SnapRAID shows only the temperature of the hottest disk. Normally, SnapRAID shows only the temperature of the hottest disk.
To display the temperature of all disks, use the \-A or \-\-stats option. To display the temperature of all disks, use the \-A or \-\-stats option.

View file

@ -1222,11 +1222,10 @@ Configuration
only and has no effect on the behavior of SnapRAID. The program's only and has no effect on the behavior of SnapRAID. The program's
actions are based solely on the actual measured disk temperatures. actions are based solely on the actual measured disk temperatures.
To perform this analysis, SnapRAID needs a reference for the ambient To perform this analysis, SnapRAID needs a reference for the system
system temperature. It first attempts to read it from available temperature. It first attempts to read it from available hardware
hardware sensors. If no system sensor can be accessed, it uses the sensors. If no system sensor can be accessed, it uses the lowest disk
lowest disk temperature measured at the start of the run as a fallback temperature measured at the start of the run as a fallback reference.
reference.
Normally, SnapRAID shows only the temperature of the hottest disk. Normally, SnapRAID shows only the temperature of the hottest disk.
To display the temperature of all disks, use the -A or --stats option. To display the temperature of all disks, use the -A or --stats option.

View file

@ -1306,11 +1306,10 @@ adequate. This estimated temperature is for informational purposes
only and has no effect on the behavior of SnapRAID. The program's only and has no effect on the behavior of SnapRAID. The program's
actions are based solely on the actual measured disk temperatures. actions are based solely on the actual measured disk temperatures.
To perform this analysis, SnapRAID needs a reference for the ambient To perform this analysis, SnapRAID needs a reference for the system
system temperature. It first attempts to read it from available temperature. It first attempts to read it from available hardware
hardware sensors. If no system sensor can be accessed, it uses the sensors. If no system sensor can be accessed, it uses the lowest disk
lowest disk temperature measured at the start of the run as a fallback temperature measured at the start of the run as a fallback reference.
reference.
Normally, SnapRAID shows only the temperature of the hottest disk. Normally, SnapRAID shows only the temperature of the hottest disk.
To display the temperature of all disks, use the -A or --stats option. To display the temperature of all disks, use the -A or --stats option.