[smartmontools-support] Raw output?

Christian Franke Christian.Franke at t-online.de
Fri May 21 19:56:09 CEST 2021


Schorschi Decker wrote:
> Just a suggestion, but some type of standard raw output would be a 
> nice feature to add!  Maybe consider it?  I love the about from -a and 
> -P for example, but parsing the output via scripts or monitoring tools 
> is a real PITA at times.

Please note that there is '--json' support since smartctl 7.0. This also 
provides some values like model_name, temperature, ... in a common 
format for ATA/SCSI/NVMe. The plaintext output could be included 
(--json=o). There is also flat output variant suitable for grep, for 
example:

# smartctl --json=g -i -A /dev/sdb | egrep 
'model_name|hours|temperature\.curr'
json.model_name = "Samsung SSD 860 EVO 4TB";
json.power_on_time.hours = 3934;
json.temperature.current = 24;

Thanks,
Christian



More information about the Smartmontools-support mailing list