Skip to main content

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

CodeDescription
0API is healthy and accessible
1API 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:

  1. Check internet connectivity
  2. Verify firewall settings
  3. Check if proxy is configured correctly
  4. Try different network

SSL/TLS Errors

Problem: Certificate validation failures.

Solutions:

  1. Update system certificates
  2. Check system time is correct
  3. Verify no MITM proxy interference
  4. Check network security settings

"API Unavailable" Error

Problem: API returns unhealthy status.

Solutions:

  1. Check Signaloid Status Page
  2. Wait a few minutes and retry
  3. Verify using correct environment (production/staging)
  4. 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

CommandPurposeRequires Auth
healthCheck API availabilityNo
auth whoamiCheck authentication + APIYes
# 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

Learn More