Skip to main content

An unofficial Python interface for obtaining metrics from Supermicro BMCs.

The following metrics are accessible:

  • Sensor: Temperature, Fan, Voltage, etc.

  • PMBus: Power Consumption, Fan, Temperature, etc.

Note: This library depends on the BMC web-interface being available.

Usage

Setup

# smbmc_example.py
from smbmc import Client

# initialise client with connection details
c = Client(IPMI_SERVER, IPMI_USER, IPMI_PASS)

# retrieve session token (usually lasts 30 minutes)
# optional: the library maintains session tokens internally.
c.login()

Sensor Metrics

# obtain sensor metrics
sensors = c.get_sensor_metrics()

for sensor in sensors:
    print(sensor.__dict__)

# output (some removed for brevity)
{'id': 0, 'name': 'System Temp', 'type': <SensorTypeEnum.TEMPERATURE: 1>, 'unit': <SensorUnitEnum.DEGREES_CELSIUS: 1>, 'state': <SensorStateEnum.PRESENT: 1>, 'flags': None, 'reading': 28.0, 'lnr': -9.0, 'lc': -7.0, 'lnc': -5.0, 'unc': 80.0, 'uc': 85.0, 'unr': 90.0}
{'id': 1, 'name': '12VCC', 'type': <SensorTypeEnum.VOLTAGE: 2>, 'unit': <SensorUnitEnum.VOLTS: 4>, 'state': <SensorStateEnum.PRESENT: 1>, 'flags': None, 'reading': 12.192, 'lnr': 10.144, 'lc': 10.272, 'lnc': 10.784, 'unc': 12.96, 'uc': 13.28, 'unr': 13.408}
{'id': 9, 'name': 'FAN1', 'type': <SensorTypeEnum.FAN: 4>, 'unit': <SensorUnitEnum.RPM: 18>, 'state': <SensorStateEnum.PRESENT: 1>, 'flags': None, 'reading': 3500.0, 'lnr': 400.0, 'lc': 600.0, 'lnc': 800.0, 'unc': 25300.0, 'uc': 25400.0, 'unr': 25500.0}
{'id': 10, 'name': 'FAN2', 'type': <SensorTypeEnum.FAN: 4>, 'unit': <SensorUnitEnum.RPM: 18>, 'state': <SensorStateEnum.NOT_PRESENT: 2>, 'flags': None, 'reading': 0.0, 'lnr': 400.0, 'lc': 600.0, 'lnc': 800.0, 'unc': 25300.0, 'uc': 25400.0, 'unr': 25500.0}
{'id': 19, 'name': 'SAS2 FTemp1', 'type': <SensorTypeEnum.TEMPERATURE: 1>, 'unit': <SensorUnitEnum.DEGREES_CELSIUS: 1>, 'state': <SensorStateEnum.PRESENT: 1>, 'flags': None, 'reading': 30.0, 'lnr': -9.0, 'lc': -7.0, 'lnc': -5.0, 'unc': 75.0, 'uc': 77.0, 'unr': 79.0}
{'id': 27, 'name': 'PS2 Status', 'type': <SensorTypeEnum.POWER_SUPPLY: 8>, 'unit': <SensorUnitEnum.UNSPECIFIED: 0>, 'state': <SensorStateEnum.PRESENT: 1>, 'flags': <PowerSupplyFlag.PRESENCE_DETECTED: 1>, 'reading': 0, 'lnr': 0, 'lc': 0, 'lnc': 0, 'unc': 0, 'uc': 0, 'unr': 0}

PMBus Metrics

# obtain pmbus metrics
power_supplies = c.get_pmbus_metrics()

for psu in power_supplies:
    print(psu.__dict__)

# output
{'id': 0, 'name': '', 'status': 'ff', 'type': '0', 'input_voltage': 0, 'input_current': 0.0, 'input_power': 0, 'output_voltage': 0.0, 'output_current': 0.0, 'output_power': 0, 'temp_1': 0, 'temp_2': 0, 'fan_1': 0, 'fan_2': 0}
{'id': 1, 'name': 'FAKE_PSU_SERIAL', 'status': '1', 'type': '1', 'input_voltage': 236, 'input_current': 0.359, 'input_power': 85, 'output_voltage': 12.1, 'output_current': 5.75, 'output_power': 69, 'temp_1': 38, 'temp_2': 53, 'fan_1': 2894, 'fan_2': 3810}

All Metrics

# obtain all metrics
metrics = c.get_metrics()

print(metrics)

# output
{'pmbus': [], 'sensor': []}

Contributing

This library has been tested on a system with the following components:

  • Chassis: SC846 (unknown revision; possibly 846BA-R920B)

  • Motherboard: CSE-PTJBOD-CB3

  • Power Supply: PWS-920P-SQ

  • Backplane: BPN-SAS2-846EL1

  • Power Distribution Board: PDB-PT846-2824

If there are any errors or additional functionality for other components, please file an issue with as much detail as you can!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smbmc-0.3.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smbmc-0.3.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file smbmc-0.3.0.tar.gz.

File metadata

  • Download URL: smbmc-0.3.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for smbmc-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0eabb9cfcbbcfd770112dcb4a7237c55a58bd9611e9a8919592b41f0915ee081
MD5 bfafa5bc97a8f2e8391adab2fbbc444e
BLAKE2b-256 44ae940738d4be4085d120a2bd4229471d40f7423e9ee3cc29e3a502e2fe1d7e

See more details on using hashes here.

File details

Details for the file smbmc-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: smbmc-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for smbmc-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 624fd70d9dcbcbaf4bd7b2ad24e5b4ca41417ac5dcf30dde7a9b01c4e6773e92
MD5 4d5f0b5010bca9fe16e6bf9b64e987c8
BLAKE2b-256 4c75d98861cce472d16ba11d38ac5f791fef3839e7757aa36b3134638f04cccf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

1 file

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page