Add debug logging to diagnose Phase 4 service discovery issue
Add detailed debug logging to track: - Service discovery start - Individual service parsing - Final service count and list - Empty results indication This will help identify why cmbox disappeared from dashboard.
This commit is contained in:
parent
da6f3c3855
commit
7607e971b8
@ -127,6 +127,7 @@ impl SystemdCollector {
|
|||||||
|
|
||||||
/// Auto-discover interesting services to monitor
|
/// Auto-discover interesting services to monitor
|
||||||
fn discover_services(&self) -> Result<Vec<String>> {
|
fn discover_services(&self) -> Result<Vec<String>> {
|
||||||
|
debug!("Starting systemd service discovery with status caching");
|
||||||
// Get all services (includes inactive, running, failed - everything)
|
// Get all services (includes inactive, running, failed - everything)
|
||||||
let units_output = Command::new("systemctl")
|
let units_output = Command::new("systemctl")
|
||||||
.arg("list-units")
|
.arg("list-units")
|
||||||
@ -175,6 +176,7 @@ impl SystemdCollector {
|
|||||||
});
|
});
|
||||||
|
|
||||||
all_service_names.insert(service_name.to_string());
|
all_service_names.insert(service_name.to_string());
|
||||||
|
debug!("Parsed service: {} (load:{}, active:{}, sub:{})", service_name, load_state, active_state, sub_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,6 +221,11 @@ impl SystemdCollector {
|
|||||||
state.service_status_cache = status_cache;
|
state.service_status_cache = status_cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug!("Service discovery completed: found {} matching services: {:?}", services.len(), services);
|
||||||
|
if services.is_empty() {
|
||||||
|
debug!("No services found matching the configured filters - this may indicate a parsing issue");
|
||||||
|
}
|
||||||
|
|
||||||
Ok(services)
|
Ok(services)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user