February 5, 20179 yr I'm looking for a combination of linux commands that will find all attached devices, call smartctl for each device and will output a file per device. To make it perfect the name of the file should include the current date and the device identification. I tried the following command but I don't find the identification like "WDC_WD60EFRX-68L0BN1_WD-WX41D95PAC13": lsblk -d -n -oNAME,RO,MODEL | grep sd Any help is highly appreciated. ***EDIT:*** A little bit further now. Now I need to parse the output and create a smartctl call for every line giving a filename of the ID_SERIAL_SHORT as filename (with awk?): for d in /dev/sd?; do echo "$d" "$(udevadm info --query=all --name=$d|grep ID_SERIAL_SHORT)"; done
February 5, 20179 yr Author Ok, this one is ok for me: for d in /dev/sd?; do echo "$d " "$(udevadm info --query=all --name=$d|grep ID_SERIAL_SHORT=)"|awk '{if ($1 !~ /\/dev\/sda/){system("smartctl -A "$1" > "$3".txt")}}'; done
February 5, 20179 yr Or you could try the "diagnostics" command! In the diagnostics zip is a smart folder containing the SMART reports for all of your drives, correctly named with timestamps.
February 6, 20179 yr Author Diagnostics command tried for the first time --> error. All smartreports do contain the following error: smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.9.7-unRAID] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org ERROR: smartctl takes ONE device name as the final command-line argument. You have provided 2 device names: /dev/sdf Use smartctl -h to get a usage summary
February 6, 20179 yr Yeah, sorry! It has always worked perfectly - except right now with the 6.3 upgrade! A small bug in 6.3, will probably be fixed quickly.
Archived
This topic is now archived and is closed to further replies.