()
| 14302 | 'alive_entries': len([entry for entry in netkb_data if entry.get('Alive') in ['1', 1]]), |
| 14303 | 'sample_entries': netkb_data[:3] if netkb_data else [], |
| 14304 | 'all_alive_values': list(set([str(entry.get('Alive', 'MISSING')) for entry in netkb_data])), |
| 14305 | 'file_path': netkb_file_path, |
| 14306 | 'file_exists': os.path.exists(netkb_file_path) if netkb_file_path != 'NOT_SET' else False |
| 14307 | } |
| 14308 | except Exception as e: |
| 14309 | debug_info['errors_and_warnings'].append(f"Error reading NetKB data: {str(e)}") |
| 14310 | |
| 14311 | # === CACHE STATE DEBUGGING === |
| 14312 | debug_info['cache_state'] = { |
| 14313 | 'network_scan_cache_keys': list(network_scan_cache.keys()), |
| 14314 | 'arp_hosts_count': len(network_scan_cache.get('arp_hosts', {})), |
| 14315 | 'arp_hosts_sample': dict(list(network_scan_cache.get('arp_hosts', {}).items())[:5]), |
| 14316 | 'last_arp_scan_time': network_scan_cache.get('last_arp_scan', 'NEVER'), |
| 14317 | 'cache_size': len(str(network_scan_cache)), |
| 14318 | 'network_scan_last_update': network_scan_last_update, |
| 14319 | 'arp_scan_interval': ARP_SCAN_INTERVAL, |
| 14320 | 'current_time': time.time(), |
| 14321 | 'time_since_last_cache_update': time.time() - network_scan_last_update if network_scan_last_update else 'NEVER' |
| 14322 | } |
| 14323 | |
| 14324 | # Test ARP scan directly |
| 14325 | try: |
nothing calls this directly
no outgoing calls
no test coverage detected