Vespid Agent

Full-spectrum system telemetry & synthetic monitoring

A high-performance Rust daemon that collects system metrics from /proc, runs synthetic HTTP/TCP/ICMP/DNS/SSL checks from worker nodes, watches logfile patterns with regex, and executes custom scripts — all reported to the Nest dashboard in real time.

~15 MBRust binary
12Collectors
5Check types
0Dependencies
vespid-agent status
────────────────── Vespid Agent ──────────────────

  agent_id  a1b2c3d4-e5f6-7890-abcd-ef1234567890
  version   1.1.0
  hostname  web-01  |  uptime  14d 7h 33m

  Collectors
    ▸ cpu       12 cores  user=23%  sys=8%  iowait=1%
    ▸ memory    32GB total  11GB used  21GB avail
    ▸ disk      4 mounts  /data=45%  /var=62%
    ▸ network   eth0: 1.2 GB sent  3.8 GB recv
    ▸ systemd   128 units  126 active  2 inactive
    ▸ process   342 total  2 zombie  12 sleeping
    ▸ psi       cpu avg10=0.42  mem avg10=0.01  io avg10=0.88
    ▸ loadavg   1m=0.42  5m=0.38  15m=0.35
    ▸ swap      2GB total  0.2GB used  10%

  Shipping
    metrics enqueued  12,847
    shipped           12,801
    spooled           0
System Metrics

Every metric that matters, straight from /proc

No agents within agents. No plugins. No dependencies beyond the Linux kernel. Vespid Agent reads everything it needs from the proc filesystem.

CPU

Source: /proc/stat

Per-core user, system, iowait, idle, and steal time. Aggregate totals across all cores. All values in seconds total since boot for accurate delta calculation.

user system iowait steal

Memory

Source: /proc/meminfo

Total, available, used, buffers, cached, and swap memory. Both raw bytes and percentage-based metrics for easy dashboarding.

total available used_pct cached

Disk

Source: /proc/self/mountinfo + statvfs + /proc/diskstats

Per-filesystem total, used, and available space plus inode counts. Per-device read/write byte counts, I/O operations, and I/O time for throughput monitoring.

used_bytes used_pct inodes_pct io_time

Network

Source: /proc/net/dev + /sys/class/net/*/speed

Per-interface bytes sent/received, packets sent/received, errors, and drops. Interface speed detection for utilization percentage calculation.

bytes_sent bytes_recv errors util_pct

Process

Source: /proc/*/stat

Process counts by state (running, sleeping, zombie, stopped). Top-N processes by CPU delta ticks and resident memory size for resource hogs.

by_state top_cpu top_mem zombie

PSI — Pressure Stall Information

Source: /proc/pressure/{cpu,memory,io}

Linux PSI metrics tracking resource contention before it impacts applications. Avg10, avg60, avg300, and total stall times for CPU, memory, and I/O at both full and some pressure levels.

cpu_avg10 mem_avg60 io_total

Load Average

Source: /proc/loadavg

Standard 1-minute, 5-minute, and 15-minute load averages. Also reads the number of currently running and total processes for context.

load1 load5 load15

Swap

Source: /proc/meminfo

Swap total, free, used, and cached in both bytes and percentage. Essential for detecting swap thrashing before it impacts application performance.

total used used_pct cached

Procfs Scraper

Define custom metrics from any /proc or /sys path using config-driven scraping strategies: value (single numeric), first_field (first whitespace-delimited token), line_count (line count), or snmp (SNMP-style key: value pairs). No code changes needed.

Prometheus Exposition Format

All metrics use the vespid_monitor_* naming convention and are shipped in Prometheus exposition format via Snappy-compressed protobuf to the Nest server. Full Grafana and Prometheus ecosystem compatibility.

Service Monitoring

systemd unit health monitoring

Know the health of every systemd service on every node — instantly.

Full Unit Enumeration

Vespid Agent monitors all systemd service units on the host by running systemctl list-units at configurable intervals. Reports active/inactive state and sub-state (running, exited, dead, failed) for every unit.

  • All units monitored by default
  • Configurable watch list for targeted alerting
  • Sub-state granularity (running vs dead vs failed)
  • Instant visibility from Nest dashboard

Alerting Integration

When a watched unit enters a failed or inactive state, an alert is triggered through the Nest alerting pipeline. Configure alert rules for any combination of service name and state.

  • Per-unit alert rules from Nest
  • Slack, email, PagerDuty, webhook delivery
  • Escalation policies for critical services
  • Maintenance windows to suppress planned downtime
Synthetic Monitoring

Proactive checks from worker nodes

Validate your services from the outside. Vespid Agent's worker mode runs synthetic checks from distributed nodes and reports results to the Nest dashboard.

Agents run in either system mode (metrics + checks) or dedicated worker mode (checks only). Worker-mode agents register with the Nest server, poll for assigned jobs, execute them concurrently (semaphore-limited), and post results back. The server handles scheduling, load balancing, timeout management, and reassignment of failed checks.

HTTP / HTTPS

GET, POST, PUT, DELETE, PATCH

Full multi-step HTTP checks that follow redirects, validate status code ranges, match response body content, set custom headers, and measure response times. Supports cookie persistence across steps and environment variable resolution in URLs and headers.

  • Multi-step workflows
  • Status code range matching
  • Body content validation
  • Max duration enforcement

TCP Port Check

TCP connect

Tests TCP port reachability by initiating a connection to the specified host and port. Configurable connect time threshold. Essential for validating database ports, message queues, and internal services.

  • Port parsing from URL
  • Connect time threshold
  • IPv4 and IPv6 support

ICMP Ping

ICMP echo

Measures network latency and packet loss by executing ping -c 1. Parses round-trip time from output and compares against configurable max RTT threshold. Gateway and external connectivity validation.

  • RTT parsing from ping output
  • Max RTT threshold
  • Packet loss detection

DNS Resolution

DNS query

Resolves domain names via dig +short and validates the answer count or specific expected values. Detects DNS failures, misconfigurations, and poisoning attempts.

  • Answer count validation
  • Expected IP matching
  • DNS server targeting

SSL / TLS Certificate

OpenSSL s_client

Checks SSL/TLS certificate validity by connecting via openssl s_client. Reports subject, issuer, validity dates, days remaining until expiry, and chain validation status.

  • Days-to-expiry tracking
  • Chain validation
  • Subject/issuer extraction
  • Alert before expiry

Distributed Worker Architecture

Worker agents register with a 30-second heartbeat loop. The Nest server's check scheduler assigns due jobs to eligible workers, handles timeouts, and reassigns to other nodes on failure. Workers can be deployed across different geographic regions or network segments for comprehensive external monitoring. Each worker reports its capabilities (check types supported) and current load for intelligent scheduling.

Log Monitoring

Logfile pattern watching with regex

Tail any log file, match patterns with regex, and trigger alerts when suspicious content appears.

How it works

Vespid Agent tails log files using efficient file-watching with rotation detection. Each watch is configured with a name, file path, regex pattern, and optional alert-on-match flag. When a line matches the pattern, a metric counter is incremented and the watch state transitions to "matched." If the pattern stops matching, the state auto-clears back to "clean."

Key capabilities

  • Regex pattern matching on arbitrary log files
  • Auto-clear when patterns stop matching
  • File position persistence across restarts
  • Log rotation and truncation detection
  • Local config or server-pushed watch definitions
  • Alert webhook integration via Nest
agent.yaml — logfile watches
# Logfile watch configuration
collectors:
  logfile:
    enabled: true
    state_path: /var/lib/vespid-agent/logfile_state.json
    watches:
      - name: nginx_errors
        path: /var/log/nginx/error.log
        pattern: 'PHP Fatal error|Stack trace:|Segmentation fault'
        alert_on_match: true

      - name: auth_failures
        path: /var/log/auth.log
        pattern: 'Failed password|authentication failure'
        alert_on_match: true
Custom Scripts

Custom exec scripts — Nagios-style checks

Run arbitrary commands or scripts on a schedule and report results to Nest.

Flexible script execution

Define scripts with a name, command, optional timeout, and schedule. Scripts can be configured locally in agent.yaml or pushed from the Nest dashboard. Results — exit code, stdout, stderr, and duration — are shipped to Nest for alerting and historical tracking.

What you can monitor

  • Custom application health endpoints
  • Database replication lag checks
  • Backup completion verification
  • Certificate expiry beyond TLS checks
  • License file validity
  • Any Nagios-style plugin
  • Custom Docker container health checks
agent.yaml — exec scripts
# Custom exec script configuration
collectors:
  exec:
    enabled: true
    scripts:
      - name: mysql_replication
        command: /usr/lib/nagios/plugins/check_mysql_replication.sh
        timeout_secs: 30

      - name: cert_check
        command: openssl s_client -connect api.example.com:443
          < /dev/null 2>&1 | openssl x509 -noout -enddate
        timeout_secs: 15

      - name: backup_age
        command: find /backups -name 'daily.sql.gz' -mtime -1 | grep .
Operating Modes

Two modes, one binary

Run the same binary in either mode. No recompile, no configuration change beyond a flag.

system

System Mode

Full metrics collection mode. Runs all enabled collectors (CPU, memory, disk, network, systemd, process, PSI, loadavg, swap, logfile, procfs, exec) and ships metrics to the Nest server at configurable intervals. Also capable of running synthetic checks alongside metrics collection.

worker

Worker Mode

Dedicated synthetic check execution mode. Registers with the Nest server, reports capabilities and labels, and polls for assigned jobs. Ideal for deploying lightweight check-only agents across different network segments or geographic regions without the overhead of full metrics collection.

Offline buffering

When the Nest server is unreachable, metrics are buffered to disk as JSONL files in /var/lib/vespid-agent/buffer/. Rolling files capped at configurable max size with FIFO eviction. On reconnect, buffered metrics are replayed in order before new collection resumes. The same enrollment flow used by the Shield agent handles credential provisioning and automatic key rotation on 401 responses.

Get Started

Install in under a minute

Single Rust binary. Zero runtime dependencies. ~15 MB on disk.

Install Vespid Agent

# Add the Vespid package repository once:
# https://www.vespid.app/#get-started

# RHEL / AlmaLinux / Rocky
sudo dnf install vespid-agent

# Debian / Ubuntu
sudo apt update
sudo apt install vespid-agent

# Configure /etc/vespid-agent/agent.yaml
server:
  url: "https://nest.example.com"
  api_key: "your-api-key"

# Start in system mode (metrics + checks)
sudo systemctl enable --now vespid-agent

# Or start in worker mode (checks only)
sudo vespid-agent --mode worker --config /etc/vespid-agent/agent.yaml

Requirements

Linux kernel 4.20+
systemd (recommended)
Non-root operation supported
Nest server for metrics shipping