summaryrefslogtreecommitdiffstats
path: root/rteval/rteval_dmi.xsl
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-06-16 21:52:15 +0200
committerDavid Sommerseth <davids@redhat.com>2009-06-16 21:52:15 +0200
commit3ddac64e2223cc41e90115f8513c7dd1e6e928f5 (patch)
treebe585511004ebd7ed9436a5aa58883d61194683c /rteval/rteval_dmi.xsl
parent76b0a0fed4139af6258daff09b4c0b31b5535bc9 (diff)
downloadrteval-3ddac64e2223cc41e90115f8513c7dd1e6e928f5.tar.gz
rteval-3ddac64e2223cc41e90115f8513c7dd1e6e928f5.tar.xz
rteval-3ddac64e2223cc41e90115f8513c7dd1e6e928f5.zip
Reworked the DMI data results
Plus, fixed some permission issues with files in the /usr/share/rteval-* dir
Diffstat (limited to 'rteval/rteval_dmi.xsl')
-rw-r--r--rteval/rteval_dmi.xsl157
1 files changed, 157 insertions, 0 deletions
diff --git a/rteval/rteval_dmi.xsl b/rteval/rteval_dmi.xsl
new file mode 100644
index 0000000..25b666b
--- /dev/null
+++ b/rteval/rteval_dmi.xsl
@@ -0,0 +1,157 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
+
+ <xsl:template match="/dmidecode">
+ <HardwareInfo>
+ <xsl:attribute name="SerialNo"><xsl:value-of select="SystemInfo/SerialNumber"/></xsl:attribute>
+ <xsl:attribute name="SystemUUID"><xsl:value-of select="SystemInfo/SystemUUID"/></xsl:attribute>
+ <xsl:apply-templates select="SystemInfo|BIOSinfo"/>
+
+ <SystemProcessors>
+ <xsl:apply-templates select="ProcessorInfo[Populated = 'Enabled']"/>
+ </SystemProcessors>
+
+ <SystemCache>
+ <xsl:apply-templates select="CacheInfo"/>
+ </SystemCache>
+
+ <xsl:apply-templates select="PhysicalMemoryArray"/>
+
+ <SystemDevices>
+ <xsl:apply-templates select="SystemSlots"/>
+ <xsl:apply-templates select="OnBoardDevicesInfo"/>
+ </SystemDevices>
+ <PortConnectors>
+ <xsl:apply-templates select="PortConnectorInfo"/>
+ </PortConnectors>
+ </HardwareInfo>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/BIOSinfo">
+ <BIOS>
+ <xsl:attribute name="Version"><xsl:value-of select="Version"/></xsl:attribute>
+ <xsl:attribute name="ReleaseDate"><xsl:value-of select="ReleaseDate"/></xsl:attribute>
+ <xsl:attribute name="BIOSrevision"><xsl:value-of select="BIOSrevision"/></xsl:attribute>
+ <xsl:value-of select ="Vendor"/>
+ </BIOS>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/SystemInfo">
+ <GeneralInfo>
+ <xsl:copy-of select ="Manufacturer|ProductName|Version|SKUnumber|Family"/>
+ <BaseBoard>
+ <xsl:attribute name="Manufacturer"><xsl:value-of select="../BaseBoardInfo/Manufacturer"/></xsl:attribute>
+ <xsl:attribute name="Version"><xsl:value-of select="../BaseBoardInfo/Version"/></xsl:attribute>
+ <xsl:attribute name="SerialNum"><xsl:value-of select="../BaseBoardInfo/SerialNumber"/></xsl:attribute>
+ <xsl:value-of select="../BaseBoardInfo/ProductName"/>
+ </BaseBoard>
+ <BootErrors>
+ <xsl:value-of select="../SystemBootInfo/Status"/>
+ </BootErrors>
+ </GeneralInfo>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/ProcessorInfo">
+ <ProcessorInfo>
+ <xsl:attribute name="NumCores"><xsl:value-of select="Cores/CoreCount"/></xsl:attribute>
+ <xsl:attribute name="ActiveCores"><xsl:value-of select="Cores/CoresEnabled"/></xsl:attribute>
+ <xsl:attribute name="ThreadCount"><xsl:value-of select="Cores/ThreadCount"/></xsl:attribute>
+ <xsl:copy-of select="Manufacturer"/>
+ <Family>
+ <xsl:attribute name="dmiflags"><xsl:value-of select="Family/@flags"/></xsl:attribute>
+ <xsl:value-of select="Family"/>
+ </Family>
+ <Signature><xsl:value-of select="CPUCore/Signature"/></Signature>
+ <CPUflags>
+ <xsl:for-each select="CPUCore/cpu_flags/flag[@available='1']">
+ <Flag>
+ <xsl:attribute name="flag"><xsl:value-of select="@flag"/></xsl:attribute>
+ </Flag>
+ </xsl:for-each>
+ </CPUflags>
+ <Characterisitics>
+ <xsl:for-each select="Cores/Characteristics/Flag">
+ <Characteristic><xsl:value-of select="."/></Characteristic>
+ </xsl:for-each>
+ </Characterisitics>
+ <Frequencies>
+ <xsl:attribute name="ExternalClock"><xsl:value-of select="Frequencies/ExternalClock"/></xsl:attribute>
+ <xsl:attribute name="MaxSpeed"><xsl:value-of select="Frequencies/MaxSpeed"/></xsl:attribute>
+ <xsl:attribute name="BootSpeed"><xsl:value-of select="Frequencies/CurrentSpeed"/></xsl:attribute>
+ </Frequencies>
+ <Cache>
+ <xsl:for-each select="Cache/Level[@available='1']">
+ <Level>
+ <xsl:attribute name="level"><xsl:value-of select="@level"/></xsl:attribute>
+ <xsl:attribute name="provided"><xsl:value-of select="@provided"/></xsl:attribute>
+ </Level>
+ </xsl:for-each>
+ </Cache>
+ </ProcessorInfo>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/CacheInfo">
+ <CacheModule>
+ <xsl:attribute name="Loctaion"><xsl:value-of select="CacheLocation"/></xsl:attribute>
+ <xsl:attribute name="Size"><xsl:value-of select="concat(InstalledSize, InstalledSize/@unit)"/></xsl:attribute>
+ <xsl:attribute name="MaxSize"><xsl:value-of select="concat(MaximumSize, MaximumSize/@unit)"/></xsl:attribute>
+ <xsl:copy-of select="OperationalMode|SystemType|Associativity"/>
+ </CacheModule>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/PhysicalMemoryArray">
+ <SystemMemory>
+ <xsl:attribute name="MaxCapacity"><xsl:value-of select="MaxCapacity"/></xsl:attribute>
+ <xsl:attribute name="MaxCapacityUnit"><xsl:value-of select="MaxCapacity/@unit"/></xsl:attribute>
+ <xsl:attribute name="MaxNumSlots"><xsl:value-of select="@NumDevices"/></xsl:attribute>
+ <xsl:apply-templates select="../MemoryDevice" mode="module"/>
+ </SystemMemory>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/MemoryDevice" mode="module">
+ <xsl:if test="not(Size/@empty)">
+ <MemoryModule>
+ <xsl:attribute name="Slot"><xsl:value-of select="Locator"/></xsl:attribute>
+ <xsl:attribute name="BankLocator"><xsl:value-of select="BankLocator"/></xsl:attribute>
+ <xsl:attribute name="Set"><xsl:value-of select="Set"/></xsl:attribute>
+ <xsl:copy-of select="Size"/>
+ <xsl:copy-of select="Speed"/>
+ <xsl:copy-of select="Type"/>
+ <Manufacturer>
+ <xsl:attribute name="PartNumber"><xsl:value-of select="PartNumber"/></xsl:attribute>
+ <xsl:attribute name="AssetTag"><xsl:value-of select="AssetTag"/></xsl:attribute>
+ <xsl:value-of select="Manufacturer"/>
+ </Manufacturer>
+ </MemoryModule>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/SystemSlots">
+ <SystemSlot>
+ <xsl:attribute name="id"><xsl:value-of select="SlotID/@id"/></xsl:attribute>
+ <xsl:attribute name="SlotDesignation"><xsl:value-of select="Designation"/></xsl:attribute>
+ <xsl:attribute name="Width"><xsl:value-of select="SlotWidth"/></xsl:attribute>
+ <xsl:attribute name="Type"><xsl:value-of select="SlotType"/></xsl:attribute>
+ <xsl:attribute name="Usage"><xsl:value-of select="CurrentUsage"/></xsl:attribute>
+ </SystemSlot>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/OnBoardDevicesInfo">
+ <OnBoardDevice>
+ <xsl:attribute name="Enabled"><xsl:value-of select="dmi_on_board_devices/Device/@Enabled"/></xsl:attribute>
+ <xsl:attribute name="Type"><xsl:value-of select="dmi_on_board_devices/Device/Type"/></xsl:attribute>
+ <xsl:value-of select="dmi_on_board_devices/Device/Description"/>
+ </OnBoardDevice>
+ </xsl:template>
+
+ <xsl:template match="/dmidecode/PortConnectorInfo">
+ <Connector>
+ <xsl:attribute name="DesignatorInt"><xsl:value-of select="DesignatorRef[@type='internal']"/></xsl:attribute>
+ <xsl:attribute name="DesignatorExt"><xsl:value-of select="DesignatorRef[@type='external']"/></xsl:attribute>
+ <xsl:attribute name="Connector"><xsl:value-of select="Connector[@type='external']"/></xsl:attribute>
+ <xsl:value-of select="PortType"/>
+ </Connector>
+ </xsl:template>
+
+</xsl:stylesheet>