logging and item -> items
@@ -321,13 +321,15 @@ class Monitor:
data = my_obj.get('data', None)
results = my_obj.get('results', {})
tool = results.get('tool', None)
+ for endpoint in self.s.endpoints.items():
+ self.logger.debug(f'prev endpoints: {endpoint.name}, {endpoint.metadata}')
if isinstance(data, dict):
updates = False
if tool == 'p0f':
if data:
for ip, ip_data in data.items():
if ip_data and ip_data.get('full_os', None):
- for endpoint in self.s.endpoints.item():
+ for endpoint in self.s.endpoints.items():
if endpoint.endpoint_data['ipv4'] == ip:
ep = self.s.endpoints.get(endpoint.name, None)
if ep:
@@ -335,11 +337,12 @@ class Monitor:
'processing p0f results for %s', endpoint.name)
if not 'ipv4_addresses' in ep.metadata:
ep.metadata['ipv4_addresses'] = {}
+ self.logger.debug(f'updating endpoint: {endpoint.name}, {endpooint.metadata}')
ep.metadata['ipv4_addresses'][ip] = ip_data
updates = True
elif tool == 'networkml':
for name, message in data.items():
- for endpoint in self.s.endpoints.item():
+ for endpoint in self.s.endpoints.items():
if endpoint.endpoint_data['mac'] == message['source_mac']:
ep = self.s.endpoints.get(name, None)
if ep:
@@ -349,10 +352,13 @@ class Monitor:
if message.get('valid', False):
if not 'mac_addresses' in endpoint.metadata:
endpoint.metadata['mac_addresses'] = {}
+ self.logger.debug(f'updating endpoint: {endpoint.name}, {endpooint.metadata}')
endpoint.metadata['mac_addresses'][message['source_mac']] = message
updates = True
if updates:
self.job_update_metrics()
+ for endpoint in self.s.endpoints.items():
+ self.logger.debug(f'after endpoints: {endpoint.name}, {endpoint.metadata}')
return data
return {}
