kalakotra/silverstripe-monitoring-admin
最新稳定版本:1.0.0
Composer 安装命令:
composer require kalakotra/silverstripe-monitoring-admin
包简介
SilverStripe 6 monitoring – active pull collector and CMS admin UI
README 文档
README
Active pull collector and CMS admin interface for the SilverStripe 6 monitoring system.
It periodically pulls data from passive client endpoints.
Installation
composer require kalakotra/silverstripe-monitoring-admin vendor/bin/sake dev/build flush=1
Set Up a New Client
- On the client site, install
kalakotra/silverstripe-monitoring-client - Set
MONITORING_SECRET_KEYin the client's.env - On the admin site, open
/admin/monitoring→ Add Project - Enter:
- Title – the client name
- Endpoint URL –
https://client.example/ - Secret Key – the
MONITORING_SECRET_KEYvalue from the client's.env
- Save, then run a manual pull or wait for cron
Crontab Configuration (on the admin site)
Option A - run sake directly (recommended if you have SSH)
# Every hour - pulls data from all projects 0 * * * * /usr/bin/php /var/www/html/vendor/bin/sake dev/tasks/MonitoringPullTask >> /var/log/monitoring-pull.log 2>&1
Option B - curl the sake task URL
0 * * * * curl -s "https://admin-page.com/dev/tasks/MonitoringPullTask" > /dev/null 2>&1
Option C - cPanel Cron Jobs
| Frequency | Command |
|---|---|
| Every hour | curl -s "https://admin-page.com/dev/tasks/MonitoringPullTask" |
Note:
dev/tasksis available by default only from127.0.0.1or for admins.
For acurlrequest from an external IP, add that IP to theDevAdmin.allowed_ipsYAML configuration.
Manual Pull (for testing)
vendor/bin/sake dev/tasks/MonitoringPullTask
Status Logic
| State | Color | Condition |
|---|---|---|
| Online | green | Pull within 25h |
| Warning | yellow | Pull older than 25h and newer than 48h |
| Offline | red | Pull older than 48h or never ran |
Errors are counted in ConsecutiveErrors and shown next to the status badge as (Nx).
Collected Data
| Category | Fields |
|---|---|
| Versions | PHP, SilverStripe framework, recipe-cms |
| Content | Total pages, published, draft, broken links, DB objects, tables |
| Users | Total members, admins |
| Environment | live/dev/test, base URL, locale |
| System | Memory limit, max execution time, free/total disk |
Struktura
src/
├── Admin/
│ └── MonitoringAdmin.php # ModelAdmin – /admin/monitoring
├── Model/
│ └── Project.php # DataObject + status/disk badge
├── Service/
│ └── ProjectPullService.php # Guzzle pull logika
└── Task/
└── MonitoringPullTask.php # BuildTask for cron
_config/
└── routes.yml
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-12