This can be achieved entirely through the HP System Management Tools. You'll need the Array Configuration Utility in either its graphical (web) or command line forms (hpacucli).
Here's the output from an HP Storageworks D2700 enclosure connected to a Smart Array P812 RAID controller. Note that port WWID's, HP product numbers and serial numbers are included in the output.
=> controller slot=1 enclosure all show detail
Smart Array P812 in Slot 1
StorageWorks D2700 at Port 1E, Box 1, OK
Fan Status: OK
Temperature Status: OK
Power Supply Status: Redundant
Vendor ID: HP
Serial Number: 5C7147P1KT
Firmware Version: 0147
Drive Bays: 25
Port: 1E
Box: 1
Location: External
Standby Path: 2E:1, OK
Active Path: 1E:1, OK
Expander 246
Device Number: 246
Firmware Version: 0147
WWID: 5001438016BEF27D
Port: 1E
Box: 1
Vendor ID: HP
Expander 247
Device Number: 247
Firmware Version: 0147
WWID: 5001438016BEF27F
Port: 2E
Box: 1
Vendor ID: HP
Enclosure SEP (Vendor ID HP, Model D2700 SAS AJ941A) 244
Device Number: 244
Firmware Version: 0147
WWID: 5001438016BEF27C
Port: 1E
Box: 1
Vendor ID: HP
Model: D2700 SAS AJ941A
Enclosure SEP (Vendor ID HP, Model D2700 SAS AJ941A) 245
Device Number: 245
Firmware Version: 0147
WWID: 5001438016BEF27E
Port: 2E
Box: 1
Vendor ID: HP
Model: D2700 SAS AJ941A
Physical Drives
physicaldrive 1E:1:1 (port 1E:box 1:bay 1, SAS, 146 GB, OK)
physicaldrive 1E:1:2 (port 1E:box 1:bay 2, SAS, 146 GB, OK)
physicaldrive 1E:1:3 (port 1E:box 1:bay 3, SAS, 146 GB, OK)
physicaldrive 1E:1:4 (port 1E:box 1:bay 4, SAS, 146 GB, OK)
physicaldrive 1E:1:5 (port 1E:box 1:bay 5, SAS, 146 GB, OK)
physicaldrive 1E:1:6 (port 1E:box 1:bay 6, SAS, 146 GB, OK)
physicaldrive 1E:1:7 (port 1E:box 1:bay 7, SAS, 146 GB, OK)
physicaldrive 1E:1:8 (port 1E:box 1:bay 8, SAS, 146 GB, OK)
physicaldrive 1E:1:9 (port 1E:box 1:bay 9, SAS, 146 GB, OK, spare)
physicaldrive 1E:1:10 (port 1E:box 1:bay 10, SAS, 146 GB, OK)
physicaldrive 1E:1:11 (port 1E:box 1:bay 11, SAS, 146 GB, OK)
physicaldrive 1E:1:12 (port 1E:box 1:bay 12, SAS, 146 GB, OK)
physicaldrive 1E:1:13 (port 1E:box 1:bay 13, SAS, 146 GB, OK)
physicaldrive 1E:1:14 (port 1E:box 1:bay 14, SAS, 146 GB, OK)
physicaldrive 1E:1:15 (port 1E:box 1:bay 15, SAS, 146 GB, OK)
physicaldrive 1E:1:16 (port 1E:box 1:bay 16, SAS, 146 GB, OK)
physicaldrive 1E:1:17 (port 1E:box 1:bay 17, SAS, 146 GB, OK)
physicaldrive 1E:1:18 (port 1E:box 1:bay 18, SAS, 146 GB, OK)
physicaldrive 1E:1:19 (port 1E:box 1:bay 19, SAS, 146 GB, OK)
physicaldrive 1E:1:20 (port 1E:box 1:bay 20, SAS, 146 GB, OK)
physicaldrive 1E:1:21 (port 1E:box 1:bay 21, SAS, 300 GB, OK)
physicaldrive 1E:1:22 (port 1E:box 1:bay 22, SAS, 300 GB, OK)
physicaldrive 1E:1:23 (port 1E:box 1:bay 23, SAS, 300 GB, OK)
physicaldrive 1E:1:24 (port 1E:box 1:bay 24, SAS, 300 GB, OK)
physicaldrive 1E:1:25 (port 1E:box 1:bay 25, SAS, 300 GB, OK)