diff --git a/Cargo.lock b/Cargo.lock index 7140979..50f0416 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.271" +version = "0.1.272" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.271" +version = "0.1.272" dependencies = [ "anyhow", "async-trait", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.271" +version = "0.1.272" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 05bb66b..f27d8f1 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.272" +version = "0.1.273" edition = "2021" [dependencies] diff --git a/agent/src/collectors/systemd.rs b/agent/src/collectors/systemd.rs index aa9f72e..d53ae19 100644 --- a/agent/src/collectors/systemd.rs +++ b/agent/src/collectors/systemd.rs @@ -1062,21 +1062,39 @@ impl SystemdCollector { } // Format: "/path/to/export hostname(options)" or "/path/to/export 192.168.1.0/24(options)" - // exportfs -v shows each export once per client/network - // We want to deduplicate by path and just show one entry - let parts: Vec<&str> = line.split_whitespace().collect(); + // Split only at first whitespace to get path and rest + let parts: Vec<&str> = line.splitn(2, char::is_whitespace).collect(); if parts.is_empty() { continue; } - let export_path = parts[0].to_string(); + let export_path = parts[0].trim().to_string(); - // Extract options from parentheses (from the client specification) + // Find options in parentheses from the entire rest of the line let options = if parts.len() > 1 { - let client_spec = parts[1]; - if let Some(start) = client_spec.find('(') { - if let Some(end) = client_spec.find(')') { - client_spec[start+1..end].to_string() + let rest = parts[1].trim(); + // Find all text in parentheses (there might be spaces before the parentheses) + if let Some(start) = rest.find('(') { + if let Some(end) = rest.find(')') { + // Extract key options only: rw/ro, sync/async + let opts = rest[start+1..end].to_string(); + // Simplify options to just show key ones + let mut key_opts = Vec::new(); + if opts.contains("rw") { + key_opts.push("rw"); + } else if opts.contains("ro") { + key_opts.push("ro"); + } + if opts.contains("sync") { + key_opts.push("sync"); + } else if opts.contains("async") { + key_opts.push("async"); + } + if !key_opts.is_empty() { + key_opts.join(",") + } else { + String::new() + } } else { String::new() } diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 0795af1..eb64802 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.272" +version = "0.1.273" edition = "2021" [dependencies] diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 275adc3..7065966 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.272" +version = "0.1.273" edition = "2021" [dependencies]