From c9fde925142a8739ea21b0a6f681515f471b2dc8 Mon Sep 17 00:00:00 2001 From: Russ Garrett Date: Fri, 31 May 2024 19:30:04 +0100 Subject: [PATCH] Status into DK geojson --- dk_geojson/generate_dk_geojson.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dk_geojson/generate_dk_geojson.py b/dk_geojson/generate_dk_geojson.py index 83c82f3..6f52916 100644 --- a/dk_geojson/generate_dk_geojson.py +++ b/dk_geojson/generate_dk_geojson.py @@ -37,8 +37,10 @@ def get_monitoring_data(): return result -# monitoring_data = get_monitoring_data() -monitoring_data = {} +monitoring_data = get_monitoring_data() +print(monitoring_data) + +# monitoring_data = {} def device_info(device): @@ -47,11 +49,10 @@ def device_info(device): "type": device.device_type.display, "url": f"{NETBOX_URL}dcim/devices/{device.id}", "status": device.status.label, - "alive": False, } - # if device.name in monitoring_data: - # info["alive"] = monitoring_data[device.name] + if device.name in monitoring_data: + info["alive"] = monitoring_data[device.name] return info