-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature request: HDD S.M.A.R.T. reports #1288
Comments
Hi, this proposal has already be discussed. The main issue is that the Glances running process has to be ran as root in order to grab the S.M.A.R.T stats. A test has been done with the pySMART lib (https://pypi.org/project/py.SMART/) and confirms it:
I do not want to implement a specific root function in Glances... If you know another solution, let me know. |
I think - for a system monitoring tool - it is reasonable for users to expect that certain features could require admin privileges. Wouldn't it be fair to wrap the entire "S.M.A.R.T." info block into a try/except, and simply not display the info, with an error message in the log? Or mark "not available" for any fields which cannot be accessed? Those of us that are happy to run as root could see them; anyone without can just realize that's the price you pay for access to SMART data. |
Ok will have a look on this issue. |
For display question: Suggestion: Any abnormal SMART state would making the reading of throughput indication red and add a line below with keyboard hint to display SMART info when abnormal. |
You can configure smartd to write reports to CSV files: https://www.smartmontools.org/browser/trunk/smartmontools/smartd.8.in#lbAE. It would require more setup to use, but it could avoid requiring root permissions. |
If you would like, I am happy to implement this. I have done something similar before. I can also look into configuration to give a regular user permission for this and add to documentation and/or create a script. |
Ok, pySMART doesn't look like quite the silver bullet. The library that is in pip only works on python2. There are forks that are patched for python3, so I've just put in a check for python version to determine which library version to use. With regards to using as non root, this is not looking very promising (see https://medium.com/opsops/why-smartctl-could-not-be-run-without-root-7ea0583b1323). Adding the user to the disk group on Linux seems to enable limited functionality of smartctl, but causes some havoc with pySMART. For now I have just added a check to see if the user is root/admin and disable the plugin if not. Having a web service running as root like that is terrible, but hey, let the user decide if they want to die in a fire. At this point, I have the plugin in such a state that http://0.0.0.0:61208/api/3/all contains all of the SMART attribute data. I'm a bit stuck on how to present the data to the end user. For one thing, it is a lot of data and the curses GUI is very full. I see that there is a csv export in the code, so perhaps that would be the best output method. How do we want this data presented to the user? |
Please test the feature from the DEVELOP branch (Glances 3.1_beta). |
Manually tested and passed on current DEVELOP branch at commit cee0caf.
|
An implementation of a basic UI (Curse and WebUI) will be nice. Any contributors ? |
I'm happy to do this when I have a bit of time. I gave the UI some thought and the only important attribute value for the UI to show, really, is the raw value. If we display the attribute name and the raw value, this should save some UI space. We can color the attribute if the raw value is outside the acceptable range. |
UI (terminal only) implementation done in the DEVELOP branch. Please can you test it with:
|
Tested on Ubuntu 18.04 64bit / Linux 4.15.0-70-generic. Tested on both Python 2.7.15 and 3.6.8. As an additional note, I was not able to see the entire smart output, as it extended past the bottom of the screen. It was not apparent to me if there was a method to scroll the left bar down. I was able to see more of the smart output by disabling the diskio plugin and top menu, but still wasn't able to view the full output in the visible UI. |
python3 -m glances --stdout smart I think you missed something in the dependencies, like smartmontools. Also hddtemp is very old and unmantained and requires escalated privileged and removed and pySMART.smartx is removed from github. TLDR: it's a steaming pile of shit. |
Description
It would be very useful to include S.M.A.R.T. data from attached drives, especially since this application is geared towards server environments.
Drive temperature data and general health status would be the most useful.
Smartmontools seem to be the lowest barrier to entry for this feature, and it is multi-platform.
https://www.smartmontools.org/
I am running Glances on Windows, so similar sensor-based solutions using hddtemp do not work (to my knowledge)
The text was updated successfully, but these errors were encountered: