python-dmidecode-3.10.13-11.el7.x86_64 I cut and pasted your python code into a file and ran python file.... no workie....
I did find the attached dmidump.py on github. It segfaults after printing bios on line 64. Also attached is a dump from the AMIDEDOS utility. Happy to do whatever is required to fix this issue.. I have a couple of months of nights and weekends invested so far... what's a couple more. :) On Thu, Oct 13, 2016 at 5:01 PM, Dan Kenigsberg <dan...@redhat.com> wrote: > On Thu, Oct 13, 2016 at 11:52:17AM +1100, David Pinkerton wrote: > > Nir, > > > > Looks like its crashing on the dmidecode system call. > > > > I've attached the output from gbd as well as a dmidecode text dump, > > dmidecode binary dump and each keywords run individually. > > > > >From the keywords it look like my dmi info is corrupted. I have > download a > > AMI dmi editor but this only allows access to limited fields. Do you > know > > another tools to rewrite the dmi info? > > I don't. But whatever is inside your dmi, dmidecode must not crash. > Which version of python-dmidecode do you have installed? > Would you open a bug against it? > > I believe that its maintainers would appriace a simple reproducer, that > does not involve ovirt or Vdsm. See if you can simplify the code in > > def __leafDict(d): > ret = {} > for k, v in d.iteritems(): > if isinstance(v, dict): > ret.update(__leafDict(v)) > else: > ret[k] = v > return ret > > > def getAllDmidecodeInfo(): > import dmidecode > > myLeafDict = {} > for k in ('system', 'bios', 'cache', 'processor', 'chassis', 'memory'): > myLeafDict[k] = __leafDict(getattr(dmidecode, k)()) > return myLeafDict > -- David Pinkerton Consultant Red Hat Asia Pacific Pty. Ltd. Level 11, Canberra House 40 Marcus Clarke Street Canberra 2600 ACT Mobile: +61-488-904-232 Email: david.pinker...@redhat.com Web: http://apac.redhat.com/ <http://apac.redhat.com/>
[SMBIOS Header] =============================================================================== Name : SMBIOS Signature Style : 4 BYTEs Data : _SM_ Name : SMBIOS Checksum Style : BYTE Data : 7Fh Name : SMBIOS Table Length Style : BYTE Data : 31 bytes Name : SMBIOS Version Style : WORD Data : 2.4 Name : SMBIOS Max. Struc. Size Style : WORD Data : 254 bytes Name : SMBIOS Point Revision Style : BYTE Data : 00h Name : SMBIOS Formatted Area Style : 5 BYTEs Data : 00 00 00 00 00h Name : DMI Signature Style : 5 BYTEs Data : _DMI_ Name : DMI Checksum Style : BYTE Data : 49h Name : DMI Table Length Style : WORD Data : 2911 bytes Name : DMI Table Address Style : DWORD Data : 000FC5B0h Name : Number of SMBIOS Stuctures Style : WORD Data : 49 Name : DMI Revisiion Style : BYTE Data : 0.0 [Type 000] -- BIOS Information =============================================================================== Name : Struc. Length Style : BYTE Data : 18h Name : Struc. Handle Style : WORD Data : 0000h Name : BIOS Vendor Style : STRING Data : "American Megatrends Inc." Name : BIOS Version Style : STRING Data : "080014" Name : BIOS Starting Add. Seg. Style : WORD Data : F000h Name : BIOS Release Date Style : STRING Data : "10/22/2009" Name : BIOS ROM Size Style : BYTE Data : 0Fh -- 1024 KB Name : BIOS Characteristics Style : QWORD Data : 0000 0001 7F8B DE90h -- Bit.04:ISA is supported -- Bit.07:PCI is Reserved -- Bit.09:Plug and Play is supported -- Bit.10:APM is supported -- Bit.11:BIOS is Upgradeable(Flash) -- Bit.12:BIOS shadowing is allowed -- Bit.14:ESCD support is available -- Bit.15:Boot from CD is supported -- Bit.16:Selectable Boot is supported -- Bit.17:BIOS ROM is socketed -- Bit.19:EDD(Enhanced Disk Drive) Specification is supported -- Bit.23:Int 13h - 5.25" / 1.2MB Floppy Services are supported -- Bit.24:Int 13h - 3.5" / 720 KB Floppy Services are supported -- Bit.25:Int 13h - 3.5" / 2.88 MB Floppy Services are supported -- Bit.26:Int 5h, Print Screen Service is supported -- Bit.27:Int 9h, 8042 Keyboard services are supported -- Bit.28:Int 14h,Serial Services are supported -- Bit.29:Int 17h, Printer Services are supported -- Bit.30:Int 10h, CGA/Mono Video Services are supported -- Bit.32~47:Reserved for BIOS Vendor Name : BIOS Char. Extension Style : WORD Data : 0533h -- Bit.00:ACPI supported -- Bit.01:USB Legacy is supported -- Bit.04:LS-120 boot is supported -- Bit.05:ATAPI ZIP Drive boot is supported -- Bit.08:BIOS Boot Specification supported -- Bit.10:Enable Targeted Content Distribution Name : System BIOS Major Style : BYTE Data : 08h Name : System BIOS Minor Style : BYTE Data : 0Eh Name : Embedded Controller Firmware Major Release Style : BYTE Data : FFh Name : Embedded Controller Firmware Minor Release Style : BYTE Data : FFh [Type 001] -- System Information =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0001h Name : Manufacturer Style : STRING Data : "Supermicro" Name : Product Name Style : STRING Data : "H8DM8-2" Name : Version Style : STRING Data : "1234567890" Name : Serial Number Style : STRING Data : "1234567890" Name : UUID Style : 16 BYTEs Data : 00 DD 31 72 64 91 E6 11 B0 73 A9 2C 24 4C 25 7Ch Name : Wake-up Type Style : BYTE Data : 06h -- Power Switch Name : SKUNumber Style : STRING Data : "1234567890" Name : Family Style : STRING Data : "1234567890" [Type 002] -- Base Board/Module Information =============================================================================== Name : Struc. Length Style : BYTE Data : 0Fh Name : Struc. Handle Style : WORD Data : 0002h Name : Manufacturer Style : STRING Data : "Supermicro" Name : Product Style : STRING Data : "H8DM8-2" Name : Version Style : STRING Data : "1234567890" Name : Serial Number Style : STRING Data : "1234567890" Name : Asset Tag Style : STRING Data : "To Be Filled By O.E.M." Name : Feature Flags Style : BYTE Data : 09h -- Bit.00:the board is a hosting board. -- Bit.03:the board is replaceable. Name : Location in Chassis Style : STRING Data : "To Be Filled By O.E.M." Name : Chassis Handle Style : WORD Data : 0003h Name : Board Type Style : BYTE Data : 0Ah -- Motherboard(includes processor, memory, and I/O) Name : Num. of Contained Object Handles Style : BYTE Data : 00h [Type 003] -- System Enclosure or Chassis =============================================================================== Name : Struc. Length Style : BYTE Data : 15h Name : Struc. Handle Style : WORD Data : 0003h Name : Manufacturer Style : STRING Data : "Xexon" Name : Type Style : BYTE Data : 03h -- Desktop Name : Version Style : STRING Data : "1234567890" Name : Serial Number Style : STRING Data : "1234567890" Name : Asset Tag Style : STRING Data : "1234567890" Name : Bootup State Style : BYTE Data : 03h -- Safe Name : Power Supply State Style : BYTE Data : 03h -- Safe Name : Thermal State Style : BYTE Data : 03h -- Safe Name : Security Status Style : BYTE Data : 03h -- None Name : OEM-defined Style : DWORD Data : 00000000h Name : Height Style : BYTE Data : 00h Name : Number of Power Cords Style : BYTE Data : 01h Name : Contained Element Count Style : BYTE Data : 00h Name : Contained Element Record Length Style : BYTE Data : 00h [Type 004] -- Processor Information =============================================================================== Name : Struc. Length Style : BYTE Data : 28h Name : Struc. Handle Style : WORD Data : 0004h Name : Socket Designation Style : STRING Data : "CPU 1" Name : Processor Type Style : BYTE Data : 03h -- Central Processor Name : Processor Family Style : BYTE Data : 8Ah -- Quad-Core AMD OpteronTM Processor Family Name : Processor Manufacturer Style : STRING Data : "AMD " Name : Processor ID Style : DWORD Data : 00100F42h Name : Processor Features Style : DWORD Data : 178BFBFFh Name : Processor Version Style : STRING Data : "Quad-Core AMD Opteron(tm) Processor 2376 " Name : Voltage Style : BYTE Data : 8Fh -- Bit.00:5V -- Bit.01:3.3V -- Bit.02:2.9V -- Bit.03~06:Reserved, must be zero. Name : External Clock Style : WORD Data : 00C8h -- 200 MHz Name : Max Speed Style : WORD Data : 08FCh -- 2300 MHz Name : Current Speed Style : WORD Data : 08FCh -- 2300 MHz Name : Status Style : BYTE Data : 41h -- Bit.06:CPU Socket Populated -- CPU Enabled Name : Processor Upgrade Style : BYTE Data : 01h -- Other Name : L1 Cache Handle Style : WORD Data : 0005h Name : L2 Cache Handle Style : WORD Data : 0006h Name : L3 Cache Handle Style : WORD Data : 0007h Name : Serial Number Style : STRING Data : "To Be Filled By O.E.M." Name : Asset Tag Style : STRING Data : "To Be Filled By O.E.M." Name : Part Number Style : STRING Data : "To Be Filled By O.E.M." Name : Core Count Style : BYTE Data : 04h Name : Core Enabled Style : BYTE Data : 04h Name : Thread Count Style : BYTE Data : 00h Name : Processor Characteristics Style : WORD Data : 0004h [Type 007] -- Cache Information =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0005h Name : Socket Designation Style : STRING Data : "L1-Cache" Name : Cache Configuration Style : WORD Data : 0280h -- Cache Level - 1 -- Cache Socketed:Not Socketed -- Location, relative to the CPU module:Internal -- At boot time:Enable -- Operational Mode:Varies with Memory Address Name : Maximum Cache Size Style : WORD Data : 0200h -- 1K granularity [Max Size:512] Name : Installed Size Style : WORD Data : 0200h -- 1K granularity [Max Size:512] Name : Supported SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Current SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Cache Speed Style : BYTE Data : 00h Name : Error Correction Type Style : BYTE Data : 05h -- Single-Bit.ECC Name : System Cache Type Style : BYTE Data : 00h -- Not define Name : Associativity Style : BYTE Data : 05h -- 4-way Set-Asociative [Type 007] -- Cache Information =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0006h Name : Socket Designation Style : STRING Data : "L2-Cache" Name : Cache Configuration Style : WORD Data : 0281h -- Cache Level - 2 -- Cache Socketed:Not Socketed -- Location, relative to the CPU module:Internal -- At boot time:Enable -- Operational Mode:Varies with Memory Address Name : Maximum Cache Size Style : WORD Data : 0800h -- 1K granularity [Max Size:2048] Name : Installed Size Style : WORD Data : 0800h -- 1K granularity [Max Size:2048] Name : Supported SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Current SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Cache Speed Style : BYTE Data : 00h Name : Error Correction Type Style : BYTE Data : 05h -- Single-Bit.ECC Name : System Cache Type Style : BYTE Data : 00h -- Not define Name : Associativity Style : BYTE Data : 05h -- 4-way Set-Asociative [Type 007] -- Cache Information =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0007h Name : Socket Designation Style : STRING Data : "L3-Cache" Name : Cache Configuration Style : WORD Data : 0282h -- Cache Level - 3 -- Cache Socketed:Not Socketed -- Location, relative to the CPU module:Internal -- At boot time:Enable -- Operational Mode:Varies with Memory Address Name : Maximum Cache Size Style : WORD Data : 1800h -- 1K granularity [Max Size:6144] Name : Installed Size Style : WORD Data : 1800h -- 1K granularity [Max Size:6144] Name : Supported SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Current SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Cache Speed Style : BYTE Data : 00h Name : Error Correction Type Style : BYTE Data : 05h -- Single-Bit.ECC Name : System Cache Type Style : BYTE Data : 00h -- Not define Name : Associativity Style : BYTE Data : 05h -- 4-way Set-Asociative [Type 004] -- Processor Information =============================================================================== Name : Struc. Length Style : BYTE Data : 28h Name : Struc. Handle Style : WORD Data : 0008h Name : Socket Designation Style : STRING Data : "CPU 2" Name : Processor Type Style : BYTE Data : 03h -- Central Processor Name : Processor Family Style : BYTE Data : 8Ah -- Quad-Core AMD OpteronTM Processor Family Name : Processor Manufacturer Style : STRING Data : "AMD " Name : Processor ID Style : DWORD Data : 00100F42h Name : Processor Features Style : DWORD Data : 178BFBFFh Name : Processor Version Style : STRING Data : "Quad-Core AMD Opteron(tm) Processor 2376 " Name : Voltage Style : BYTE Data : 8Fh -- Bit.00:5V -- Bit.01:3.3V -- Bit.02:2.9V -- Bit.03~06:Reserved, must be zero. Name : External Clock Style : WORD Data : 00C8h -- 200 MHz Name : Max Speed Style : WORD Data : 08FCh -- 2300 MHz Name : Current Speed Style : WORD Data : 08FCh -- 2300 MHz Name : Status Style : BYTE Data : 41h -- Bit.06:CPU Socket Populated -- CPU Enabled Name : Processor Upgrade Style : BYTE Data : 01h -- Other Name : L1 Cache Handle Style : WORD Data : 0009h Name : L2 Cache Handle Style : WORD Data : 000Ah Name : L3 Cache Handle Style : WORD Data : 000Bh Name : Serial Number Style : STRING Data : "To Be Filled By O.E.M." Name : Asset Tag Style : STRING Data : "To Be Filled By O.E.M." Name : Part Number Style : STRING Data : "To Be Filled By O.E.M." Name : Core Count Style : BYTE Data : 04h Name : Core Enabled Style : BYTE Data : 04h Name : Thread Count Style : BYTE Data : 00h Name : Processor Characteristics Style : WORD Data : 0004h [Type 007] -- Cache Information =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0009h Name : Socket Designation Style : STRING Data : "L1-Cache" Name : Cache Configuration Style : WORD Data : 0280h -- Cache Level - 1 -- Cache Socketed:Not Socketed -- Location, relative to the CPU module:Internal -- At boot time:Enable -- Operational Mode:Varies with Memory Address Name : Maximum Cache Size Style : WORD Data : 0200h -- 1K granularity [Max Size:512] Name : Installed Size Style : WORD Data : 0200h -- 1K granularity [Max Size:512] Name : Supported SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Current SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Cache Speed Style : BYTE Data : 00h Name : Error Correction Type Style : BYTE Data : 05h -- Single-Bit.ECC Name : System Cache Type Style : BYTE Data : 00h -- Not define Name : Associativity Style : BYTE Data : 05h -- 4-way Set-Asociative [Type 007] -- Cache Information =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 000Ah Name : Socket Designation Style : STRING Data : "L2-Cache" Name : Cache Configuration Style : WORD Data : 0281h -- Cache Level - 2 -- Cache Socketed:Not Socketed -- Location, relative to the CPU module:Internal -- At boot time:Enable -- Operational Mode:Varies with Memory Address Name : Maximum Cache Size Style : WORD Data : 0800h -- 1K granularity [Max Size:2048] Name : Installed Size Style : WORD Data : 0800h -- 1K granularity [Max Size:2048] Name : Supported SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Current SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Cache Speed Style : BYTE Data : 00h Name : Error Correction Type Style : BYTE Data : 05h -- Single-Bit.ECC Name : System Cache Type Style : BYTE Data : 00h -- Not define Name : Associativity Style : BYTE Data : 05h -- 4-way Set-Asociative [Type 007] -- Cache Information =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 000Bh Name : Socket Designation Style : STRING Data : "L3-Cache" Name : Cache Configuration Style : WORD Data : 0282h -- Cache Level - 3 -- Cache Socketed:Not Socketed -- Location, relative to the CPU module:Internal -- At boot time:Enable -- Operational Mode:Varies with Memory Address Name : Maximum Cache Size Style : WORD Data : 1800h -- 1K granularity [Max Size:6144] Name : Installed Size Style : WORD Data : 1800h -- 1K granularity [Max Size:6144] Name : Supported SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Current SRAM Type Style : WORD Data : 0010h -- Bit.04:Pipeline Burst Name : Cache Speed Style : BYTE Data : 00h Name : Error Correction Type Style : BYTE Data : 05h -- Single-Bit.ECC Name : System Cache Type Style : BYTE Data : 00h -- Not define Name : Associativity Style : BYTE Data : 05h -- 4-way Set-Asociative [Type 009] -- System Slots =============================================================================== Name : Struc. Length Style : BYTE Data : 0Dh Name : Struc. Handle Style : WORD Data : 000Ch Name : Slot Designation Style : STRING Data : "AMD È" Name : Slot Type Style : BYTE Data : 03h -- ISA Name : Slot Data Bus Width Style : BYTE Data : 8Ah -- Not define Name : Current Usage Style : BYTE Data : 03h -- Available Name : Slot Length Style : BYTE Data : 00h -- Not define Name : Slot ID Style : WORD Data : 0000h Name : Slot Characteristics 1 Style : BYTE Data : 00h Name : Slot Characteristics 2 Style : BYTE Data : 00h [Type 000] -- BIOS Information =============================================================================== Name : Struc. Length Style : BYTE Data : FCh Name : Struc. Handle Style : WORD Data : 000Dh Name : BIOS Vendor Style : STRING Data : "" Name : BIOS Version Style : STRING Data : "" Name : BIOS Starting Add. Seg. Style : WORD Data : 0203h Name : BIOS Release Date Style : STRING Data : NULL Name : BIOS ROM Size Style : BYTE Data : 0Ch -- 832 KB Name : BIOS Characteristics Style : QWORD Data : 0400 0808 4943 5001h -- Bit.00:Reserved -- Bit.12:BIOS shadowing is allowed -- Bit.14:ESCD support is available -- Bit.16:Selectable Boot is supported -- Bit.17:BIOS ROM is socketed -- Bit.22:Int 13h - 5.25" / 360 KB Floppy Services are supported -- Bit.24:Int 13h - 3.5" / 720 KB Floppy Services are supported -- Bit.27:Int 9h, 8042 Keyboard services are supported -- Bit.30:Int 10h, CGA/Mono Video Services are supported -- Bit.32~47:Reserved for BIOS Vendor -- Bit.48~63:Reserved for System Vendor Name : BIOS Char. Extension Style : WORD Data : 0E00h -- Bit.09:Function key-initiated Network Service boot supported. -- Bit.10:Enable Targeted Content Distribution -- Bit.11~15:Reserved Name : System BIOS Major Style : BYTE Data : 00h Name : System BIOS Minor Style : BYTE Data : 01h Name : Embedded Controller Firmware Major Release Style : BYTE Data : 12h Name : Embedded Controller Firmware Minor Release Style : BYTE Data : 03h Name : Unknown Field Style : BYTEs Data : 8000000004442000F0400000054430000000A0000800000000008C000F040005443000000002256246246666624724242420001100F0000000000000000667557676333323000310F011110000000000000000000000000001090FFFFFFFFFFFFFF0010104442008FF100010100008000000 [Type 000] -- BIOS Information =============================================================================== Name : Struc. Length Style : BYTE Data : 11h Name : Struc. Handle Style : WORD Data : 000Eh Name : BIOS Vendor Style : STRING Data : NULL Name : BIOS Version Style : STRING Data : NULL Name : BIOS Starting Add. Seg. Style : WORD Data : FC00h Name : BIOS Release Date Style : STRING Data : "PartNum0" Name : BIOS ROM Size Style : BYTE Data : 41h -- 4224 KB Name : BIOS Characteristics Style : QWORD Data : 0120 444D 4100 4001h -- Bit.00:Reserved -- Bit.14:ESCD support is available -- Bit.24:Int 13h - 3.5" / 720 KB Floppy Services are supported -- Bit.30:Int 10h, CGA/Mono Video Services are supported -- Bit.32~47:Reserved for BIOS Vendor -- Bit.48~63:Reserved for System Vendor [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 000Fh Name : Starting Address Style : DWORD Data : 00000000h Name : End Address Style : DWORD Data : 001FFFFFh Name : Memory Device Handle Style : WORD Data : 0017h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0010h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM1" Name : Bank Locator Style : STRING Data : "BANK1" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer1" Name : Serial Number Style : STRING Data : "SerNum1" Name : Asset Tag Style : STRING Data : "AssetTagNum1" Name : Part Number Style : STRING Data : "PartNum1" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0011h Name : Starting Address Style : DWORD Data : 00200000h Name : End Address Style : DWORD Data : 003FFFFFh Name : Memory Device Handle Style : WORD Data : 0019h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0012h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM2" Name : Bank Locator Style : STRING Data : "BANK2" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer2" Name : Serial Number Style : STRING Data : "SerNum2" Name : Asset Tag Style : STRING Data : "AssetTagNum2" Name : Part Number Style : STRING Data : "PartNum2" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0013h Name : Starting Address Style : DWORD Data : 00400000h Name : End Address Style : DWORD Data : 005FFFFFh Name : Memory Device Handle Style : WORD Data : 001Bh Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0014h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM3" Name : Bank Locator Style : STRING Data : "BANK3" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer3" Name : Serial Number Style : STRING Data : "SerNum3" Name : Asset Tag Style : STRING Data : "AssetTagNum3" Name : Part Number Style : STRING Data : "PartNum3" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0015h Name : Starting Address Style : DWORD Data : 00600000h Name : End Address Style : DWORD Data : 007FFFFFh Name : Memory Device Handle Style : WORD Data : 001Dh Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0016h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM4" Name : Bank Locator Style : STRING Data : "BANK4" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer4" Name : Serial Number Style : STRING Data : "SerNum4" Name : Asset Tag Style : STRING Data : "AssetTagNum4" Name : Part Number Style : STRING Data : "PartNum4" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0017h Name : Starting Address Style : DWORD Data : 00800000h Name : End Address Style : DWORD Data : 009FFFFFh Name : Memory Device Handle Style : WORD Data : 001Fh Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0018h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM5" Name : Bank Locator Style : STRING Data : "BANK5" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer5" Name : Serial Number Style : STRING Data : "SerNum5" Name : Asset Tag Style : STRING Data : "AssetTagNum5" Name : Part Number Style : STRING Data : "PartNum5" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0019h Name : Starting Address Style : DWORD Data : 00A00000h Name : End Address Style : DWORD Data : 00BFFFFFh Name : Memory Device Handle Style : WORD Data : 0021h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 001Ah Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM6" Name : Bank Locator Style : STRING Data : "BANK6" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer6" Name : Serial Number Style : STRING Data : "SerNum6" Name : Asset Tag Style : STRING Data : "AssetTagNum6" Name : Part Number Style : STRING Data : "PartNum6" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 001Bh Name : Starting Address Style : DWORD Data : 00C00000h Name : End Address Style : DWORD Data : 00DFFFFFh Name : Memory Device Handle Style : WORD Data : 0023h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 001Ch Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM7" Name : Bank Locator Style : STRING Data : "BANK7" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer7" Name : Serial Number Style : STRING Data : "SerNum7" Name : Asset Tag Style : STRING Data : "AssetTagNum7" Name : Part Number Style : STRING Data : "PartNum7" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 001Dh Name : Starting Address Style : DWORD Data : 00E00000h Name : End Address Style : DWORD Data : 00FFFFFFh Name : Memory Device Handle Style : WORD Data : 0025h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 001Eh Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM8" Name : Bank Locator Style : STRING Data : "BANK8" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer8" Name : Serial Number Style : STRING Data : "SerNum8" Name : Asset Tag Style : STRING Data : "AssetTagNum8" Name : Part Number Style : STRING Data : "PartNum8" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 001Fh Name : Starting Address Style : DWORD Data : 01000000h Name : End Address Style : DWORD Data : 011FFFFFh Name : Memory Device Handle Style : WORD Data : 0027h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0020h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM9" Name : Bank Locator Style : STRING Data : "BANK9" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer9" Name : Serial Number Style : STRING Data : "SerNum9" Name : Asset Tag Style : STRING Data : "AssetTagNum9" Name : Part Number Style : STRING Data : "PartNum9" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0021h Name : Starting Address Style : DWORD Data : 01200000h Name : End Address Style : DWORD Data : 013FFFFFh Name : Memory Device Handle Style : WORD Data : 0029h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0022h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM10" Name : Bank Locator Style : STRING Data : "BANK10" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer10" Name : Serial Number Style : STRING Data : "SerNum10" Name : Asset Tag Style : STRING Data : "AssetTagNum10" Name : Part Number Style : STRING Data : "PartNum10" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0023h Name : Starting Address Style : DWORD Data : 01400000h Name : End Address Style : DWORD Data : 015FFFFFh Name : Memory Device Handle Style : WORD Data : 002Bh Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0024h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM11" Name : Bank Locator Style : STRING Data : "BANK11" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer11" Name : Serial Number Style : STRING Data : "SerNum11" Name : Asset Tag Style : STRING Data : "AssetTagNum11" Name : Part Number Style : STRING Data : "PartNum11" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0025h Name : Starting Address Style : DWORD Data : 01600000h Name : End Address Style : DWORD Data : 017FFFFFh Name : Memory Device Handle Style : WORD Data : 002Dh Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0026h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM12" Name : Bank Locator Style : STRING Data : "BANK12" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer12" Name : Serial Number Style : STRING Data : "SerNum12" Name : Asset Tag Style : STRING Data : "AssetTagNum12" Name : Part Number Style : STRING Data : "PartNum12" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0027h Name : Starting Address Style : DWORD Data : 01800000h Name : End Address Style : DWORD Data : 019FFFFFh Name : Memory Device Handle Style : WORD Data : 002Fh Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 0028h Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM13" Name : Bank Locator Style : STRING Data : "BANK13" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer13" Name : Serial Number Style : STRING Data : "SerNum13" Name : Asset Tag Style : STRING Data : "AssetTagNum13" Name : Part Number Style : STRING Data : "PartNum13" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 0029h Name : Starting Address Style : DWORD Data : 01A00000h Name : End Address Style : DWORD Data : 01BFFFFFh Name : Memory Device Handle Style : WORD Data : 0031h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 002Ah Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM14" Name : Bank Locator Style : STRING Data : "BANK14" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer14" Name : Serial Number Style : STRING Data : "SerNum14" Name : Asset Tag Style : STRING Data : "AssetTagNum14" Name : Part Number Style : STRING Data : "PartNum14" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 002Bh Name : Starting Address Style : DWORD Data : 01C00000h Name : End Address Style : DWORD Data : 01DFFFFFh Name : Memory Device Handle Style : WORD Data : 0033h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 017] -- Memory Device =============================================================================== Name : Struc. Length Style : BYTE Data : 1Bh Name : Struc. Handle Style : WORD Data : 002Ch Name : Phys. Mem. Array Handle Style : WORD Data : 0015h Name : Mem. Err. Info. Handle Style : WORD Data : FFFEh Name : Total Width Style : WORD Data : 0040h Name : Data Width Style : WORD Data : 0048h Name : Size Style : WORD Data : 0800h Name : Form Factor Style : BYTE Data : 09h -- DIMM Name : Device Set Style : BYTE Data : 00h Name : Device Locator Style : STRING Data : "DIMM15" Name : Bank Locator Style : STRING Data : "BANK15" Name : Memory Type Style : BYTE Data : 13h -- DDR2 Name : Type Detail Style : WORD Data : 0080h -- Bit.07:Synchronous Name : Speed Style : WORD Data : 010Ah Name : Manufacturer Style : STRING Data : "Manufacturer15" Name : Serial Number Style : STRING Data : "SerNum15" Name : Asset Tag Style : STRING Data : "AssetTagNum15" Name : Part Number Style : STRING Data : "PartNum15" [Type 020] -- Memory Device Mapped Address =============================================================================== Name : Struc. Length Style : BYTE Data : 13h Name : Struc. Handle Style : WORD Data : 002Dh Name : Starting Address Style : DWORD Data : 01E00000h Name : End Address Style : DWORD Data : 01FFFFFFh Name : Memory Device Handle Style : WORD Data : 0035h Name : Mem. Map. Add. Handle Style : WORD Data : 0016h Name : Partition Row Position Style : BYTE Data : 01h Name : Interleave Position Style : BYTE Data : 00h Name : Interleaved Data Depth Style : BYTE Data : 0Ah [Type 032] -- System Boot Information =============================================================================== Name : Struc. Length Style : BYTE Data : 14h Name : Struc. Handle Style : WORD Data : 002Eh Name : Reserved Style : 6 BYTEs Data : 00 00 00 00 00 00h Name : Boot Status Style : BYTEs Data : 00 00 00 00 00 00 00 00 00 00 -- No errors detected [Type 038] -- IPMI Device Information =============================================================================== Name : Struc. Length Style : BYTE Data : 12h Name : Struc. Handle Style : WORD Data : 002Fh Name : Interface Type Style : BYTE Data : 01h -- Keyboard Controller Style Name : IPMI Spec. Rev. Style : BYTE Data : 15h Name : I2C Slave Address Style : BYTE Data : 20h Name : NV Storage Add. Style : BYTE Data : FFh Name : Base Address Style : QWORD Data : 0000 0000 0000 0CA3h Name : Unknown Field Style : BYTEs Data : 00 [Type 127] -- End-of-Table =============================================================================== Name : Struc. Length Style : BYTE Data : 04h Name : Struc. Handle Style : WORD Data : 0030h
#!/usr/bin/env python # # Examples which makes use of the different python-dmidecode features # This script should be run as root, or else expect permission warnings # # Copyright 2008-2009 Nima Talebi <n...@autonomy.net.au> # Copyright 2010 David Sommerseth <dav...@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # For the avoidance of doubt the "preferred form" of this code is one which # is in an open unpatent encumbered format. Where cryptographic key signing # forms part of the process of creating an executable the information # including keys needed to generate an equivalently functional executable # are deemed to be part of the source code. # import dmidecode import sys, os from pprint import pprint def print_warnings(): "Simple function, dumping out warnings with a prefix if warnings are found and clearing warning buffer" warn = dmidecode.get_warnings() if warn: print("### WARNING: %s" % warn) dmidecode.clear_warnings() # Check if running as root .... provide a warning if not root_user = (os.getuid() == 0 and True or False) if not root_user: print("####") print("#### NOT RUNNING AS ROOT") print("####") print("#### The first run must always be done as root for this example to work.") print("#### When not run as root, quite some permission errors might appear") print("####") print("#### If this script is first run as root, it should be possible to run this script") print("#### as an unprivileged user afterwards, with less warnings.") print("####") print() print() #. Test for presence of important functions using /dev/mem... Using the legacy API #. This does not print any decoded info. If the call fails, either a warning will #. be issued or an exception will be raised. This test is now only used to check #. for presence of the legacy API, which "under the hood" uses #. dmidecode.QuerySection(name), where name can be 'bios', 'system', etc. if root_user: print("*** bios ***\n"); dmidecode.bios() print_warnings() print("*** system ***\n"); dmidecode.system() print_warnings() print("*** baseboard ***\n"); dmidecode.baseboard() print_warnings() print("*** chassis ***\n"); dmidecode.chassis() print_warnings() print("*** processor ***\n"); dmidecode.processor() print_warnings() print("*** memory ***\n"); dmidecode.memory() print_warnings() print("*** cache ***\n"); dmidecode.cache() print_warnings() print("*** connector ***\n"); dmidecode.connector() print_warnings() print("*** slot ***\n"); dmidecode.slot() print_warnings() #. Now test get/set of memory device file... print("*** get_dev()") print(dmidecode.get_dev()) print_warnings() print("*** set_dev('dmidata.dump')") print(dmidecode.set_dev("dmidata.dump")); print_warnings() print("*** get_dev()") print(dmidecode.get_dev()) print_warnings() #. Test taking a dump... if root_user: print("*** Dumping DMI data to dump file") print(dmidecode.dump()) print_warnings() #. Test reading the dump... Using the preferred API print("*** bios ***\n"); pprint(dmidecode.QuerySection('bios')) print_warnings() print("*** system ***\n"); pprint(dmidecode.QuerySection('system')) print_warnings() print("*** baseboard ***\n"); pprint(dmidecode.QuerySection('baseboard')) print_warnings() print("*** chassis ***\n"); pprint(dmidecode.QuerySection('chassis')) print_warnings() print("*** processor ***\n"); pprint(dmidecode.QuerySection('processor')) print_warnings() print("*** memory ***\n"); pprint(dmidecode.QuerySection('memory')) print_warnings() print("*** cache ***\n"); pprint(dmidecode.QuerySection('cache')) print_warnings() print("*** connector ***\n"); pprint(dmidecode.QuerySection('connector')) print_warnings() print("*** slot ***\n"); pprint(dmidecode.QuerySection('slot')) print_warnings() print("*** Extracting memory information") for v in dmidecode.memory().values(): if type(v) == dict and v['dmi_type'] == 17: pprint(v['data']['Size']), print("*** Querying for DMI type 3 and 7") pprint(dmidecode.type(3)) # <-- Legacy API pprint(dmidecode.QueryTypeId(7)) # <-- preferred API print_warnings() print("*** Querying for the BIOS section") pprint(dmidecode.QuerySection('bios')) print_warnings() # # Test XML stuff # print() print() print() print("---------------------------------------") print("*** *** *** Testing XML API *** *** ***") print("---------------------------------------") print() print() dmixml = dmidecode.dmidecodeXML() # Fetch all DMI data into a libxml2.xmlDoc object print("*** Getting all DMI data into a XML document variable") dmixml.SetResultType(dmidecode.DMIXML_DOC) # Valid values: dmidecode.DMIXML_DOC, dmidecode.DMIXML_NODE xmldoc = dmixml.QuerySection('all') # Dump the XML to dmidump.xml - formated in UTF-8 decoding print("*** Dumping XML document to dmidump.xml") xmldoc.saveFormatFileEnc('dmidump.xml','UTF-8',1) # Do some XPath queries on the XML document print("*** Doing some XPath queries against the XML document") dmixp = xmldoc.xpathNewContext() # What to look for - XPath expressions keys = ['/dmidecode/SystemInfo/Manufacturer', '/dmidecode/SystemInfo/ProductName', '/dmidecode/SystemInfo/SerialNumber', '/dmidecode/SystemInfo/SystemUUID'] # Extract data and print it for k in keys: data = dmixp.xpathEval(k) for d in data: print("%s: %s" % (k, d.get_content())) del dmixp del xmldoc # Query for only a particular DMI TypeID - 0x04 - Processor print("*** Quering for Type ID 0x04 - Processor - dumping XML document to stdout") dmixml.QueryTypeId(0x04).saveFormatFileEnc('-','UTF-8',1) print_warnings()
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users