From 8b19633a843f6d3253c260d787aa28ed4cf6f185 Mon Sep 17 00:00:00 2001 From: Marco Lucarelli Date: Mon, 2 Feb 2026 15:28:54 +0100 Subject: [PATCH] rename labels --- python/redfish-api/README.md | 20 ++++++++++---------- python/redfish-api/redfish_exporter_v9000.py | 10 ++++++++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/python/redfish-api/README.md b/python/redfish-api/README.md index 6c031a5..67362e4 100644 --- a/python/redfish-api/README.md +++ b/python/redfish-api/README.md @@ -13,15 +13,15 @@ I've createtd this python script to collect Power data to analyse Watts, Volts a - Docker support. ## Metrics Overview -| Metric | Typ | Description | -| ------------------------------------ | --------- | -------------------------------------------------------------- | -| redfish_up | Gauge | Status from host (1 = reachable, 0 = not reachable). | -| redfish_psu_line_input_voltage_volts | Gauge | Voltages per powersupply (label: host, psu_serial). | -| redfish_psu_power_input_watts | Gauge | Watts per powersupply (label: host, psu_serial). | -| redfish_psu_input_amps | Gauge | Amperes per powersupply (label: host, psu_serial). | -| redfish_system_info | Info | Systeminformation (Vendor, Model, Serial, Redfish Version). | -| redfish_request_latency_seconds | Histogram | Latency (label: host). | -| redfish_errors_total | Counter | Number of errors per host and error type (label: host, error). | +| Metric | Typ | Description | +|---------------------------------|-----------|----------------------------------------------------------------| +| redfish_up | Gauge | Status from host (1 = reachable, 0 = not reachable). | +| redfish_psu_input_voltage | Gauge | Voltages per powersupply (label: host, psu_serial). | +| redfish_psu_input_watts | Gauge | Watts per powersupply (label: host, psu_serial). | +| redfish_psu_input_amps | Gauge | Amperes per powersupply (label: host, psu_serial). | +| redfish_system_info | Info | Systeminformation (Vendor, Model, Serial, Redfish Version). | +| redfish_request_latency_seconds | Histogram | Latency (label: host). | +| redfish_errors_total | Counter | Number of errors per host and error type (label: host, error). | ## Usage ``` @@ -163,7 +163,7 @@ This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) f Here some Server's that I have successfully testet: | Vendor | Model | Redfish Version | -| ---------- | -------------------- | --------------- | +|------------|----------------------|-----------------| | Supermicro | AS-5126GS-TNRT2 | 1.21.0 | | | AS-1124US-TNRP | 1.8.0 | | HPE | ProLiant DL380 Gen10 | 1.6.0 | diff --git a/python/redfish-api/redfish_exporter_v9000.py b/python/redfish-api/redfish_exporter_v9000.py index 8c8de3b..140880b 100644 --- a/python/redfish-api/redfish_exporter_v9000.py +++ b/python/redfish-api/redfish_exporter_v9000.py @@ -98,12 +98,12 @@ ERROR_COUNTER = Counter( "redfish_errors_total", "Total Redfish errors", ["host", "error"] ) VOLTAGE_GAUGE = Gauge( - "redfish_psu_line_input_voltage_volts", + "redfish_psu_input_voltage_volts", "Line Input Voltage per PSU", ["host", "psu_serial", "group"], ) WATTS_GAUGE = Gauge( - "redfish_psu_power_input_watts", + "redfish_psu_input_watts", "Power Input Watts per PSU", ["host", "psu_serial", "group"], ) @@ -553,8 +553,14 @@ async def get_system_info(session, host: HostConfig): continue manufacturer = system_data.get("Manufacturer") + if manufacturer is None: + manufacturer = "" model = system_data.get("Model") + if model is None: + model = "" serial_number = system_data.get("SerialNumber") + if serial_number is None: + serial_number = "" # Hier könnte ihre Werbung stehen SYSTEM_INFO.labels(host=host.fqdn, group=host.group).info(