Probe

April 28, 2026 ยท View on GitHub

A lightweight Go agent for monitoring system resources and log files.


  ๐Ÿ” Starting Probe...

  ๐Ÿ“ก Data logging is enabled.

  ๐Ÿšจ Alarm is armed.

  ๐Ÿค– Probe is watching.

Badges

Build Status License: MIT

Features

  • CPU - overall CPU usage percentage
  • Memory - overall memory usage percentage
  • Process - per-process CPU and memory usage
  • Load - system load averages (1, 5, 15 min)
  • Disk - per-partition disk usage percentage (with ignore patterns)
  • Log Tail - tail the last N lines of specified log files
  • Data Logging - persist collected metrics to Redis with configurable TTL
  • Alarms - webhook notifications when thresholds are exceeded
  • Alarm Filtering - wait and sleep intervals to reduce alarm noise
  • Console Mode - print metrics to stdout when data logging is disabled

Getting Started

Follow the steps below to install and configure Probe.

Prerequisites

  • Redis: Version >= 5.0 (optional, required for data logging and alarm filtering)

Install from Binary

Download the latest release for your platform from the GitHub Releases page.


Install from Source

Prerequisites

  • Go: Version >= 1.26

Steps

  1. Clone the repository:
git clone git@github.com:petaki/probe.git
  1. Build the binary:
cd probe
go build
  1. Copy and edit the configuration:
cp .env.example .env

Configuration

All configuration is done through environment variables in the .env file.

A โœ… marks where the variable is required.

OptionAlwaysData LogAlarmAlarm FilterLog Tail
PROBE_NAMEโœ…
PROBE_DISK_IGNOREDโœ…
PROBE_DATA_LOG_ENABLEDโœ…
PROBE_ALARM_ENABLEDโœ…
PROBE_ALARM_FILTER_ENABLEDโœ…
PROBE_LOG_TAIL_ENABLEDโœ…
PROBE_REDIS_URLโœ…โœ…
PROBE_DATA_LOG_TIMEOUTโœ…
PROBE_ALARM_CPU_PERCENTโœ…
PROBE_ALARM_MEMORY_PERCENTโœ…
PROBE_ALARM_DISK_PERCENTโœ…
PROBE_ALARM_LOAD_VALUEโœ…
PROBE_ALARM_WEBHOOK_METHODโœ…
PROBE_ALARM_WEBHOOK_URLโœ…
PROBE_ALARM_WEBHOOK_HEADERโœ…
PROBE_ALARM_WEBHOOK_BODYโœ…
PROBE_ALARM_FILTER_WAITโœ…
PROBE_ALARM_FILTER_SLEEPโœ…
PROBE_LOG_TAIL_FILESโœ…
PROBE_LOG_TAIL_LINESโœ…
PROBE_LOG_TAIL_BUFFER_SIZEโœ…
PROBE_LOG_TAIL_LIMITโœ…
PROBE_LOG_TAIL_TIMEOUTโœ…

General

Probe Name

Identifier of this probe instance. Used as the %p webhook placeholder and the Redis key prefix.

PROBE_NAME=probe

Disk Ignored

Comma-separated patterns to exclude disk partitions from monitoring:

PatternMatch Type
PATTERN*Prefix
*PATTERNSuffix
*PATTERN*Contains
PATTERNExact
PROBE_DISK_IGNORED=/dev,/var/lib/docker/*

Redis

Required when data logging or alarm filtering is enabled. Keys are prefixed with <PROBE_NAME>:.

Redis URL

PROBE_REDIS_URL=redis://127.0.0.1:6379/0

Data Log

Persists collected metrics to Redis. Requires Redis to be configured.

Data Log Enabled

PROBE_DATA_LOG_ENABLED=true

Data Log Timeout (in seconds)

PROBE_DATA_LOG_TIMEOUT=2592000

Log Tail

Tails the last N lines of specified log files on each monitoring cycle.

Log Tail Enabled

PROBE_LOG_TAIL_ENABLED=false

Log Tail Files (comma-separated)

PROBE_LOG_TAIL_FILES=/var/log/syslog,/var/log/auth.log

Log Tail Lines

PROBE_LOG_TAIL_LINES=10

Log Tail Buffer Size (in bytes)

PROBE_LOG_TAIL_BUFFER_SIZE=4096

Log Tail Limit (max entries per log file in Redis)

PROBE_LOG_TAIL_LIMIT=60

Log Tail Timeout (in seconds)

PROBE_LOG_TAIL_TIMEOUT=172800

Alarm

Sends webhook notifications when a metric exceeds its threshold. Set a threshold to 0 to disable it.

Alarm Enabled

PROBE_ALARM_ENABLED=false

Alarm CPU Percent

PROBE_ALARM_CPU_PERCENT=30

Alarm Memory Percent

PROBE_ALARM_MEMORY_PERCENT=50

Alarm Disk Percent

PROBE_ALARM_DISK_PERCENT=80

Alarm Load Value

PROBE_ALARM_LOAD_VALUE=1.0

Alarm Webhook

Alarm Webhook Method

PROBE_ALARM_WEBHOOK_METHOD=POST

Alarm Webhook URL

PROBE_ALARM_WEBHOOK_URL=http://127.0.0.1:4000/alarm

Alarm Webhook Header

PROBE_ALARM_WEBHOOK_HEADER='{"Authorization": "Bearer TOKEN", "Accept": "application/json"}'

Alarm Webhook Body

The body supports the following placeholders:

PlaceholderDescription
%pProbe name
%nWatcher name
%aAlarm threshold
%uCurrent value
%tTimestamp (RFC3339)
%xTimestamp (Unix)
%lSatellite link (relative)
PROBE_ALARM_WEBHOOK_BODY='{"probe": "%p", "name": "%n", "alarm": %a, "used": %u, "timestamp_rfc3339": "%t", "timestamp_unix": %x, "link": "%l"}'

Alarm Filter

Reduces alarm noise by requiring sustained threshold violations before firing and enforcing a cooldown between alarms. Requires Redis to be configured.

Alarm Filter Enabled

PROBE_ALARM_FILTER_ENABLED=false

Alarm Filter Wait (in minutes before first alarm)

Set to 0 to disable.

PROBE_ALARM_FILTER_WAIT=5

Alarm Filter Sleep (in seconds between alarms)

Set to 0 to disable.

PROBE_ALARM_FILTER_SLEEP=300

Testing

go test -v ./...

Data Visualization

Collected data can be visualized with Satellite.

Contributors

  • @dyipon - development ideas, bug reports and testing

Reporting Issues

If you are facing a problem with this package or found any bug, please open an issue on GitHub.

License

The MIT License (MIT). Please see License File for more information.