WP-CLI
| Command | What it does |
|---|---|
wp uptime list [--format=table|json|csv] | Every monitor with status, response time, 30-day uptime and last check |
wp uptime run [--all] | Run due checks, or every check with --all |
wp uptime check <id> | Check one monitor now |
wp uptime add <url> [--name=] [--interval=<seconds>] [--keyword=] | Add a website monitor, or a keyword monitor with --keyword |
wp uptime pause <id> / wp uptime resume <id> | Pause or resume a monitor |
wp uptime report [--period=day|week|month] [--to=<emails>] | Email a summary for yesterday, the last 7 days or last month |
REST API
Namespace sysgage-uptime/v1. Public routes are protected by a secret token or key, or are off until you switch them on. Admin routes need the plugin capability and a REST nonce.
| Route | Access | Purpose |
|---|---|---|
GET|POST /heartbeat/<token> | Secret token | Record a heartbeat ping |
GET|POST /heartbeat/<token>/fail | Secret token | Record a failure, with an optional message |
GET|POST /run?key=<key> | Secret key | Run due checks (external cron) |
GET /status | Public, when enabled | JSON status feed |
GET /badge/<id> | Public, when enabled | SVG uptime badge |
GET /series, /live | Admin | Chart data and live statuses |
POST /monitors/<id>/check, /monitors/<id>/pause, /monitors/reorder, /run-all | Admin | Check, pause or resume, reorder, check all |
POST /test, /notify-test/<channel> | Admin | Test a monitor configuration or an alert channel |
Webhook payload
The webhook channel posts JSON like this. With a secret set, the X-Sysgage-Signature header holds sha256= followed by the HMAC-SHA256 of the raw body.
{
"event": "down",
"title": "Shop checkout is DOWN",
"message": "...",
"url": "https://your-site.com/wp-admin/admin.php?page=sgu-monitors&action=view&id=3",
"site": "https://your-site.com/",
"timestamp": 1795666307,
"monitor": {
"id": 3, "name": "Shop checkout", "type": "keyword",
"target": "https://your-site.com/checkout", "status": "down",
"last_response_ms": 0, "last_code": 503
},
"facts": { "Reason": "HTTP 503 Service Unavailable" }
}
event is one of down, up, degraded, ssl, reminder, test.
Hooks
| Hook | Type | Arguments | Use |
|---|---|---|---|
sgu_capability | Filter | $cap | Capability for all screens and admin routes. Default manage_options. |
sgu_http_args | Filter | $args, $monitor | Change the request arguments of a check. |
sgu_check_result | Filter | $result, $monitor | Inspect or change a result before it is stored. |
sgu_retry_delay | Filter | $seconds, $monitor | Pause between retries. Default 2. |
sgu_run_time_budget | Filter | $seconds | Time budget per run. Default 50. |
sgu_should_alert | Filter | $send, $event, $monitor, $context | Return false to suppress an alert. |
sgu_send_channel | Filter | $sent, $channel, $message, $monitor | Deliver alerts through a custom channel. |
sgu_incident_opened | Action | $incident, $monitor | An outage starts. |
sgu_incident_resolved | Action | $incident | An incident ends. |
sgu_alert_sent | Action | $event, $monitor, $context, $results | Alerts were sent. |
sgu_monitor_saved | Action | $id, $is_new | A monitor is created or updated. |
sgu_monitor_deleted | Action | $id | A monitor is deleted. |
Example: let editors use the plugin.
add_filter( 'sgu_capability', function () {
return 'edit_others_posts';
} );
