Remove hardcoded defaults, require configuration file
- Remove all Default implementations from agent configuration structs - Make configuration file required for agent startup - Update NixOS module to generate complete agent.toml configuration - Add comprehensive configuration options to NixOS module including: - Service include/exclude patterns for systemd collector - All thresholds and intervals - ZMQ communication settings - Notification and cache configuration - Agent now fails fast if no configuration provided - Eliminates configuration drift between defaults and NixOS settings
This commit is contained in:
@@ -128,8 +128,19 @@ impl SystemdCollector {
|
||||
.arg("--plain")
|
||||
.output()?;
|
||||
|
||||
// Also get user unit files (user-level services)
|
||||
let user_unit_files_output = Command::new("systemctl")
|
||||
// Get hostname to determine which user to check
|
||||
let hostname = gethostname::gethostname().to_string_lossy().to_string();
|
||||
let target_user = match hostname.as_str() {
|
||||
"steambox" | "cmbox" => "cm",
|
||||
"simonbox" => "simon",
|
||||
_ => "cm", // default to cm for unknown hosts
|
||||
};
|
||||
|
||||
// Also get user unit files (user-level services) for target user
|
||||
let user_unit_files_output = Command::new("sudo")
|
||||
.arg("-u")
|
||||
.arg(target_user)
|
||||
.arg("systemctl")
|
||||
.arg("--user")
|
||||
.arg("list-unit-files")
|
||||
.arg("--type=service")
|
||||
@@ -137,8 +148,11 @@ impl SystemdCollector {
|
||||
.arg("--plain")
|
||||
.output()?;
|
||||
|
||||
// And user loaded units
|
||||
let user_units_output = Command::new("systemctl")
|
||||
// And user loaded units for target user
|
||||
let user_units_output = Command::new("sudo")
|
||||
.arg("-u")
|
||||
.arg(target_user)
|
||||
.arg("systemctl")
|
||||
.arg("--user")
|
||||
.arg("list-units")
|
||||
.arg("--type=service")
|
||||
|
||||
Reference in New Issue
Block a user