Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@rftmedia/site-monitor

Website health monitoring from your terminal. Check uptime, response time, SSL certificates, and more.

Quick Start

# Check a single URL
npx @rftmedia/site-monitor https://example.com

# Check multiple URLs
npx @rftmedia/site-monitor example.com google.com github.com

# Check URLs from a file
npx @rftmedia/site-monitor --file urls.txt

Installation

# Use directly with npx (no install needed)
npx @rftmedia/site-monitor https://your-site.com

# Or install globally
npm install -g @rftmedia/site-monitor
site-monitor https://your-site.com

Features

  • 🔍 HTTP Health Checks - Verify your sites respond with 2xx/3xx status codes
  • Response Time - Measure and enforce response time thresholds
  • 🔒 SSL Validation - Check certificate validity and expiration
  • 🔄 Automatic Retries - Handle transient failures gracefully
  • 📊 JSON Output - Parse results in scripts and CI/CD pipelines
  • 🔔 Webhook Support - Send results to Discord, Slack, or any webhook
  • CI/CD Ready - Returns appropriate exit codes for automation

Usage Examples

Basic Health Check

site-monitor https://example.com

Output:

Site Monitor CLI
Checking 1 URL(s)...

✓ https://example.com
  🟢 HTTP Status: 200
  ⚡ Response Time: 234ms
  🔒 SSL: Valid, expires in 45 days
     Issuer: Let's Encrypt

─────────────────────────────────────
Summary: 1/1 healthy
All sites healthy!

Multiple Sites

site-monitor example.com google.com github.com stripe.com

From File

Create urls.txt:

https://example.com
https://api.example.com
https://dashboard.example.com
# Comments are supported

Then:

site-monitor --file urls.txt

JSON Output (for scripting)

site-monitor https://example.com --json
{
  "timestamp": "2024-01-15T10:30:00.000Z",
  "summary": {
    "total": 1,
    "healthy": 1,
    "failed": 0
  },
  "results": [
    {
      "url": "https://example.com",
      "status": 200,
      "responseTime": 234,
      "healthy": true,
      "ssl": {
        "valid": true,
        "issuer": "Let's Encrypt",
        "daysUntilExpiry": 45
      }
    }
  ]
}

Response Time Threshold

Fail if response exceeds 500ms:

site-monitor https://example.com --max-response-time 500

Webhook Notifications

Send results to Discord:

site-monitor https://example.com --webhook https://discord.com/api/webhooks/YOUR_WEBHOOK

Send results to Slack:

site-monitor https://example.com --webhook https://hooks.slack.com/services/YOUR_WEBHOOK

In CI/CD (GitHub Actions)

- name: Check site health
  run: npx @rftmedia/site-monitor https://your-site.com --max-response-time 2000

The command exits with code 1 if any check fails, failing the pipeline.

Options

Option Short Description Default
--help -h Show help message
--version -v Show version number
--json -j Output results as JSON false
--quiet -q Minimal output (exit code only) false
--file <path> -f Read URLs from file
--timeout <sec> -t Request timeout in seconds 30
--retries <n> -r Number of retries 2
--webhook <url> -w Send results to webhook
--no-ssl Skip SSL certificate checks false
--ssl-warning-days <n> Warn if SSL expires within N days 30
--max-response-time <ms> Fail if response exceeds N ms

Exit Codes

Code Meaning
0 All checks passed
1 One or more checks failed
2 Invalid arguments or configuration error

24/7 Monitoring

This CLI is great for one-time checks and CI/CD pipelines. For continuous monitoring with dashboards and alerts, check out our full monitoring platform:

Site Monitor - Free Website Monitoring

Free tier includes:

  • 🔔 Discord, Slack, and Teams notifications
  • 📊 Public status pages
  • 🔒 SSL expiration alerts
  • ⚡ Response time tracking
  • 🔄 Automated checks every 5 minutes

Related

License

MIT © RFT Media

About

CLI for website health monitoring - check uptime, response time, SSL certificates from your terminal

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages