Skip to main content

Agent

The Sentinel agent is a lightweight Go binary that runs on your servers to collect and report metrics.

Installation

curl -fsSL https://get.brainzlab.ai/sentinel | bash
This will:
  1. Detect your OS and architecture
  2. Download the appropriate binary
  3. Install to /usr/local/bin/sentinel
  4. Create a systemd service

Manual Install

Download the binary for your platform:
# Linux AMD64
wget https://releases.brainzlab.ai/sentinel/latest/sentinel-linux-amd64
chmod +x sentinel-linux-amd64
mv sentinel-linux-amd64 /usr/local/bin/sentinel

# Linux ARM64
wget https://releases.brainzlab.ai/sentinel/latest/sentinel-linux-arm64

# macOS
brew install brainzlab/tap/sentinel

Configuration

Configure the agent with your project key:
sentinel configure --key YOUR_PROJECT_KEY
Or create /etc/sentinel/config.yaml:
api_key: "YOUR_PROJECT_KEY"
api_endpoint: "https://sentinel.brainzlab.ai"

# Collection interval (default: 10s)
interval: 10s

# Host name (auto-detected if not set)
hostname: "web-1"

# Tags for grouping
tags:
  environment: production
  role: web

# Enable Docker monitoring
docker:
  enabled: true
  socket: "/var/run/docker.sock"

# Disk monitoring configuration
disk:
  # Only monitor specific mount points
  include:
    - "/"
    - "/data"
  # Exclude mount points
  exclude:
    - "/dev"
    - "/sys"

# Network interface monitoring
network:
  # Only monitor specific interfaces
  include:
    - "eth0"
    - "docker0"
  exclude:
    - "lo"

Running the Agent

Systemd (Linux)

# Start the agent
sudo systemctl start sentinel

# Enable on boot
sudo systemctl enable sentinel

# Check status
sudo systemctl status sentinel

# View logs
sudo journalctl -u sentinel -f

Manual

# Run in foreground
sentinel run

# Run as daemon
sentinel run --daemon

# Run with custom config
sentinel run --config /path/to/config.yaml

Agent Commands

# Show version
sentinel version

# Show configuration
sentinel config

# Test connection to API
sentinel ping

# Show current metrics (debug)
sentinel metrics

# Check agent health
sentinel health

Auto-Updates

The agent can auto-update itself:
# In config.yaml
auto_update:
  enabled: true
  channel: stable  # stable, beta
  check_interval: 1h
Updates are applied with zero downtime during low-activity periods.

Resource Limits

The agent is designed to be lightweight:
ResourceTypicalMax
CPU< 1%2%
Memory15MB50MB
Disk10MB20MB
Network1KB/s10KB/s

Troubleshooting

Agent Not Reporting

# Check connectivity
sentinel ping

# Check logs
sudo journalctl -u sentinel -n 50

# Verify config
sentinel config

High Resource Usage

# Check what's being collected
sentinel metrics --verbose

# Reduce collection frequency
# In config.yaml: interval: 30s

Docker Not Detected

# Check Docker socket permissions
ls -la /var/run/docker.sock

# Add sentinel to docker group
sudo usermod -aG docker sentinel
sudo systemctl restart sentinel