A lightweight Go agent for monitoring system resources and log files.
π Starting Probe...
π‘ Data logging is enabled.
π¨ Alarm is armed.
π€ Probe is watching.
- 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
Follow the steps below to install and configure Probe.
- Redis:
Version >= 5.0(optional, required for data logging and alarm filtering)
Download the latest release for your platform from the GitHub Releases page.
- Go:
Version >= 1.26
- Clone the repository:
git clone git@github.com:petaki/probe.git- Build the binary:
cd probe
go build- Copy and edit the configuration:
cp .env.example .envAll configuration is done through environment variables in the .env file.
Comma-separated patterns to exclude disk partitions from monitoring:
| Pattern | Match Type |
|---|---|
PATTERN* |
Prefix |
*PATTERN |
Suffix |
*PATTERN* |
Contains |
PATTERN |
Exact |
PROBE_DISK_IGNORED=/dev,/var/lib/docker/*
PROBE_REDIS_URL=redis://127.0.0.1:6379/0
PROBE_REDIS_KEY_PREFIX=probe:
Persists collected metrics to Redis. Requires Redis to be configured.
PROBE_DATA_LOG_ENABLED=true
PROBE_DATA_LOG_TIMEOUT=2592000
Tails the last N lines of specified log files on each monitoring cycle.
PROBE_LOG_TAIL_ENABLED=false
PROBE_LOG_TAIL_FILES=/var/log/syslog,/var/log/auth.log
PROBE_LOG_TAIL_LINES=10
PROBE_LOG_TAIL_BUFFER_SIZE=4096
PROBE_LOG_TAIL_LIMIT=60
PROBE_LOG_TAIL_TIMEOUT=259200
Sends webhook notifications when a metric exceeds its threshold. Set a threshold to 0 to disable it.
PROBE_ALARM_ENABLED=false
PROBE_ALARM_CPU_PERCENT=30
PROBE_ALARM_MEMORY_PERCENT=50
PROBE_ALARM_DISK_PERCENT=80
PROBE_ALARM_LOAD_VALUE=1.0
PROBE_ALARM_WEBHOOK_METHOD=POST
PROBE_ALARM_WEBHOOK_URL=http://127.0.0.1:4000/alarm
PROBE_ALARM_WEBHOOK_HEADER='{"Authorization": "Bearer TOKEN", "Accept": "application/json"}'
The body supports the following placeholders:
| Placeholder | Description |
|---|---|
%p |
Probe name |
%n |
Watcher name |
%a |
Alarm threshold |
%u |
Current value |
%t |
Timestamp (RFC3339) |
%x |
Timestamp (Unix) |
%l |
Satellite link (relative) |
PROBE_ALARM_WEBHOOK_BODY='{"probe": "%p", "name": "%n", "alarm": %a, "used": %u, "timestamp_rfc3339": "%t", "timestamp_unix": %x, "link": "%l"}'
Reduces alarm noise by requiring sustained threshold violations before firing and enforcing a cooldown between alarms. Requires Redis to be configured.
PROBE_ALARM_FILTER_ENABLED=false
Set to 0 to disable.
PROBE_ALARM_FILTER_WAIT=5
Set to 0 to disable.
PROBE_ALARM_FILTER_SLEEP=300
go test -v ./...Collected data can be visualized with Satellite.
- @dyipon - development ideas, bug reports and testing
If you are facing a problem with this package or found any bug, please open an issue on GitHub.
The MIT License (MIT). Please see License File for more information.