Configuration Reference¶
This guide explains BIT's TOML configuration format and how to customize tests for your system.
Configuration Overview¶
Each test has a TOML configuration file in /etc/bit/ that defines:
- enabled - Whether the test should run (true/false)
- frequency - How often CBIT tests run (in seconds)
- thresholds - Resource limits (CPU %, disk %, temperature)
- whitelists - Approved hardware devices (USB, PCI)
- expected_states - Interface status (network UP/DOWN, speeds)
Configuration files are named <test_name>.toml (e.g., pbit_cpu_usage.toml, cbit_memory_usage.toml).
Configuration File Structure¶
Common Fields¶
All tests have an enabled field:
CBIT (continuous) tests also have a frequency field:
Test-Specific Fields¶
Different tests require additional fields based on what they monitor:
Threshold Tests (CPU, memory, disk usage):
[pbit_cpu_usage]
enabled = true
threshold = 42 # Alert if CPU exceeds 42%
[cbit_disk_usage]
enabled = true
frequency = 30
threshold = 80 # Alert if disk exceeds 80%
Whitelist Tests (USB, PCI devices):
[pbit_usb_whitelist]
enabled = true
[[device]]
device_name = "USB Hub"
vendor_id = "1d6b"
device_id = "0002"
[[device]]
device_name = "Keyboard"
vendor_id = "046d"
device_id = "c52b"
Interface Tests (Ethernet, CAN):
[pbit_ethernet]
enabled = true
[[interface]]
name = "eth0"
expected_speed = 1000
expected_state = "up"
[[interface]]
name = "eth1"
expected_speed = 1000
expected_state = "up"
Multi-Resource Tests (Multiple disks, temperature sensors):
[cbit_disk_usage]
enabled = true
frequency = 30
[[disk]]
disk = "/dev/sda1"
threshold = 80
[[disk]]
disk = "/dev/shm"
threshold = 90
[pbit_temperature]
enabled = true
[[thermal_zone]]
label = "Core 0"
threshold = 85.0
[[thermal_zone]]
label = "Core 1"
threshold = 85.0
Modifying Configuration¶
You have two options for modifying configuration:
Option A: Edit TOML Files Manually¶
# Edit a specific test
sudo nano /etc/bit/cbit_disk_usage.toml
# Restart service to apply changes
sudo systemctl restart bit_manager
Pros: Precise control, preserves other configs
Cons: Manual editing, must know TOML format
Option B: Regenerate with bit-learn¶
Pros: Auto-detects new hardware, updates all configs
Cons: Overwrites ALL existing configuration files
⚠️ Warning: bit-learn will overwrite your manual changes. Back up configs before regenerating.
Configuration Examples¶
Adjust Threshold¶
Change when alerts trigger:
Change threshold from 80% to 90%:
Change Monitoring Frequency¶
Make tests run more or less often:
Change from every 30 seconds to every 5 minutes:
Disable a Test¶
Prevent a test from running:
Add Approved Device¶
Add a new device to whitelist:
Append new device block:
Or regenerate to auto-detect:
Configuration by Test Type¶
PBIT Tests¶
Power-on tests run once at startup. Configuration typically includes test-specific thresholds or expected values.
Examples: pbit_cpu_usage, pbit_disk_health, pbit_ethernet, pbit_usb_whitelist
CBIT Tests¶
Continuous tests run periodically. Configuration includes frequency plus test-specific settings.
Examples: cbit_memory_usage, cbit_temperature, cbit_disk_usage
FBIT Tests¶
Factory tests typically have minimal configuration:
Common Scenarios¶
False Alerts¶
If tests fail unnecessarily, increase thresholds:
Too Many Alerts¶
Reduce monitoring frequency:
Missing Hardware Test Passes¶
Tests gracefully pass when hardware isn't present:
This is normal behavior - you don't need to disable tests for missing hardware.
New Hardware Not Detected¶
After adding hardware, regenerate configs:
Or manually add to existing config files.
Next Steps¶
- Test Reference: Detailed documentation for each test's configuration options
- User Guide: Advanced test execution modes
- Troubleshooting: Solutions for configuration issues