Exemplo n.º 1
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyghmi.ipmi.oem.lenovo.inventory import EntryField, \
    parse_inventory_category_entry

raid_drive_fields = (
    EntryField("index", "B"),
    EntryField("VendorID", "64s"),
    EntryField("Size", "I",
               valuefunc=lambda v: str(v) + " MB"),
    EntryField("MediaType", "B", mapper={
        0x00: "HDD",
        0x01: "SSD",
        0x02: "SSM_FLASH"
    }),
    EntryField("InterfaceType", "B", mapper={
        0x00: "Unknown",
        0x01: "ParallelSCSI",
        0x02: "SAS",
        0x03: "SATA",
        0x04: "FC"
    }),
Exemplo n.º 2
0
    # Power supply is unplugged from the wall
    fields["Unplugged"] = \
        bool(psu_status_word_bit(word, 2))

    # fields["Power supply is present"] = \
    #    bool(psu_status_word_bit(word, 1))

    # Power supply is hot-replaceable
    fields["Hot Replaceable"] = \
        bool(psu_status_word_bit(word, 0))

    return fields


psu_fields = (EntryField("index", "B"),
              EntryField("Presence State", "B",
                         presence=True), EntryField("Capacity W", "<H"),
              EntryField("Board manufacturer",
                         "18s"), EntryField("Board model", "18s"),
              EntryField("Board manufacture date",
                         "10s"), EntryField("Board serial number", "34s"),
              EntryField("Board manufacturer revision",
                         "5s"), EntryField("Board product name", "10s"),
              EntryField("PSU Asset Tag", "10s"),
              EntryField("PSU Redundancy Status",
                         "B",
                         valuefunc=lambda v: "Not redundant"
                         if v == 0x00 else "Redundant"),
              EntryField("PSU Status Word",
                         "<H",
Exemplo n.º 3
0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyghmi.ipmi.oem.lenovo.inventory import EntryField, \
    parse_inventory_category_entry

dimm_fields = (EntryField("index", "B"), EntryField("manufacture_location",
                                                    "B"),
               EntryField("channel_number",
                          "B"), EntryField("module_type", "10s"),
               EntryField("ddr_voltage", "10s"),
               EntryField("speed", "<h", valuefunc=lambda v: str(v) + " MHz"),
               EntryField("capacity_mb", "<h", valuefunc=lambda v: v * 1024),
               EntryField("manufacturer", "30s"), EntryField("serial", "I"),
               EntryField("model",
                          "21s"), EntryField("reserved", "h", include=False))


def parse_dimm_info(raw):
    return parse_inventory_category_entry(raw, dimm_fields)

Exemplo n.º 4
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyghmi.ipmi.oem.lenovo.inventory import EntryField, \
    parse_inventory_category_entry

pci_fields = (
    EntryField("index", "B"),
    EntryField("PCIType", "B", mapper={
        0x0: "On board slot",
        0x1: "Riser Type 1",
        0x2: "Riser Type 2",
        0x3: "Riser Type 3",
        0x4: "Riser Type 4",
        0x5: "Riser Type 5",
        0x6: "Riser Type 6a",
        0x7: "Riser Type 6b",
        0x8: "ROC",
        0x9: "Mezz"
    }),
    EntryField("BusNumber", "B"),
    EntryField("DeviceFunction", "B"),
    EntryField("VendorID", "<H", presence=True),
Exemplo n.º 5
0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyghmi.ipmi.oem.lenovo.inventory import EntryField, \
    parse_inventory_category_entry, parse_bios_number_entry

firmware_fields = (EntryField("Revision", "B"), EntryField("Bios", "16s"),
                   EntryField("Operational ME",
                              "10s"), EntryField("Recovery ME", "10s"),
                   EntryField("RAID 1", "16s"), EntryField("RAID 2", "16s"),
                   EntryField("Mezz 1", "16s"), EntryField("Mezz 2", "16s"),
                   EntryField("BMC", "16s"), EntryField("LEPT", "16s"),
                   EntryField("PSU 1", "16s"), EntryField("PSU 2", "16s"),
                   EntryField("CPLD", "16s"), EntryField("LIND", "16s"),
                   EntryField("WIND", "16s"), EntryField("DIAG", "16s"))

asrock_firmware_fields = (EntryField("Major Firmware Revision", "B"),
                          EntryField("Minor Firmware Revision", "B"),
                          EntryField("Auxiliary Firmware Revision", "4s"))

firmware_cmd = {
    "lenovo": {
Exemplo n.º 6
0
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyghmi.ipmi.oem.lenovo.inventory import EntryField, \
    parse_inventory_category_entry

cpu_fields = (EntryField("index", "B"), EntryField("Cores", "B"),
              EntryField("Threads",
                         "B"), EntryField("Manufacturer",
                                          "13s"), EntryField("Family", "30s"),
              EntryField("Model", "30s"), EntryField("Stepping", "3s"),
              EntryField("Maximum Frequency",
                         "<I",
                         valuefunc=lambda v: str(v) + " MHz"),
              EntryField("Reserved", "h", include=False))

cpu_cmd = {
    "lenovo": {
        "netfn": 0x06,
        "command": 0x59,
        "data": (0x00, 0xc1, 0x01, 0x00)
    },
Exemplo n.º 7
0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pyghmi.ipmi.oem.lenovo.inventory import EntryField, \
    parse_inventory_category_entry

raid_controller_fields = (
    EntryField("ControllerID", "I"),
    EntryField("AdapterType", "B", mapper={
        0x00: "Unknown",
        0x01: "RAIDController"
    }),
    EntryField("SupercapPresence", "B", mapper={
        0x00: "Absent",
        0x01: "Present"
    }),
    EntryField("FlashComponent1Name", "16s"),
    EntryField("FlashComponent1Version", "64s"),
    EntryField("FlashComponent2Name", "16s"),
    EntryField("FlashComponent2Version", "64s"),
    EntryField("FlashComponent3Name", "16s"),
    EntryField("FlashComponent3Version", "64s"),
    EntryField("FlashComponent4Name", "16s"),