-
Notifications
You must be signed in to change notification settings - Fork 35
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
Some data parsing seems wrong? #46
Comments
Diagnostic information do not have a stable format across device-types in smartctl... It's a very pain in the ass must say. It depends on if it is a SSD over SATA/SAS or Raid card or if it is a nvme. On each interface we have a very different output. I don't have an "endurance" entry on my testing dataset, but I think is worth to add "Percentage Used" as 100 - Life_left. Also, I'm going to check if we can add more values from the NVMe Log to the diagnostics structure, but, in any case, it may be a better idea to design a refactor. If you are interested in a subset of those params, please tell me so I can prioritize them. |
I've added a new field to device called Please, confirm me that field fixes your issues and you could get the info you need. To install using pypi try: |
What about using json format with flag |
My implementation here with json format and asyncio support, and I need more test data because I don't have any SAS or SCSI drive. Those todos are currently haven't been implemented. In order to get full data of the drive, I add a new attribute |
Here is my own test data, from my hdd and ssd. |
Thanks for your contrib @synodriver , However... Of course it would be easier to migrate everything into a JSON parsing and update the output API of pysmart (which is... not very friendly and very underlaying-protocol dependant) BUT we have tons of test to release something in that line and I don't have every single testcase (on the recent months there were many issues related with cornercases, most of them NON related with text-parsing but mostly on regexes & postprocesing!) If you really wanna help, we can create a branch and begin working there together. I would upload as much tests as I could and try to do our best. Nonetheless consider this may be a long-term update, as, if we have to wait until we have enough test data to release it confidently. |
Json output does not always holds all the output that text output gives. Especially in older smartctl versions. I work with v7.2 and do observe sometimes log parts missing in the json output. In older versions I've seen it more frequently. Text output is more reliable. |
The regexes always cause some weird problems on my computer, so I made a decision to use json format instead. As for the output data... to be honest I haven’t notice that. |
@synodriver , in that case, please, share those issues so we can fix them. Thank you |
I've added your tests to the test folder. I haven't found any issue. Please, describe the problem you were having with the regexes |
The code of py-SMART in
device.update()
:And my output of smartctl:
For example,
Life_Left
of smartctl isPercentage Used
, but py-SMART isused endurance
, the two don't seem to match?The text was updated successfully, but these errors were encountered: