Add support for getting SN from nvme command line tool
Kyle Sheumaker [Mon, 28 Aug 2017 19:42:13 +0000 (14:42 -0500)]
etc/hardware_output.sh

index f49c9ec..95b8c1c 100755 (executable)
@@ -50,7 +50,7 @@ disk_list() {
                        size=`disk_size $dev`
                        model=`cat /sys/block/$dev/device/model`
                        vendor=`cat /sys/block/$dev/device/vendor`      
-                       disk_sn=`disk_serialno $dev`
+                       disk_sn=`nvme_serialno $dev`
                        scsi="${scsi} ### $dev:$size:$vendor $model"
 
                        echo "DISK_${DISK_COUNT}_DEV=\"$dev\""
@@ -65,6 +65,14 @@ disk_list() {
        echo "DISK_COUNT=\"${DISK_COUNT}\""
 }
 
+nvme_serialno() {
+       dev=$1
+
+       sn=`nvme id-ctrl /dev/${dev} | grep sn | cut -d":" -f1`
+       echo $sn
+}
+
+
 disk_serialno() {
        dev=$1