Originally posted by: SystemAdmin
Hi folks.
I’m trying to get VPD data for hard drives on a system programmatically (via my own code). Specifically, I’m after information about the disks on the system. I’d like the manufacturer/model, size of the disk, the interface of the disk (SCSI, etc), and the disk geometry if possible. I can get most of the data I need by running ‘lscfg’, but I’d like to pick this up via my own program rather than run that from a program and parse the results. So, for example, “lscfg –vpl hdisk0” will give me the VPD data for hdisk0.
What I’ve figured out so far: VPD (Vital Product Data) is a subset of the ODM (Object Data Manager), a database on the system that contains, among other things, entries for each hardware device on your system. I’ve read up on ODM (which has an API interface), and learned that what I need is odminitialize() / odmterminate(), odm_open_class(), and odm_get_first() / odm_get_next().
I
think the data that I want is in class CuVPD, which (according to “odmshow CuVPD”) has:
class CuVPD {
char name
16; /* offset: 0xc ( 12) */
short vpd_type; /* offset: 0x1c ( 28) */
longchar vpd
512; /* offset: 0x1e ( 30) */
};
/*
columns: 3
structsize: 0x220 (544) bytes
data offset: 0x20002eb8
population: 25 objects (25 active, 0 deleted)
*/
The first problem I encountered: the VPD appears to be in “longchar vpd
512;”, which (near as I can tell) is device-specific. As I said above, I’m after hard disk drive data. So I’d like the hard drive manufacturer, model, size, and if possible, drive geometry information (total tracks/cylinders/heads), as well as the interface type (SCSI, IDE, etc). But I can’t tell where in that 512 bytes the data that I want is since I’ve been unable to find any documentation on how “longchar vpd
512” is laid out for disk drives.
The second problem: To use a class in ODM, you need the class ID (which is created when calling utility odmcreate with your class definition). I’ve been unable to find documentation on what the class ID Is for CuVPD, so I can’t call odm_get_first() / odm_get_next() – I need that class ID. I can’t find a header file or anything that has this information.
Basically, in short: I’d like to look up hard drive information (manufacturer, model, size, disk geometry if possible) via an API on AIX, and I need enough information to be able to do that. Thank you SO MUCH for your help!
/Jeff
#AIX-Forum