Just parse ouput of standart utilites, parse, and ask some /proc for info. After that, make hdparm speed test.
Example output:
List of Physical Block Devices:
Port: 2:0:0:0 Type: disk Device: /dev/sda Size: 8.58GB None QM00005
Port: 3:0:0:0 Type: disk Device: /dev/sdb Size: 8.58GB None QM00007
List of Physical Block Devices:
Port: 2:0:0:0 Type: disk Device: /dev/sda Size: 8.58GB None QM00005
/dev/sda1 ext4 f43103d7-2fc6-4072-9fc2-4435422a0cc8
/dev/sda2 None None
/dev/sda5 swap d581f815-4d0f-4bb8-a08a-57d80aeeae6b
Port: 3:0:0:0 Type: disk Device: /dev/sdb Size: 8.58GB None QM00007
/dev/sdb1 None None
/dev/sdb5 ext4 10ab1c28-c83b-46aa-9b3c-2d9168069226
List of Physical Block Devices:
Port: 2:0:0:0 Type: disk Device: /dev/sda Size: 8.58GB None QM00005 Read speed: 123 Mbit/s
Port: 3:0:0:0 Type: disk Device: /dev/sdb Size: 8.58GB None QM00007 Read speed: 131 Mbit/s