S.M.A.R.T.: How to read? lazarus / 21-General ---------------------------------------------------------------------- Milsa · 2021-01-06 17:35 I can't find anything about this. ---------------------------------------------------------------------- MarkMLl · 2021-01-06 17:54 And you won't find it here if you don't tell people what OS etc. you're using. MarkMLl ---------------------------------------------------------------------- Blaazen · 2021-01-06 17:58 Linux: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ sudo smartctl -a /dev/sda ---------------------------------------------------------------------- Milsa · 2021-01-06 21:01 Quote from: MarkMLl on January 06, 2021, 06:54:38 pmAnd you won't find it here if you don't tell people what OS etc. you're using. MarkMLl Windows and Linux. ---------------------------------------------------------------------- Milsa · 2021-01-06 21:02 Quote from: Blaazen on January 06, 2021, 06:58:29 pmLinux: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ sudo smartctl -a /dev/sdaIn "Programming > General"? ;-) ---------------------------------------------------------------------- MarkMLl · 2021-01-06 21:45 Quote from: Milsa on January 06, 2021, 10:02:38 pmQuote from: Blaazen on January 06, 2021, 06:58:29 pmLinux: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ sudo smartctl -a /dev/sdaIn "Programming > General"? ;-) I think you mean "please explain how that helps me get it under program control." The canonical answer would be that the source of that utility will be available, and in practice it is likely to be a thin wrapper around something in /proc or /sys. However you might also find that it interfaces to the /dev/sda "device driver" (i.e. in the current context a kernel module) via an ioctl call, and my experience with these is that you can find yourself in very deep water due to data structure packing peculiarities etc. Poking around on Debian suggests that the libatasmart4 package is relevant, but I've not gone any deeper looking at the API. My suggestion would be at least to start off with a "quick and dirty" solution parsing the output of some of the dedicated utilities, particularly since some of them appear to be oriented towards Munin etc. so are designed for that sort of thing. Sorry I can't help on Windows, haven't really touched it for decades. MarkMLl ---------------------------------------------------------------------- Milsa · 2021-01-06 23:32 Thank you for your answer. Excuse me my previous answer. I did not want to offend you. I just wasn't sure we understood. I thought there was a library for SMART for Lazarus. I used to find something for Delphi, but now I can't find it. I suspect something was still missing in that code. ---------------------------------------------------------------------- Milsa · 2021-01-06 23:35 I found it now! https://www.delphipraxis.net/97172-s-m-r-t-figured-out.html I couldn't run this code. I'll try again. ---------------------------------------------------------------------- speter · 2021-01-07 04:10 Milsa, two comments about the code you have linked:  (1) it is from 2007; and so might be totally out of date; and  (2) do you have code for the "smart_drv" unit (which is in the uses statement)? I am guessing, but if you don't have it, it might be a dead-end.... Quote from: Milsa on January 07, 2021, 12:35:51 amI found it now! https://www.delphipraxis.net/97172-s-m-r-t-figured-out.html I couldn't run this code. I'll try again. cheers S. EDIT: the code for the smart_drv unit is included on the page. ---------------------------------------------------------------------- Milsa · 2021-01-17 19:27 My link is usable only for IDE drives. I have SATA and MVME drives. Does exists any code for SATA or MVME drives? ---------------------------------------------------------------------- MarkMLl · 2021-01-17 20:31 Does the utility that Blaazen pointed you at work? This might vary depending on which driver (kernel module) is being used... I'm really not up to date on the possibilities. MarkMLl ---------------------------------------------------------------------- JernejL · 2021-01-18 09:54 On windows, query it from WMI.