def __init__(self, lshw, element): Component.__init__(self, lshw, element) self.data = { "uuid": utils.xml_ev( lshw, lshw.getroot(), "node[@class='system']/configuration/setting[@id='uuid']/@value", True, ), "date": utils.xml_ev(lshw, element, "node[@id='firmware']/date"), } self.vendor = utils.normalize_vendor( utils.xml_ev(lshw, element, "vendor")) if self.vendor == "Dell Inc.": self.model = utils.dmidecode_string("system-product-name") else: self.model = utils.xml_ev(lshw, element, "product") if self.model == "X11SSE-F": self.model = "MBD-X11SSE-F" self.name = self.model self.serial = utils.xml_ev(lshw, element, "serial") self.firmware_version = utils.xml_ev(lshw, element, "node[@id='firmware']/version")
def __init__(self, lshw, element): Component.__init__(self, lshw, element) self.data = { "slot": utils.xml_ev(lshw, element, "slot"), "size": str(int(int(utils.xml_ev(lshw, element, "size")) / 1024000000)) + "GB", "clock": int(utils.xml_ev(lshw, element, "clock")) / 1000000 if utils.xml_ev(lshw, element, "clock") else "", "type": utils.get_dmidecode_prop( "0x" + utils.xml_ev(lshw, element, "@handle", True).split(":", 1)[1], "17", "type", ), "asset_tag": "Unknown", } self.name = utils.xml_ev(lshw, element, "description") self.model = utils.xml_ev(lshw, element, "product") self.vendor = utils.normalize_vendor( utils.xml_ev(lshw, element, "vendor")) self.serial = utils.xml_ev(lshw, element, "serial") self.firmware_version = "N/A"
def __init__(self, lsblk): Component.__init__(self, lsblk, None) self.lsblk = lsblk self.data = {"size": self.__size(), "devname": self.lsblk["name"]} if not self.__is_nvme(): self.data["smart"] = utils.get_smart_attributes(self.lsblk["name"]) match = re.search(r"^(\S+)_(\S+_\S+)", self.__getter("model")) if match: self.vendor = match.group(1) self.model = match.group(2) self.name = match.group(1) + " " + match.group(2) else: self.model = self.__getter("model") self.name = self.model if self.lsblk["vendor"] is None: self.vendor = self.model.split(" ")[0] else: self.vendor = self.lsblk["vendor"].strip() self.serial = self.__getter("serial") self.firmware_version = self.__getter("firmware_version") if self.__is_megaraid(): self.vendor = utils.get_smart_diskprop(self.lsblk["name"], "vendor") if self.vendor.strip() == "ATA": self.vendor = utils.normalize_vendor(self.model) else: self.vendor = utils.normalize_vendor(self.vendor)
def __init__(self, lshw, element): Component.__init__(self, lshw, element) self.name = utils.xml_ev(lshw, element, "description") self.model = utils.xml_ev(lshw, element, "product") self.serial = utils.xml_ev(lshw, element, "businfo") self.vendor = utils.normalize_vendor(utils.xml_ev(lshw, element, "vendor")) self.firmware_version = utils.xml_ev(lshw, element, "version") self.data = { "driver": utils.xml_ev( lshw, element, "configuration/setting[@id='driver']/@value", True ) } if "MegaRAID" in self.model: self.serial = utils.get_megaraid_prop("serial") for prop in ( "product_name", "firmware_bios", "firmware_ctrlr", "firmware_fw", "firmware_nvdata", "firmware_boot", "bbu", "memory_size", ): self.data["megaraid_" + prop] = utils.get_megaraid_prop(prop)
def __init__(self): Component.__init__(self) self.data = {} self.model = utils.dmidecode_string("system-product-name") self.name = self.model + " Base Management Controller" self.vendor = utils.normalize_vendor(utils.get_mc_info("vendor")) self.serial = utils.get_mc_info("guid") self.firmware_version = utils.get_mc_info("firmware_version")
def __init__(self, lshw, element): Component.__init__(self, lshw, element) self.data = { "cores": utils.xml_ev( lshw, element, "configuration/setting[@id='cores']/@value", True ), "clock": utils.xml_ev(lshw, element, "capacity"), } self.name = utils.xml_ev(lshw, element, "product") self.model = utils.xml_ev(lshw, element, "version") self.vendor = utils.normalize_vendor(utils.xml_ev(lshw, element, "vendor")) self.serial = utils.xml_ev(lshw, element, "slot") self.firmware_version = "N/A"
def __init__(self, lshw, element): Component.__init__(self, lshw, element) self.data = { "rate": utils.xml_ev(lshw, element, "size"), "devname": utils.xml_ev(lshw, element, "logicalname"), "driver": utils.xml_ev(lshw, element, "configuration/setting[@id='driver']/@value", True), } if self.data["rate"] == "": self.data["rate"] = utils.xml_ev(lshw, element, "capacity") self.name = utils.xml_ev(lshw, element, "product") self.model = utils.xml_ev(lshw, element, "product") self.serial = utils.ethtool_mac( utils.xml_ev(lshw, element, "logicalname")) self.vendor = utils.normalize_vendor( utils.xml_ev(lshw, element, "vendor")) self.firmware_version = utils.xml_ev( lshw, element, "configuration/setting[@id='firmware']/@value", True) if not utils.xml_ev(lshw, element, "businfo") == "": self.pci_id = utils.xml_ev(lshw, element, "businfo").split(":", 1)[1] else: self.pci_id = "" if "Illegal Vendor ID" in self.vendor and self.pci_id != "": _lspci = utils.lspci(self.pci_id) self.vendor = utils.normalize_vendor(_lspci["vendor"]) self.model = _lspci["device"] self.name = self.model if "Mellanox" in self.vendor and self.pci_id != "": try: self.firmware_version = utils.get_mellanox_prop( self.pci_id, "firmware_version") self.model = utils.get_mellanox_part_number(self.pci_id) self.data["mellanox_psid"] = utils.get_mellanox_prop( self.pci_id, "psid") except Exception: self.firmware_version = "" utils.log(message="get_mellanox_prop failed.")