signaloid-cli health
Check Signaloid API connectivity and status.
Synopsis
signaloid-cli health
Description
The health command checks connectivity to the Signaloid API and returns the service status. Use this to verify your network connection, API availability, and troubleshoot connectivity issues.
Usage
signaloid-cli health
Output
Success:
{
"status": "ok",
"timestamp": "2025-01-13T12:00:00Z",
"version": "1.0.0",
"region": "us-east-1"
}
Failure:
Error: Unable to connect to Signaloid API
Exit Codes
| Code | Description |
|---|---|
0 | API is healthy and accessible |
1 | API is unreachable or unhealthy |
Examples
Basic Health Check
signaloid-cli health
Use in Scripts
#!/bin/bash
if signaloid-cli health > /dev/null 2>&1; then
echo "✓ Signaloid API is healthy"
else
echo "✗ Signaloid API is unreachable"
exit 1
fi
Pre-flight Check
#!/bin/bash
# Check connectivity before running tasks
echo "Checking Signaloid API..."
if ! signaloid-cli health; then
echo "Error: Cannot connect to Signaloid API"
echo "Please check your network connection and try again"
exit 1
fi
echo "✓ API is healthy"
echo "Proceeding with operations..."
# Rest of script...
Monitor API Status
#!/bin/bash
# Continuous health monitoring
while true; do
if signaloid-cli health > /dev/null 2>&1; then
echo "$(date): API healthy"
else
echo "$(date): API unreachable - sending alert"
# Send alert (email, webhook, etc.)
fi
sleep 60
done
Health Check with Timeout
#!/bin/bash
echo "Checking API health..."
if timeout 10 signaloid-cli health; then
echo "API responded within timeout"
else
echo "API health check timed out or failed"
exit 1
fi
Troubleshooting
Connection Timeout
Problem: Health check times out without response.
Solutions:
- Check internet connectivity
- Verify firewall settings
- Check if proxy is configured correctly
- Try different network
SSL/TLS Errors
Problem: Certificate validation failures.
Solutions:
- Update system certificates
- Check system time is correct
- Verify no MITM proxy interference
- Check network security settings
"API Unavailable" Error
Problem: API returns unhealthy status.
Solutions:
- Check Signaloid Status Page
- Wait a few minutes and retry
- Verify using correct environment (production/staging)
- Contact support if persistent
Integration Examples
CI/CD Pipeline
# GitHub Actions example
- name: Check Signaloid API Health
run: |
if ! signaloid-cli health; then
echo "API health check failed"
exit 1
fi
Docker Healthcheck
FROM node:18
# Install Signaloid CLI
RUN npm install -g @signaloid/signaloid-cli
# Configure healthcheck
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD signaloid-cli health || exit 1
Kubernetes Liveness Probe
livenessProbe:
exec:
command:
- signaloid-cli
- health
initialDelaySeconds: 10
periodSeconds: 30
Comparison with Other Checks
health vs auth whoami
| Command | Purpose | Requires Auth |
|---|---|---|
health | Check API availability | No |
auth whoami | Check authentication + API | Yes |
# Check API is up (no auth required)
signaloid-cli health
# Check auth AND API (requires valid credentials)
signaloid-cli auth whoami
health vs ping
# API-level health check
signaloid-cli health
# Network-level connectivity (if supported by API)
ping api.signaloid.io
Exit Code Usage
#!/bin/bash
signaloid-cli health
EXIT_CODE=$?
case $EXIT_CODE in
0)
echo "API is healthy"
# Proceed with operations
;;
1)
echo "API is unhealthy or unreachable"
# Handle error
exit 1
;;
*)
echo "Unexpected exit code: $EXIT_CODE"
exit 1
;;
esac
See Also
- signaloid-cli auth - Verify authentication
Learn More
- Signaloid Status - Service status page
- API Documentation - Complete API reference