SMART icon indicating copy to clipboard operation
SMART copied to clipboard

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

Open KOLANICH opened this issue 5 years ago • 9 comments

KOLANICH avatar Jan 16 '20 00:01 KOLANICH

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

chrfranke avatar Jun 25 '20 05:06 chrfranke

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

KOLANICH avatar Jun 25 '20 06:06 KOLANICH

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 :-)

chrfranke avatar Jun 25 '20 14:06 chrfranke

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

KOLANICH avatar Jun 25 '20 16:06 KOLANICH

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.

chrfranke avatar Jun 27 '20 13:06 chrfranke

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 avatar Jun 30 '20 19:06 bsdhw

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

bsdhw avatar Jun 30 '20 19:06 bsdhw

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.

KOLANICH avatar Jun 30 '20 19:06 KOLANICH

As I just posted in the hw-probe repo (https://github.com/linuxhw/hw-probe/issues/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.)

danieldjewell avatar Apr 08 '23 01:04 danieldjewell