11

Has anyone used the HP Array Configuration Utility Command Line Interface (hpacucli.exe) to get physical disk information into a file?

I'm not at the machine right now, but basically I want to find out what the state of each of the physical disks in my server, i.e. Good, Failed, Failure predicted, Rebuilding, missing etc.

I want to run this from a script, so a single (or set of) commands I can pipe to a file is what I'm looking for.

ewwhite
  • 194,921
  • 91
  • 434
  • 799
FrinkTheBrave
  • 333
  • 2
  • 4
  • 13

3 Answers3

18

My favorite example:

This can be run from the shell or within the tool.

hpacucli ctrl all show config (use hpacucli.exe for Windows)

Or

hpacucli ctrl all show config detail

But, if you have the HP Management Agents installed anyway, you should have realtime monitoring of RAID status pushing back to email alerts or an external monitoring system. Either way, this can generate a point-in-time output/status.

[root@Bootylicious ~]# hpacucli ctrl all show config

Smart Array P410i in Slot 0 (Embedded)    (sn: 50123456789ABCDE)

   array A (SAS, Unused Space: 0 MB)


      logicaldrive 1 (1.6 TB, RAID 1+0, OK)

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 600.1 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 600.1 GB, OK)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 600.1 GB, OK)
      physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 600.1 GB, OK)
      physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 600.1 GB, OK)
      physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 600.1 GB, OK)
ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Thanks, is there a way of getting each physical drive line by bay number. I can do controller slot=1 physicaldrive 1I:1:5 show status but I don't want to have to specify the slot, port or box number. Something like controller all bay 5 show status – FrinkTheBrave Jan 03 '12 at 12:52
  • For now I'm using: ctrl all show config | findstr /I /R /C:bay.5 – FrinkTheBrave Jan 03 '12 at 13:05
  • 1
    I voted for this answer simply because your hostname is 'Bootylicious'. Fantastic. – Michael Galaxy Oct 17 '15 at 00:30
9

I understand you use windows OS on your host. Please find list of useful commands for hpacucli for Linux. You might find some of them useful anyway.

sudo /usr/sbin/hpacucli controller all show status
/usr/sbin/hpacucli ctrl slot=1 pd all show detail|grep -i -P '.*(physicaldrive|Firmware|Status).*'
sudo /usr/sbin/hpacucli ctrl all show
sudo /usr/sbin/hpacucli ctrl slot=5 pd all show

show disk physical info

for I in `sudo /usr/sbin/hpacucli ctrl all show | awk '{ print $6 }'`; do sudo /usr/sbin/hpacucli ctrl slot=$I pd all show; done

show disk logical info

for I in `sudo /usr/sbin/hpacucli ctrl all show | awk '{ print $6 }'`; do sudo /usr/sbin/hpacucli ctrl slot=$I pd all show; done

BBU Controller info

for I in `sudo /usr/sbin/hpacucli ctrl all show | awk '{ print $6 }'`; do sudo /usr/sbin/hpacucli ctrl slot=$I show detail; done

switch on disk ID light

sudo /usr/sbin/hpacucli ctrl slot=4 pd 1E:1:13 modify led=on

some other ...

for I in `sudo /usr/sbin/hpacucli ctrl all show | awk '{ print $6 }'`; do sudo /usr/sbin/hpacucli ctrl slot=$I show; done

sudo /usr/sbin/hpacucli ctrl slot=4 pd 1E:1:13 show

for I in `sudo /usr/sbin/hpacucli ctrl all show | awk '{ print $6 }'`; do sudo /usr/sbin/hpacucli ctrl slot=$I show detail|grep -i -P '.*(physicaldrive|Firmware|Status).*'; done
ne7runner
  • 166
  • 2
2

There are already existing monitoring scripts that do this (for Nagios for example).
Here is how it would work (adjust controller ID accordingly):

hpacucli.exe ctrl all show
Smart Array XXX in Slot 2     (sn: XXXXXXXXXXXX)

hpacucli.exe controller slot=2 physicaldrive all show status
physicaldrive 1:0 (port 1:id 0, X GB): OK
physicaldrive 1:1 (port 1:id 1, X GB): OK
physicaldrive 1:2 (port 1:id 2, X GB): OK
physicaldrive 1:3 (port 1:id 3, X GB): OK
physicaldrive 1:4 (port 1:id 4, X GB): OK
physicaldrive 1:5 (port 1:id 5, X GB): OK

hpacucli.exe controller slot=2 logicaldrive all show status
logicaldrive 1 (X GB, RAID 5):  OK
logicaldrive 2 (X GB, RAID 5):  OK
faker
  • 17,326
  • 2
  • 60
  • 69