Fixed: Metric Name

This commit is contained in:
TheJoKlLa 2023-02-07 04:59:22 +01:00
parent bdf4c56f0b
commit 4dec3b3e91

View File

@ -37,14 +37,14 @@ async def main():
machine_list = machine_list.machine_list machine_list = machine_list.machine_list
for machine in machine_list: for machine in machine_list:
metriclist[machine.name] = Gauge("bffh_machine_" + machine.name + "_state", "Machine State") metriclist[machine.id] = Gauge("bffh_machine_" + machine.id + "_state", "Machine State")
while True: while True:
machine_list_new = await session.machineSystem.info.getMachineList().a_wait() machine_list_new = await session.machineSystem.info.getMachineList().a_wait()
machine_list_new = machine_list_new.machine_list machine_list_new = machine_list_new.machine_list
for machine in machine_list_new: for machine in machine_list_new:
metriclist[machine.name].set(convert2int(machine.state)) metriclist[machine.id].set(convert2int(machine.state))
await asyncio.sleep(polling_interval_seconds) await asyncio.sleep(polling_interval_seconds)