README.md 1.85 KB
Newer Older
Kevin Cazal's avatar
Kevin Cazal committed
1 2
# py-hpssa

Kevin Cazal's avatar
Kevin Cazal committed
3 4
Python module for HP Smart Storage Administrator CLI.
(Tested with version 3.30.13.0)
Kevin Cazal's avatar
Kevin Cazal committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

The purpose of this module is to provide a simple way to get precise information
on HP storage controllers using python objects instead of using awk/sed/grep with 
the CLI tool provided by HP.

## Getting Started

### Prerequisites

Install ssacli from HP "Management Component Pack for ProLiant".
Instructions can be found here: http://downloads.linux.hpe.com/SDR/project/mcp/

### Installing

```
git clone https://gitlab.minet.net/no_pseudo/py-hpssa.git
```

### Usage examples

```
cd py-hpssa
python3
>>> import hpssa
>>> controller0 = hpssa.controllers[0] #The first storage controller found on this machine
>>> controller0.name
'Smart Array P410i'
>>> controller0.ctrl_status
'OK'
>>> controller0.bat_cap_status #Controller battery/capacitor status
'OK'
>>> controller0.cache_status
'OK'
>>> c0_array0 = controller0.arrays[0] #The first array on the first controller
>>> c0_array0.arr_id
'A'
>>> c0_array0.status
'OK'
>>> c0_array0.iface_type
'SATA'
>>> c0_a0_logical_drive0 = c0_array0.ldrives[0] # The first logical drive on the first array on the first controller
>>> c0_a0_logical_drive0.disk_name
'/dev/sda '
>>> c0_a0_logical_drive0.size
'931.48 GB'
>>> c0_a0_logical_drive0.type
'RAID 1'
>>> c0_a0_logical_drive0.status
'OK'
>>> c0_a0_l0_physical_drive0 = c0_a0_logical_drive0.pdrives[1] # The second physical drive on the first logical drive on the first array on the first controller
>>> c0_a0_l0_physical_drive0.model
'ATA     HGST HTS721010A9'
>>> c0_a0_l0_physical_drive0.pdrive_location # Can be used to find where the drive is plugged on the machine
'2I:1:8'
>>> c0_a0_l0_physical_drive0.size
'1 TB'
>>> c0_a0_l0_physical_drive0.status
'OK'
>>> c0_a0_l0_physical_drive0.iface_type
'SATA'
>>> c0_a0_l0_physical_drive0.cur_temp # Current temperature of the drive
'27'

```