Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7362464b46 |
6
Cargo.lock
generated
6
Cargo.lock
generated
@@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.270"
|
version = "0.1.271"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -301,7 +301,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.270"
|
version = "0.1.271"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@@ -325,7 +325,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.270"
|
version = "0.1.271"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.271"
|
version = "0.1.272"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -1053,7 +1053,7 @@ impl SystemdCollector {
|
|||||||
{
|
{
|
||||||
Ok(output) if output.status.success() => {
|
Ok(output) if output.status.success() => {
|
||||||
let exports_output = String::from_utf8_lossy(&output.stdout);
|
let exports_output = String::from_utf8_lossy(&output.stdout);
|
||||||
let mut exports = Vec::new();
|
let mut exports_map: std::collections::HashMap<String, String> = std::collections::HashMap::new();
|
||||||
|
|
||||||
for line in exports_output.lines() {
|
for line in exports_output.lines() {
|
||||||
let line = line.trim();
|
let line = line.trim();
|
||||||
@@ -1061,8 +1061,9 @@ impl SystemdCollector {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format: "/path/to/export hostname(options)"
|
// Format: "/path/to/export hostname(options)" or "/path/to/export 192.168.1.0/24(options)"
|
||||||
// We want just the path and a summary of 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();
|
let parts: Vec<&str> = line.split_whitespace().collect();
|
||||||
if parts.is_empty() {
|
if parts.is_empty() {
|
||||||
continue;
|
continue;
|
||||||
@@ -1070,12 +1071,12 @@ impl SystemdCollector {
|
|||||||
|
|
||||||
let export_path = parts[0].to_string();
|
let export_path = parts[0].to_string();
|
||||||
|
|
||||||
// Extract options from parentheses (simplified)
|
// Extract options from parentheses (from the client specification)
|
||||||
let options = if parts.len() > 1 {
|
let options = if parts.len() > 1 {
|
||||||
let opts_str = parts[1..].join(" ");
|
let client_spec = parts[1];
|
||||||
if let Some(start) = opts_str.find('(') {
|
if let Some(start) = client_spec.find('(') {
|
||||||
if let Some(end) = opts_str.find(')') {
|
if let Some(end) = client_spec.find(')') {
|
||||||
opts_str[start+1..end].to_string()
|
client_spec[start+1..end].to_string()
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
}
|
}
|
||||||
@@ -1086,9 +1087,15 @@ impl SystemdCollector {
|
|||||||
String::new()
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.push((export_path, options));
|
// Only store the first occurrence of each path (deduplicates multiple clients)
|
||||||
|
exports_map.entry(export_path).or_insert(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert HashMap to Vec
|
||||||
|
let mut exports: Vec<(String, String)> = exports_map.into_iter().collect();
|
||||||
|
// Sort by path for consistent display
|
||||||
|
exports.sort_by(|a, b| a.0.cmp(&b.0));
|
||||||
|
|
||||||
exports
|
exports
|
||||||
}
|
}
|
||||||
_ => Vec::new(),
|
_ => Vec::new(),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.271"
|
version = "0.1.272"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.271"
|
version = "0.1.272"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user