bit-monitor-cli

CLI-based monitor for real-time test result display and remote control.

Prerequisites

The target system must be running bit-manager with Zenoh enabled:

# On the target system
bit-manager --zenoh

Environment Variables (with defaults)

  • BIT_STDOUT_LOG - Enable stdout logging (default: disabled)
  • BIT_HOSTNAME - Override hostname for remote monitoring (default: system hostname)

Usage Modes

The CLI operates in three distinct modes:

  1. Listen Mode (default): Continuously monitor test results from bit-manager
  2. Query Mode: List available tests and their enabled state, then exit
  3. Control Mode: Send control commands and optionally continue listening for results

Listen Mode

Monitor test results from a remote system:

bit-monitor-cli --hostname=<target-hostname>
bit-monitor-cli --hostname=<target-hostname> --listen

Or monitor the local system (omit --hostname to use local device):

bit-monitor-cli

Exit after all enabled tests complete (useful in scripts):

bit-monitor-cli --hostname=<target-hostname> --exit-on-complete

Query Mode

List all available tests and their enabled state:

bit-monitor-cli --hostname=<target-hostname> --list-tests

This queries bit-manager and exits immediately after displaying results.

Control Mode

Enable/Disable Tests

# Enable specific test by name
bit-monitor-cli --hostname=<target-hostname> --enable-test "CPU Cores"

# Disable specific test
bit-monitor-cli --hostname=<target-hostname> --disable-test "Temperature Monitor"

# Enable all tests of a suite
bit-monitor-cli --hostname=<target-hostname> --enable-suite CBIT

# Disable all tests of a suite
bit-monitor-cli --hostname=<target-hostname> --disable-suite PBIT

Run Tests On-Demand

# Run specific test once (marked with "manual run")
bit-monitor-cli --hostname=<target-hostname> --run-test "CPU Cores"

# Run all tests of a suite
bit-monitor-cli --hostname=<target-hostname> --run-suite PBIT

# Run only enabled tests of a suite
bit-monitor-cli --hostname=<target-hostname> --run-enabled CBIT

Command Reference

Command Description
--hostname <name> Target hostname to monitor (overrides BIT_HOSTNAME env var)
--list-tests Query available tests and their enabled state, then exit
--enable-test <name> Enable a specific test by name (persists to config)
--disable-test <name> Disable a specific test by name (persists to config)
--enable-suite <type> Enable all tests of type (PBIT, CBIT, or FBIT)
--disable-suite <type> Disable all tests of type (PBIT, CBIT, or FBIT)
--run-test <name> Run a specific test once (marked with "manual run")
--run-suite <type> Run all tests of type once (marked with "manual run")
--run-enabled <type> Run only enabled tests of type (marked with "manual run")
--listen Listen for test results continuously (default behavior)
--exit-on-complete Exit listen mode after all enabled tests report once

Examples

Monitor a Remote System

bit-monitor-cli --hostname=vehicle-ecu-1

Output:

2026-01-02 10:15:30 PBIT [PASS] CPU Cores: 4 cores detected
2026-01-02 10:15:31 PBIT [PASS] Memory Usage: Memory usage at 45%
2026-01-02 10:15:32 CBIT [PASS] Disk Usage: Disk usage at 67%
2026-01-02 10:15:33 CBIT [FAIL] Temperature Monitor: Temperature 85°C exceeds threshold

List Available Tests

bit-monitor-cli --hostname=vehicle-ecu-1 --list-tests

Output shows test names, types, and enabled state:

PBIT Tests:
  ✓ CPU Cores (enabled)
  ✓ Memory Usage (enabled)
  ✗ BSP Version (disabled)

CBIT Tests:
  ✓ Disk Usage (enabled)
  ✓ Temperature Monitor (enabled)
  ...

Disable All CBIT Tests Before Maintenance

bit-monitor-cli --hostname=vehicle-ecu-1 --disable-suite CBIT

The monitor continues running after sending the command to display acknowledgment and any subsequent results.

Run Diagnostic Test On-Demand

# Run specific test immediately
bit-monitor-cli --hostname=vehicle-ecu-1 --run-test "Temperature Monitor"

Output:

2026-01-02 10:20:15 CBIT [PASS] Temperature Monitor: Temperature 42°C within limits (manual run)

Note the "(manual run)" marker distinguishing on-demand from scheduled execution.

Enable and Run Specific Test

# Enable the test
bit-monitor-cli --hostname=vehicle-ecu-1 --enable-test "Ethernet Status"

# Run it immediately
bit-monitor-cli --hostname=vehicle-ecu-1 --run-test "Ethernet Status"

Run All Enabled FBIT Tests

bit-monitor-cli --hostname=vehicle-ecu-1 --run-enabled FBIT

This runs only the enabled FBIT tests, ignoring any that were previously disabled.

Scripted Testing with Exit on Complete

#!/bin/bash
# Run all tests and exit when complete
bit-monitor-cli --hostname=test-device --run-suite PBIT --exit-on-complete

# Check exit code
if [ $? -eq 0 ]; then
    echo "All tests completed"
fi

Remote Control Behavior

State Persistence

  • Enable/disable commands update test config.toml files on the target system
  • Changes persist across bit-manager restarts and system reboots
  • Each test's enabled state is independent and can be toggled individually

Manual Run Markers

  • Tests executed via --run-test, --run-suite, or --run-enabled show "(manual run)" in their output
  • This distinguishes on-demand execution from scheduled periodic tests
  • Manual runs do not affect the test's normal scheduling

Acknowledgments

  • Control commands use a request/acknowledgment protocol
  • The CLI waits for acknowledgment before continuing
  • Acknowledgments confirm:
    • Command was received and processed
    • Which tests were affected
    • Success or error messages

Continuous Monitoring

  • After sending control commands, the monitor continues running by default
  • Use --list-tests to query and exit immediately
  • Use --exit-on-complete in scripts to exit after all enabled tests report

Test Name Format

  • Commands use human-readable test names (e.g., "CPU Cores", "Temperature Monitor")
  • Use --list-tests to see the exact names for your system's tests
  • Names are case-sensitive and must match exactly

Troubleshooting

See Troubleshooting Guide for common monitor connectivity issues.

Next Steps