Add detailed error logging for nft command failures
All checks were successful
Build and Release / build-and-release (push) Successful in 1m28s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m28s
- Log exit status code when nft command fails - Log stderr output to diagnose issues - Distinguish between command execution failure and non-zero exit - Update version to v0.1.253
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.252"
|
||||
version = "0.1.253"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -920,8 +920,13 @@ impl SystemdCollector {
|
||||
|
||||
let output = match output {
|
||||
Ok(out) if out.status.success() => out,
|
||||
_ => {
|
||||
info!("Failed to run nft list ruleset");
|
||||
Ok(out) => {
|
||||
info!("nft command failed with status: {:?}, stderr: {}",
|
||||
out.status, String::from_utf8_lossy(&out.stderr));
|
||||
return (String::new(), String::new());
|
||||
}
|
||||
Err(e) => {
|
||||
info!("Failed to execute nft command: {}", e);
|
||||
return (String::new(), String::new());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user