WIP need to fix systemid
This commit is contained in:
@@ -234,6 +234,8 @@ async def get_power_data(session, host: HostConfig):
|
||||
host.mark_failure()
|
||||
up_gauge.labels(host=host.fqdn).set(0)
|
||||
return
|
||||
pretty = json.dumps(chassis_data, indent=4, sort_keys=True)
|
||||
print(pretty)
|
||||
|
||||
# 3. Power-Daten aus den Chassis-Mitgliedern extrahieren
|
||||
for chassis_member in chassis_data.get("Members", []):
|
||||
@@ -246,7 +248,7 @@ async def get_power_data(session, host: HostConfig):
|
||||
if not member_data:
|
||||
continue
|
||||
|
||||
# PowerSubsystem extrahieren
|
||||
# PowerSubsystem url
|
||||
power_subsystem_url = member_data.get("PowerSubsystem", {}).get("@odata.id")
|
||||
if not power_subsystem_url:
|
||||
logging.warning("No PowerSubsystem found for %s", host.fqdn)
|
||||
@@ -265,7 +267,6 @@ async def get_power_data(session, host: HostConfig):
|
||||
power_supplies_url = power_subsystem_data.get("PowerSupplies", {}).get(
|
||||
"@odata.id"
|
||||
)
|
||||
|
||||
if not power_supplies_url:
|
||||
logging.warning("No PowerSupplies found for %s", host.fqdn)
|
||||
continue
|
||||
@@ -299,9 +300,6 @@ async def get_power_data(session, host: HostConfig):
|
||||
metrics_data = await fetch_with_retry(session, host, metrics_url)
|
||||
if not metrics_data:
|
||||
continue
|
||||
pretty = json.dumps(metrics_data, indent=4, sort_keys=True)
|
||||
print(pretty)
|
||||
exit(100)
|
||||
|
||||
# Get Metrics from data
|
||||
line_input_v = metrics_data.get("LineInputVoltage")
|
||||
|
||||
Reference in New Issue
Block a user