diff --git a/routermon/routermon.py b/routermon/routermon.py index 71d95ea..d98a331 100644 --- a/routermon/routermon.py +++ b/routermon/routermon.py @@ -47,6 +47,7 @@ def main() -> int: if_points: list[Point] = [] if_stats: list[dict] = convertIntList(api.get_resource('/interface/ethernet').call('print', {'proplist': 'name,rx-bytes,tx-bytes'})) hw_stats: dict[str,str] = convertInt(api.get_resource('/system/resource').call('print', {'proplist':'uptime,cpu-load,total-memory,free-memory'})[0]) + hw_stats['temperature'] = convertInt(api.get_resource('/system/health').call('print')[1])['value'] # Calcolo della velocita' interfaccia a ogni ciclo for n, d in enumerate(if_stats): if_stats[n]['rx-rate'] = int((if_stats[n]['rx-bytes']-if_stats_old[n]['rx-bytes'])/(now-last)) @@ -60,7 +61,7 @@ def main() -> int: write_client.write(record=if_points) # Risorse del router - write_client.write(record=dict2Point('resources', hw_stats)) + write_client.write(record=dict2Point('resources',hw_stats)) # Salvo ultimo punto per il giro successivo if_stats_old = if_stats