Conversation
|
Hi Yifan, thank you very much for your work! This looks like a great start. Let me get back to you later in the week as I have limited time right now and am trying to get the next release out as soon as possible. On the hub side we should probably create a new table (PocketBase collection) for this data. From my limited knowledge I think parsing There's also this Go library which provides SMART information: https://github.com/anatol/smart.go And a standalone application, Scrutiny, which is written in Go and may be a helpful reference: https://github.com/AnalogJ/scrutiny As far as hardware, I'm in the same boat as you. I actually don't even own a HDD, but we should be able to find some output samples online and use them as test data (or people using Beszel can provide them). Again, I appreciate your time and will get back to you as soon as I can. Edit: If anyone reads this and wants to provide sample output, please change the serial numbers before sharing. |
|
Thank you very much for your detailed response. First, I have considered using smart.go. If we use smart.go, we will be dependent on all its aspects (such as potential bugs and the possibility that its smart database may not be updated in a timely manner). If such issues arise and it is no longer maintained, all we can do is fork it, fix the bugs, or update the smart database. This would add a significant burden to the maintenance of beszel. In contrast, smartctl is a very widely used tool, with timely updates to the smart database and more prompt maintenance in case of bugs. Its support for JSON-formatted output is a great advantage for data parsing in Go. Regarding the macOS issue, I currently also have macOS and will conduct tests later. The hardware I currently have available for testing includes: NVMe/SATA/SCSI (only testable under Linux platform), and USB storage, which should cover mainstream hardware. What I really worry about are some corner cases. Additionally, I have a few issues that I am unsure how to handle:
EDIT: I checked the code of https://github.com/AnalogJ/scrutiny. Scrutiny parses the json output of smartctl to get the SMART info. |
|
Sounds good, I agree with the direct I don't think there's any reason to worry about corner cases in the first iteration. We'll get sample output and include the most important or common values. If there's an issue parsing then we'll just log an error. We can add support for more formats as people request them. Hopefully the JSON structure is consistent and it's just the properties that differ, because dealing with inconsistent JSON is not fun. The regular non-JSON output looks easy to parse, so we could just use Here's output from my laptop with one nvme drive:
|
Let me know what you need (and more so how to pull it) and I'll happily provide from across my drives. |
|
Recently, I've been occupied with other projects and haven't been able to dedicate much time to the SMART feature development. However, I may now be able to allocate some time to work on this, particularly on the front-end and database aspects (though I can't guarantee significant progress at this stage). Regarding the front-end implementation, I'd like to get your thoughts @henrygd : Do you think we should display the SMART data in a separate page, tab, or pop-up window? If so, where would you recommend placing it for optimal user experience? I don't have much expertise in UI/UX design, so I'd be happy to hear any suggestions or ideas from anyone ;). |
|
No worries Yifan! Please only work on it if you want to. Don't feel any obligation. What you've already done will be helpful even if you don't do anything more. We don't need to commit to a specific design right now, but my first thought is to put the SMART data on its own page. Here's how Scrutiny does it for reference: https://imgur.com/a/5k8qMzS Maybe on Alternatively, we can just stick the table under the other graphs on the system details page instead of making a standalone page for the SMART data table. In the future maybe we can include a table on the home page that lists all drives from all systems as well. IMO the most important part is getting the data where we need it. The layout can always be improved later. Edit: We use shadcn so you might find something here that fits well: https://ui.shadcn.com |
I think this would be perfect, at least for start. One panel with table, each drive in row. Temperature sensor data may be added to Temperature panel. |
|
Thought it might be useful to provide some output from a system with a large number of drives. My output is of the same commands as above, just with a smartscan.txt This setup is a total of 10 drives in the following configuration:
So the Also, I suggest that you key your data on the SN of the disk (or /dev/disk/by-id) rather than the device ID, because sometimes disks can change drive letters at boot when you have this many spread across multiple devices. |
|
@wesgeorge Thank you very much for providing the data and suggestions. I will modify the code for the agent part to make it more robust. Besides, I finished a front-end demo using some hard drive data (with fake serial numbers) I have on hand. Does anyone have any suggestions? Personally, I prefer displaying all disks in a list format and showing more detailed SMART information by clicking on the corresponding row (just like Proxmox VE).
EDIT1: I finished the SMART detail dialog.
|
|
@geekifan |
|
@zero77 Thank you for your suggestion! I will display the "When Failed" attribute in the SMART information table and highlight the failed attributes in red (or add an error icon) based on this property. |
Updated the SmartManager's methods to use the device's serial number as the key in the SmartDataMap instead of the device name.
Introduced a new Disks tab in the SystemDetail component to display disk information and S.M.A.R.T. data. The tab includes a table for visualizing disk attributes and their statuses. Also added SmartData and SmartAttribute interfaces to support the new functionality.
|
It's encouraging to see that the feature I was going to suggest is already in the works. |
|
@muro-dot On the agent side, the hard drive temperatures are read via SMART data and then incorporated into the system temperature readings. Therefore, you can find the temperature curves of different hard drives in the temperature sensor charts. |
|
Is there any chance to try it out before henrygd officially releases it? I'm really excited about the new features |
|
Well, I'm currently facing an issue. Should I set up alerts based on the smartd output from the monitoring target or implement alerts using the metrics obtained from Beszel? (I think the former might be better? After all, a solution implemented at the beszel hub side probably wouldn't be as comprehensive as the alerts in smartd.) |
I do agree to start the the alerts based on the smartd output, alerts based on other mertics can always be added later if there is an need for it. |
|
Is there any ETA for when this is added? Looks awesome. I would just change the "Type SAT" to "Type SATA" though. SAT sounds weird lol. "SAS" is a different type though. |
|
I'll try to get this in soon. Hopefully this month. |
Awesome! |
|
@henrygd Thanks hank! This PR is almost done except SMART monitor alerts. I'm busy with my academic work so I have no time to finish the SMART alerts. I would appreciate it if you could finish the rest. This PR is now review-ready. |
|
No worries Yifan, I'll finish it off. Thanks again for your work 👍 |
|
Hi, |
|
This is has finally been added. I need to finish the documentation and clean up a few things, but I'll try to have a release out this weekend. Thanks again for your efforts, Yifan! Sincerely appreciated. @M3rcur-x I added standby handling so it should only wake disks once. Then if the disk is sleeping again it will use the previous data. |


I follow the manner of
GPUManagerto add support for S.M.A.R.T to the agent. Since I am not an expert in Go and do not have enough physical devices around for testing, I hope someone can do a basic review of my code and test it on their own devices. Once everything is ready, I will proceed with modifying the hub's code.TODO: