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