Parsing the output of the smartctl output was more of a poor-man's way to get the SMART information (still easier too implement than figuring out how to get the raw smart values directly from the drive).
Recent versions of smartmontools have a JSON output (via the -j argument) which removes a lot of the guesswork and manual parsing of the output.
- Support (and prefer) the JSON output when calling
smartctl
- Fallback to parsing the output if the installed versions does not support the
-j argument.
Parsing the output of the
smartctloutput was more of a poor-man's way to get the SMART information (still easier too implement than figuring out how to get the raw smart values directly from the drive).Recent versions of
smartmontoolshave a JSON output (via the-jargument) which removes a lot of the guesswork and manual parsing of the output.smartctl-jargument.