ensure keys exist
@@ -193,9 +193,11 @@ class Monitor:
ipv4_os = 'NO DATA'
if 'mac_addresses' in endpoint.metadata:
for mac in endpoint.metadata['mac_addresses']:
+ if 'labels' in endpoint.metadata['mac_addresses'][mac]:
top_role = endpoint.metadata['mac_addresses'][mac]['labels'][0]
second_role = endpoint.metadata['mac_addresses'][mac]['labels'][1]
third_role = endpoint.metadata['mac_addresses'][mac]['labels'][2]
+ if 'confidences' in endpoint.metadata['mac_addresses'][mac]:
top_conf = endpoint.metadata['mac_addresses'][mac]['confidences'][0]
second_conf = endpoint.metadata['mac_addresses'][mac]['confidences'][1]
third_conf = endpoint.metadata['mac_addresses'][mac]['confidences'][2]
