Get the serial numbers from HP RAID

hpacucli controller all show config detail | grep -A 7 Fail | egrep '(Failed|Last|Serial Number|physicaldrive)'
This dumps serial numbers of all the drives but HP warranty check does not say they are valid ...
Sample Output
 hpacucli controller all show config detail | grep -A 7 Fail | egrep '(Failed|Last|Serial Number|physicaldrive)'
      Status: Failed Physical Drive
         Parity Initialization Status: Initialization Failed
            physicaldrive 2E:1:1 (port 2E:box 1:bay 1, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:9 (port 2E:box 1:bay 9, SAS, 900.1 GB, Failed)
            physicaldrive 2E:1:13 (port 2E:box 1:bay 13, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:17 (port 2E:box 1:bay 17, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:21 (port 2E:box 1:bay 21, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:2 (port 2E:box 1:bay 2, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:6 (port 2E:box 1:bay 6, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:10 (port 2E:box 1:bay 10, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:19 (port 2E:box 1:bay 19, SAS, 900.1 GB, Failed)
            physicaldrive 2E:1:23 (port 2E:box 1:bay 23, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:4 (port 2E:box 1:bay 4, SAS, 900.1 GB, Failed)
            physicaldrive 2E:1:8 (port 2E:box 1:bay 8, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:12 (port 2E:box 1:bay 12, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:16 (port 2E:box 1:bay 16, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:20 (port 2E:box 1:bay 20, SAS, 900.1 GB, OK)
            physicaldrive 2E:1:24 (port 2E:box 1:bay 24, SAS, 900.1 GB, OK)
         Status: Failed
         Last Failure Reason: Hardware error
         Serial Number: 6XS1PV6T0000B226BZ5V
         Status: Failed
         Last Failure Reason: Hardware error
         Serial Number: 6XS1PVYH0000B221BFYC
         Status: Failed
         Last Failure Reason: Mark bad failed
         Serial Number: 6XS2CL960000B242E2LU

1
By: operat0r
2016-07-20 17:42:40

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: