Health Monitor
Manage health checks for address group members. Uses the existing Health Monitor system.
Get Health Status
curl -s https://api.1bytedns.ru/client/v1/zones/42/address_groups/5/health \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": {
"enabled": true,
"probe_type": "HTTP",
"probe_port": 80,
"probe_path": "/health",
"expected_status": 200,
"check_interval_sec": 30,
"unhealthy_threshold": 3,
"healthy_threshold": 2,
"targets": [
{
"address": "192.0.2.1",
"healthy": true,
"consecutive_ok": 5,
"consecutive_fail": 0,
"last_checked_on": "2024-06-01T10:30:00Z"
},
{
"address": "192.0.2.2",
"healthy": false,
"consecutive_ok": 0,
"consecutive_fail": 3,
"last_checked_on": "2024-06-01T10:29:50Z"
}
]
},
"errors": [],
"messages": []
}
When no config exists, returns defaults: enabled: false, check_interval_sec: 30, unhealthy_threshold: 3, healthy_threshold: 2, empty targets.
Configure Health Monitoring
curl -s -X PATCH https://api.1bytedns.ru/client/v1/zones/42/address_groups/5/health \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"probe_type": "HTTP",
"probe_port": 80,
"probe_path": "/health",
"expected_status": 200,
"check_interval_sec": 30,
"unhealthy_threshold": 3,
"healthy_threshold": 2
}' | python3 -m json.tool
Body Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
enabled | boolean | Yes | Enable/disable monitoring |
probe_type | string | Conditional | TCP, HTTP, HTTPS, ICMP (required if enabled: true) |
probe_port | int | Conditional | Port 1-65535 (required for TCP/HTTP/HTTPS; ignored for ICMP) |
probe_path | string | Conditional | URL path (HTTP/HTTPS only; ignored for TCP/ICMP) |
expected_status | int | Conditional | Expected HTTP status (HTTP/HTTPS only; ignored for TCP/ICMP) |
check_interval_sec | int | No | Check interval (default: 30) |
unhealthy_threshold | int | No | Consecutive failures to mark unhealthy (default: 3) |
healthy_threshold | int | No | Consecutive successes to mark healthy (default: 2) |
Health Check History
curl -s "https://api.1bytedns.ru/client/v1/zones/42/address_groups/5/health_checks?limit=20" \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": [
{"address": "192.0.2.1", "healthy": true, "duration_ms": 15, "error_message": null, "checked_on": "2024-06-01T10:30:00Z"},
{"address": "192.0.2.2", "healthy": false, "duration_ms": 5000, "error_message": "Connection timeout", "checked_on": "2024-06-01T10:29:50Z"}
],
"errors": [],
"messages": []
}
Failover Events
curl -s "https://api.1bytedns.ru/client/v1/zones/42/address_groups/5/failover_events?limit=20" \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": [
{
"id": 1,
"address": "192.0.2.1",
"reason": "consecutive_failures_threshold_reached",
"created_on": "2024-06-01T10:25:00Z"
}
],
"errors": [],
"messages": []
}
Health Bar
Quick health summary for UI display.
curl -s https://api.1bytedns.ru/client/v1/zones/42/address_groups/5/healthbar \
-H "Authorization: Bearer TOKEN" | python3 -m json.tool
{
"success": true,
"result": {
"healthy_count": 2,
"unhealthy_count": 1,
"total_count": 3,
"color": "yellow",
"label": "2/3 healthy"
},
"errors": [],
"messages": []
}
Color Logic:
| Color | Condition |
|---|---|
gray | 0 total members |
green | All members healthy |
red | No members healthy |
yellow | Partial (some healthy, some not) |
Members with healthy = null are counted as unhealthy (conservative approach).
Last updated: 2026-06-26