While I was with Amazon.com, one of my duties was replacing failing hard
drives. We used smartmontools a lot, and to make the readout easier to
read, I put together a regular expression and piped it through awk to get
just the fields I needed.

I thought I'd share it with everybody. If you want to help me simplify it
or make it better, please feel free.

No particular licensing, this is too simple. If anything, I'd license it
under the University of Illinois/NCSA License. Have fun!

alex@linux-desktop:~> sudo /usr/sbin/smartctl -A -i /dev/sda | awk
'/Model|Serial|Local|^  5|^187|^197|^198|^199|FAILING|^192/'
Model Family:     Intel X18-M/X25-M/X25-V G2 SSDs
Device Model:     INTEL SSDSA2M080G2GC
Serial Number:    BTPO05200047080JGN
Local Time is:    Sat Feb 21 13:02:03 2015 CST
  5 Reallocated_Sector_Ct   0x0032   100   100   000    Old_age   Always
    -       5
192 Unsafe_Shutdown_Count   0x0032   100   100   000    Old_age   Always
    -       254

Cheers.

" 'With the first link, the chain is forged. The first speech censured, the
first thought forbidden, the first freedom denied, chains us all
irrevocably.' Those words were uttered by Judge Aaron Satie as wisdom and
warning... The first time any man's freedom is trodden on, we’re all
damaged." - Jean-Luc Picard, quoting Judge Aaron Satie, Star Trek: TNG
episode "The Drumhead"
- Alex Smith
- Huntsville, Alabama metropolitan area USA

-- 
-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to