This is the development version of Kanrisuru. Since this is still a pre-1.0 release, we don't recommend using this in system-critical production environments.

Kanrisuru

DMI Type

The Kanrisuru::Util::DmiType class is a lookup utility module that helps with translating and validating DMI Types used in the dmi module. DMI Types are classifications of fields belonging to hardware descriptions with the command dmidecode.

Public Class Methods

[]

Lookup the opposing value of a dmi type. If the value is an integer, it will return a string; if the value is a string, it will return an integer.

Kanrisuru::Util::DmiType['BIOS']
0

Kanrisuru::Util::Signal[0]
'BIOS'

valid?

Check if the dmi type exists in the lookup table.

Kanrisuru::Util::DmiType.valid?('BIOS')
true

Kanrisuru::Util::DmiType.valid?(1)
true

Kanrisuru::Util::DmiType.valid?(99)
false

Lookup Table

Has two lookup tables, @dmi_types and @dmi_types_inverted. Both created for quick in-memory lookup of dmi type translations.

Kanrisuru::Util::DmiType.instance_variable_get(:@dmi_types)
{
                                    "BIOS" => 0,
                                  "System" => 1,
                               "Baseboard" => 2,
                                 "Chassis" => 3,
                               "Processor" => 4,
                       "Memory Controller" => 5,
                           "Memory Module" => 6,
                                   "Cache" => 7,
                          "Port Connector" => 8,
                            "System Slots" => 9,
                        "On Board Devices" => 10,
                             "OEM Strings" => 11,
            "System Configuration Options" => 12,
                           "BIOS Language" => 13,
                      "Group Associations" => 14,
                        "System Event Log" => 15,
                   "Physical Memory Array" => 16,
                           "Memory Device" => 17,
                     "32-bit Memory Error" => 18,
             "Memory Array Mapped Address" => 19,
            "Memory Device Mapped Address" => 20,
                "Built-in Pointing Device" => 21,
                        "Portable Battery" => 22,
                            "System Reset" => 23,
                       "Hardware Security" => 24,
                   "System Power Controls" => 25,
                           "Voltage Probe" => 26,
                          "Cooling Device" => 27,
                       "Temperature Probe" => 28,
                "Electrical Current Probe" => 29,
               "Out-of-band Remote Access" => 30,
                 "Boot Integrity Services" => 31,
                             "System Boot" => 32,
                     "64-bit Memory Error" => 33,
                       "Management Device" => 34,
             "Management Device Component" => 35,
        "Management Device Threshold Data" => 36,
                          "Memory Channel" => 37,
                             "IPMI Device" => 38,
                     "System Power Supply" => 39,
                  "Additional Information" => 40,
    "Onboard Devices Extended Information" => 41,
    "Management Controller Host Interface" => 42,
                              "TPM Device" => 43
}


Kanrisuru::Util::DmiType.instance_variable_get(:@dmi_types_inverted)
{
     0 => "BIOS",
     1 => "System",
     2 => "Baseboard",
     3 => "Chassis",
     4 => "Processor",
     5 => "Memory Controller",
     6 => "Memory Module",
     7 => "Cache",
     8 => "Port Connector",
     9 => "System Slots",
    10 => "On Board Devices",
    11 => "OEM Strings",
    12 => "System Configuration Options",
    13 => "BIOS Language",
    14 => "Group Associations",
    15 => "System Event Log",
    16 => "Physical Memory Array",
    17 => "Memory Device",
    18 => "32-bit Memory Error",
    19 => "Memory Array Mapped Address",
    20 => "Memory Device Mapped Address",
    21 => "Built-in Pointing Device",
    22 => "Portable Battery",
    23 => "System Reset",
    24 => "Hardware Security",
    25 => "System Power Controls",
    26 => "Voltage Probe",
    27 => "Cooling Device",
    28 => "Temperature Probe",
    29 => "Electrical Current Probe",
    30 => "Out-of-band Remote Access",
    31 => "Boot Integrity Services",
    32 => "System Boot",
    33 => "64-bit Memory Error",
    34 => "Management Device",
    35 => "Management Device Component",
    36 => "Management Device Threshold Data",
    37 => "Memory Channel",
    38 => "IPMI Device",
    39 => "System Power Supply",
    40 => "Additional Information",
    41 => "Onboard Devices Extended Information",
    42 => "Management Controller Host Interface",
    43 => "TPM Device"
}