[smartmontools-support] feature request: more json output please
Stefan K
Shadow_7 at gmx.net
Fri Sep 16 12:42:31 CEST 2022
Hi Christian,
thank you very much for this code-snippet, that helps me a lot, but it's still be a good feature ;-)
best regards
Stefan
> Gesendet: Dienstag, 13. September 2022 um 18:48 Uhr
> Von: "Christian Franke" <Christian.Franke at t-online.de>
> An: "Stefan K" <Shadow_7 at gmx.net>
> Cc: smartmontools-support at listi.jpberlin.de
> Betreff: Re: [smartmontools-support] feature request: more json output please
>
> Stefan K wrote:
> > the "new" json output is really great, with that its easier to monitor harddisk. But I still need the path to the devices, but --scan(-open) scans already the devices, so why not show the complete ouput? Or why I can't combine parameters like:
> > smartctl --scan-open -j -a
> > which shows all harddisk which are supported by smartctl with all informations he got.
>
> It is not planned to implemented this in the near future.
>
> This script runs smartctl for each device from --scan result and prints
> all outputs as one JSON array. Pass e.g. '-x' as argument:
>
> #!/bin/sh
> status=0
> first=true
> echo "["
> for dev in $(smartctl --scan | sed -n 's,^\(/[^ ]*\).*$,\1,p'); do
> if $first; then first=false; else echo " ,"; fi
> out=$(smartctl -j "$@" "$dev")
> status=$((status | $?))
> echo "$out" | sed 's,^, ,'
> done
> echo "]"
> exit $status
>
> Regards,
> Christian
>
> _______________________________________________
> Smartmontools-support mailing list
> Smartmontools-support at listi.jpberlin.de
> https://listi.jpberlin.de/mailman/listinfo/smartmontools-support
>
More information about the Smartmontools-support
mailing list