- Add detached mode for long-running processes via detached=true config - Fix process termination on timeout using process groups and kill -TERM/-KILL - Remove double shell wrapping that was breaking command execution - Track PIDs via wrapper script to enable proper process cleanup - Flush port messages after timeout to prevent Tortoise MQTT errors - Update example config to demonstrate detached command usage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
116 lines
3.2 KiB
Plaintext
116 lines
3.2 KiB
Plaintext
# Systant Configuration Example
|
|
# Copy to systant.toml and customize for your environment
|
|
|
|
[general]
|
|
enabled_modules = ["cpu", "memory", "disk", "gpu", "network", "temperature", "processes", "system"]
|
|
collection_interval = 30000 # milliseconds
|
|
startup_delay = 5000 # milliseconds
|
|
|
|
[mqtt]
|
|
host = "localhost" # MQTT broker hostname/IP
|
|
port = 1883 # MQTT broker port
|
|
client_id_prefix = "systant" # Prefix for MQTT client ID
|
|
username = "" # MQTT username (optional)
|
|
password = "" # MQTT password (optional)
|
|
qos = 0 # MQTT QoS level
|
|
|
|
# Home Assistant MQTT Discovery Configuration
|
|
[homeassistant]
|
|
discovery_enabled = true # Enable/disable HA auto-discovery
|
|
discovery_prefix = "homeassistant" # HA discovery topic prefix
|
|
|
|
[cpu]
|
|
enabled = true
|
|
|
|
[memory]
|
|
enabled = true
|
|
show_detailed = true
|
|
|
|
[disk]
|
|
enabled = true
|
|
include_mounts = [] # Only include these mounts (empty = all)
|
|
exclude_mounts = ["/snap", "/boot", "/dev", "/sys", "/proc", "/run", "/tmp"]
|
|
exclude_types = ["tmpfs", "devtmpfs", "squashfs", "overlay"]
|
|
min_usage_percent = 1 # Minimum usage to report
|
|
|
|
[gpu]
|
|
enabled = true
|
|
nvidia_enabled = true
|
|
amd_enabled = true
|
|
max_gpus = 8
|
|
|
|
[network]
|
|
enabled = true
|
|
include_interfaces = [] # Only include these interfaces (empty = all)
|
|
exclude_interfaces = ["lo", "docker0", "br-", "veth", "virbr"]
|
|
min_bytes_threshold = 1024 # Minimum traffic to report
|
|
|
|
[temperature]
|
|
enabled = true
|
|
cpu_temp_enabled = true
|
|
sensors_enabled = true
|
|
temp_unit = "celsius"
|
|
|
|
[processes]
|
|
enabled = true
|
|
max_processes = 10
|
|
sort_by = "cpu" # "cpu" or "memory"
|
|
min_cpu_percent = 0.0
|
|
min_memory_percent = 0.0
|
|
max_command_length = 50
|
|
|
|
[system]
|
|
enabled = true
|
|
include_uptime = true
|
|
include_load_average = true
|
|
include_kernel_version = true
|
|
include_os_info = true
|
|
|
|
[commands]
|
|
enabled = true
|
|
timeout_seconds = 30
|
|
log_executions = true
|
|
|
|
# Example commands - customize for your needs
|
|
[[commands.available]]
|
|
trigger = "restart"
|
|
command = "systemctl"
|
|
allowed_params = ["nginx", "apache2", "docker", "ssh"]
|
|
description = "Restart system services"
|
|
|
|
[[commands.available]]
|
|
trigger = "info"
|
|
command = "uname"
|
|
allowed_params = ["-a"]
|
|
description = "Show system information"
|
|
|
|
[[commands.available]]
|
|
trigger = "df"
|
|
command = "df"
|
|
allowed_params = ["-h", "/", "/home", "/var", "/tmp"]
|
|
description = "Show disk usage"
|
|
|
|
[[commands.available]]
|
|
trigger = "ps"
|
|
command = "ps"
|
|
allowed_params = ["aux", "--sort=-pcpu", "--sort=-pmem"]
|
|
description = "Show running processes"
|
|
|
|
[[commands.available]]
|
|
trigger = "ping"
|
|
command = "ping"
|
|
allowed_params = ["-c", "4", "8.8.8.8", "google.com", "1.1.1.1"]
|
|
description = "Network connectivity test"
|
|
|
|
# Example of a detached command for long-running processes
|
|
[[commands.available]]
|
|
trigger = "start_app"
|
|
command = "firefox"
|
|
detached = true # Don't wait for the process to exit, just launch it
|
|
timeout = 5 # Timeout only applies to launching, not running
|
|
description = "Start Firefox browser (detached)"
|
|
|
|
[logging]
|
|
level = "info" # debug, info, warn, error
|
|
log_config_changes = true
|
|
log_metric_collection = false |