This guide provides comprehensive configuration instructions for DaemonEye, covering all aspects of system setup, tuning, and customization.
Configuration Overview#
DaemonEye uses a hierarchical configuration system that allows for flexible and maintainable settings across different environments and deployment scenarios.
Configuration Philosophy#
- Hierarchical: Multiple sources with clear precedence
- Environment-Aware: Different settings for dev/staging/prod
- Secure: Sensitive settings protected and encrypted
- Validated: All configuration validated at startup
- Hot-Reloadable: Most settings can be updated without restart
Configuration Precedence#
- Command-line flags (highest precedence)
- Environment variables (component-namespaced: DAEMONEYE_AGENT_\, DAEMONEYE_CLI_\, PROCMOND_\*)
- User configuration file (\~/.config/daemoneye/config.toml)
- System configuration file (/etc/daemoneye/config.toml)
- Embedded defaults (lowest precedence)
Configuration Sources#
Command-Line Flags#
# Basic configuration
daemoneye-agent --config /path/to/config.toml --log-level debug
# Override specific settings
daemoneye-agent --scan-interval 30000 --batch-size 1000
# Show effective configuration
daemoneye-cli config show --include-defaults
Environment Variables#
# Component-namespaced variables
export DAEMONEYE_AGENT_LOG_LEVEL=debug
export DAEMONEYE_AGENT_SCAN_INTERVAL_MS=30000
export DAEMONEYE_AGENT_DATABASE_PATH=/var/lib/daemoneye/processes.db
# CLI-specific configuration
export DAEMONEYE_CLI_OUTPUT_FORMAT=json
export DAEMONEYE_CLI_CONFIG_PATH=/etc/daemoneye/config.toml
# Backward compatibility (PROCMOND_* still supported)
export PROCMOND_LOG_LEVEL=debug
daemoneye-agent
Configuration Files#
TOML Format:
[app]
scan_interval_ms = 30000
batch_size = 1000
log_level = "info"
data_dir = "/var/lib/daemoneye"
log_dir = "/var/log/daemoneye"
[database]
path = "/var/lib/daemoneye/processes.db"
max_connections = 10
retention_days = 30
[[alerting.sinks]]
type = "syslog"
enabled = true
facility = "daemon"
[[alerting.sinks]]
type = "webhook"
enabled = false
url = "https://alerts.example.com/webhook"
[alerting.sinks.headers]
Authorization = "Bearer ${WEBHOOK_TOKEN}"
Complete Configuration Schema#
Performance Tuning#
Process Collection#
# Reduce resource usage
[app]
scan_interval_ms = 60000
batch_size = 500
max_memory_mb = 256
max_cpu_percent = 3.0
Database Performance#
[database]
max_connections = 20
cache_size = -128000 # 128MB cache
temp_store = "MEMORY"
wal_mode = true
synchronous = "NORMAL"
Configuration Management#
Validation and Testing#
daemoneye-cli config validate /path/to/config.toml
daemoneye-cli config check
daemoneye-cli config show --include-defaults
daemoneye-agent --config /path/to/config.toml --dry-run
Hot Reload#
daemoneye-cli config reload
daemoneye-cli config set app.scan_interval_ms 60000
daemoneye-cli config backup --output /backup/daemoneye-config-$(date +%Y%m%d).toml
daemoneye-cli config restore --input /backup/daemoneye-config-20240101.toml
Environment-Specific Configs#
- Development: debug logging, 10s scan interval, 1 day retention, temp database
- Staging: info logging, 30s scan interval, 7 day retention
- Production: info logging, 60s scan interval, 30 day retention
Troubleshooting#
Configuration Issues#
daemoneye-cli config check
daemoneye-cli config validate
daemoneye-cli config show --errors
daemoneye-cli config show --include-defaults
Performance Issues#
- High CPU: Increase scan_interval_ms, reduce batch_size, add more exclude_patterns
- High Memory: Reduce max_memory_mb, decrease batch_size, enable garbage collection
- Slow DB: Increase cache_size, enable WAL mode, enable query optimization
This configuration guide provides comprehensive instructions for configuring DaemonEye. For additional help, consult the troubleshooting section or contact support.