Skip to content
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

Could you recapture all the data using --json switch for smartctl? #1

Open
KOLANICH opened this issue Jan 16, 2020 · 9 comments
Open

Comments

@KOLANICH
Copy link

No description provided.

@chrfranke
Copy link

Consider to use --json=o to include original output as JSON array smartctl.output[].

@KOLANICH
Copy link
Author

@chrfranke, I feel like we'll have to write a parser for smartctl output... BTW, what is your project/research?

@chrfranke
Copy link

I agree that linuxhw/SMART and the similar project bsdhw/SMART should use JSON output if smartctl >= 7.0 is available. With option --json=o, the traditional output could be easily extracted later (for example with: jq -r '.smartctl.output[]' ).
BTW, my project is smartmontools itself :-)

@KOLANICH
Copy link
Author

KOLANICH commented Jun 25, 2020

Do we need traditional output? Can't it be recreated from JSON, if needed?

@chrfranke
Copy link

JSON output does still not include all info from traditional output. ATA/SATA is fairly complete (see ticket 767), but SCSI/SAS and NVMe are not. Try --json=u to see affected lines as strings named smartctl_NNNN_u.
No, there is no easy way to recreate traditional output from JSON output.

@bsdhw
Copy link

bsdhw commented Jun 30, 2020

Recapturing of existing probes is not possible because people usually don't create more than one probe of the computer.

We can capture this json output in addition to default one in the next version of the hw-probe utility.

@bsdhw
Copy link

bsdhw commented Jun 30, 2020

Is it not possible to generate such json output from default plain format by a script?

@KOLANICH
Copy link
Author

Is it not possible to generate such json output from default plain format by a script?

Should be possible, but it is damn a lot of work - to create a convertor for a plain-text format and then debug and test it.

@danieldjewell
Copy link

As I just posted in the hw-probe repo (linuxhw/hw-probe#156) ... Not having the parsed data makes things much more difficult. It's clear that something is parsing the data and generating the Markdown files... But those scripts/programs don't appear to be available?

It would also be useful to understand the methodology/code being used to generate some of the Markdown tables... (Not that I see any particular issues with the methodology ... but not having the code that generates the reports makes independent/peer review next to impossible.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants