mindtwo/server-monitoring
Composer 安装命令:
composer create-project mindtwo/server-monitoring
包简介
Standalone server-level monitoring for the mindtwo monitoring suite: Docker, load and system metrics with cron push and a signed pull endpoint — no host application required.
README 文档
README
Standalone server-level monitoring of the mindtwo suite — a self-contained PHP project that
runs directly on a host, no application integration required. On top of
mindtwo/base-monitoring (OS, web server,
database, Node.js, system stats, Composer/npm packages, audits, git) it adds:
- Docker Engine version detection,
- load averages and uptime,
- a tiny CLI (
bin/monitor) for cron-driven pushes and local inspection, - a single-file pull endpoint (
public/index.php) serving signed snapshots atGET /api/m2-monitoring.
Installation
git clone https://github.com/mindtwo/server-monitoring /opt/mindtwo/server-monitoring cd /opt/mindtwo/server-monitoring composer install --no-dev cp .env.example .env # add MONITORING_PROJECT_KEY + MONITORING_SECRET
Scheduled push (cron)
0 3 * * * /usr/bin/php /opt/mindtwo/server-monitoring/bin/monitor push >> /var/log/mindtwo-monitoring.log 2>&1
See crontab.example.
Pull endpoint (optional)
Point a vhost/subdomain document root at public/ — requests to
GET /api/m2-monitoring are answered with the snapshot after IP allow-list, configuration
and HMAC signature checks (same protocol as the whole suite: signature over
"{timestamp}.{raw body}", 300 s replay window).
CLI
monitor push [--dry-run] Build and deliver a snapshot (cron this daily)
monitor show Human-readable snapshot overview
monitor snapshot [--compact] Print the snapshot JSON
monitor collectors List collectors and their support status
Configuration (.env)
Real environment variables always win over .env file values.
| Variable | Default | Purpose |
|---|---|---|
MONITORING_PROJECT_KEY |
– | Project key from the dashboard |
MONITORING_SECRET |
– | Shared secret (never transmitted) |
MONITORING_ENDPOINT |
central endpoint | Push target |
MONITORING_ENVIRONMENT |
production |
Reported environment |
MONITORING_IP_ALLOW_LIST |
– | Comma-separated IPs / CIDR ranges for pull |
MONITORING_ROUTE_ENABLED |
true |
Serve the pull endpoint |
MONITORING_SIGNATURE_TOLERANCE |
300 |
Signature timestamp window (seconds) |
MONITORING_TIMEOUT |
15 |
Push timeout (seconds) |
MONITORING_PROJECT_ROOT |
project dir | Where lockfiles/git are inspected |
Development
composer install
composer check # pint --test + phpstan (level 8, PHP 8.0 mode) + pest
Security
If you discover a security issue, please email info@mindtwo.de instead of opening a public issue.
License
The MIT License (MIT). See LICENSE.md.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-15