-
-
Notifications
You must be signed in to change notification settings - Fork 222
Fix retrieval of temperature history data (fix #494) #557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
bca8876 to
7d50795
Compare
|
Also, to mitigate this change, the default |
|
@AnalogJ I'd like to have your feedback on this PR. Here is a screenshot of my temperature history graph (with temperature history retrieval enabled) : |
6dd5c67 to
ebc4193
Compare
(not tested yet)
|
Hey @mcarbonne appreciate your work here -- but yeah I'd rather add a switch to enable/disable it, rather than remove it completely |
Thanks for you feedback. I have updated my PR with your suggestions but I have not yet been able to test this change: I have build issues (npm related) but haven't found out if it's related to my changes but it is similar to the nightly build issue. I'll try to investigate when I have time. |
|
@AnalogJ build is working again, feature is behaving as expected, docker image is available (ghcr.io/mcarbonne/scrutiny:master-omnibus). Feel free to give me your feedback. |
Conflicts: webapp/backend/pkg/database/scrutiny_repository_migrations.go
|
@AnalogJ PR updated :) |
|
Would be great if this could get merged anytime soon. |
|
This looks good, let me check why the CI isn't running. |
|
I did some testing on my fork and indeed, workflows need a little update. I included it in my PR (commit b7d57c0). This is mandatory according to documentation:
EDIT : this is a breaking change with v4: |
|
so how's the merging of this looking? |
## [1.1.0](v1.0.0...v1.1.0) (2025-11-30) ### Features * Add "day" as resolution for temperature graph ([2670af2](2670af2)) * add day resolution for temperature graph (upstream PR [AnalogJ#823](https://github.com/Starosdev/scrutiny/issues/823)) ([2d6ffa7](2d6ffa7)) * add setting to enable/disable SCT temperature history (upstream PR [AnalogJ#557](https://github.com/Starosdev/scrutiny/issues/557)) ([c3692ac](c3692ac)) * Implement device-wise notification mute/unmute ([925e86d](925e86d)) * implement device-wise notification mute/unmute (upstream PR [AnalogJ#822](https://github.com/Starosdev/scrutiny/issues/822)) ([ea7102e](ea7102e)) * implement Prometheus metrics support (upstream PR [AnalogJ#830](https://github.com/Starosdev/scrutiny/issues/830)) ([7384f7d](7384f7d)) * support SAS temperature (upstream PR [AnalogJ#816](https://github.com/Starosdev/scrutiny/issues/816)) ([f954cc8](f954cc8)) ### Bug Fixes * better handling of ata_sct_temperature_history (upstream PR [AnalogJ#825](https://github.com/Starosdev/scrutiny/issues/825)) ([d134ad7](d134ad7)) * **database:** add missing temperature parameter in SCSI migration ([df7da88](df7da88)) * support transient SMART failures (upstream PR [AnalogJ#375](https://github.com/Starosdev/scrutiny/issues/375)) ([601775e](601775e)) * **ui:** fix temperature conversion in temperature.pipe.ts (upstream PR [AnalogJ#815](https://github.com/Starosdev/scrutiny/issues/815)) ([e0f2781](e0f2781)) ### Refactoring * use limit() instead of tail() for fetching smart attributes (upstream PR [AnalogJ#829](https://github.com/Starosdev/scrutiny/issues/829)) ([2849531](2849531))

This PR allow temperature history data to be retrieved correctly, usingIndexandSizefields.collectorSmartData.AtaSctTemperatureHistory.Tableis now managed as a circular buffer, starting fromIndex.EDIT : I was wrong. The SCT temperature history table is indeed a circular buffer starting from index.
But when outputting json,
smartmontoolsdo re-order entries: first = oldest, last = most recent (seeataPrintSCTTempHistfromsmartmontools).Details about spec here:
https://tc.gts3.org/cs3210/2016/spring/r/hardware/ATA8-ACS.pdf
(table 82 mostly)
And json generation from smartmontools here:
https://github.com/mirror/smartmontools/blob/master/ataprint.cpp (function
ataPrintSCTTempHist)Anyway, based on my observations,
ataPrintSCTTempHistisn't reliable. I tested on 4 SSD (kingston, 2x micron, crucial) and none are fully compliant with the specification.Here are some issues I found:
logging_interval_minutes/sampling_period_minutesisn't always correct.Example (Micron 5200 Pro):
2 minutes later :
Most likely, the "real" logging interval is ~ 30 seconds, but this interval is stored in an integer, it cannot work.
Therefore, only the current temperature (the last element of the table from json output) is correct.
0x80, translated tonullin json and0ingo) but:0x80when resuming from sleep.All values before this magical values must be ignored (because timestamp cannot be guessed). The current implementation only ignore "null" values, but not all the values before.
Current implementation seems to parse the history the wrong way (first=most recent, last=oldest).@AnalogJ maybe you have more data than me to confirm my observations. If you agree, my proposal is to simply remove history retrieval.
Note: This will fix #494 once for all