The nself health command provides comprehensive health check management for your ɳSelf infrastructure. Monitor service health, check endpoints, and track health history.
Check overall system health (default command).
nself health # Check all services
nself health check # Same as above
# Output:
# ➞ Service Health
#
# Service Status Time Details
# ------- ------ ---- -------
# postgres ✓ healthy 12ms Container healthy
# hasura ✓ healthy 8ms Container healthy
# auth ✓ healthy 15ms Container healthy
# nginx ● running 3ms No health check defined
#
# ➞ Endpoint Health
#
# Endpoint Status Time HTTP
# -------- ------ ---- ----
# api healthy 45ms HTTP 200
# auth healthy 32ms HTTP 200
#
# ➞ Summary
# Healthy: 4/4
#
# ✓ All services healthyCheck specific service health.
nself health service <name>
# Examples
nself health service postgres # Check PostgreSQL
nself health service hasura # Check Hasura
nself health service auth # Check auth serviceCheck custom endpoint health.
nself health endpoint <url>
# Example
nself health endpoint https://api.example.com/healthContinuous health monitoring.
nself health watch # Monitor every 10s
nself health watch --interval 5 # Monitor every 5s
# Press Ctrl+C to stopShow health check history.
nself health history # Recent history
nself health history --limit 50 # Last 50 checks
# Output:
# Health History (last 24h)
# ========================
# TIME SERVICE STATUS LATENCY
# 2026-01-23 10:30 postgres healthy 2ms
# 2026-01-23 10:00 postgres healthy 3ms
# 2026-01-23 09:30 postgres healthy 2ms
# ...Show health check configuration.
nself health config # Current settings| Option | Description | Default |
|---|---|---|
| --timeout N | Health check timeout (seconds) | 30 |
| --interval N | Check interval for watch mode | 10 |
| --retries N | Number of retries on failure | 3 |
| --env NAME | Check health in specific environment | current |
| --json | Output in JSON format | false |
| --quiet | Only output on failure | false |
| State | Icon | Description |
|---|---|---|
| healthy | ✓ | Service is healthy |
| running | ● | Running without health check defined |
| starting | ○ | Health check pending |
| unhealthy | ✗ | Health check failed |
| stopped | - | Container not running |
| not_found | - | Container does not exist |
nself health --json
# Output:
{
"timestamp": "2026-01-23T10:30:00Z",
"healthy": 4,
"unhealthy": 0,
"total": 4,
"services": [
{"service": "postgres", "status": "healthy", "response_time_ms": 12}
]
}| Variable | Description | Default |
|---|---|---|
| HEALTH_TIMEOUT | Default timeout (seconds) | 30 |
| HEALTH_RETRIES | Default retries | 3 |
| HEALTH_INTERVAL | Default interval (seconds) | 10 |
# Quick health check
nself health
# Check specific service
nself health service postgres
# Continuous monitoring
nself health watch --interval 5
# Check staging environment
nself health --env staging
# JSON output for tooling
nself health --json
# Quiet mode (only show failures)
nself health --quiet| Subcommand | Description |
|---|---|
| check | Run all health checks (default) |
| service <name> | Check specific service |
| endpoint <url> | Check custom endpoint |
| watch | Continuous monitoring |
| history | Check history |
| config | Health configuration |