Scripts2026年4月17日·1 分钟阅读

Healthchecks — Cron Job Monitoring with Smart Alerts

Healthchecks is a self-hosted cron job and scheduled task monitor that alerts you when your periodic jobs fail to run on time.

Introduction

Healthchecks is a cron job monitoring service that listens for HTTP pings from your scheduled tasks and alerts you when pings are overdue. Each check gets a unique URL that your cron jobs hit upon completion. If a ping does not arrive within the expected interval, Healthchecks sends alerts through email, Slack, PagerDuty, or 25+ other integrations.

What Healthchecks Does

  • Monitors cron jobs and scheduled tasks by tracking periodic HTTP or email pings
  • Sends alerts via email, Slack, Telegram, PagerDuty, Opsgenie, and 25+ channels
  • Supports cron expression schedules with grace periods for flexible timing
  • Provides a dashboard showing check status with uptime history and response times
  • Measures job execution duration when start and success pings are both sent

Architecture Overview

Healthchecks is a Django application with a PostgreSQL or MySQL database backend. A background worker process monitors check deadlines and dispatches alert notifications. The ping endpoint is optimized for high throughput with minimal overhead. The web dashboard uses server-side rendering with progressive JavaScript enhancements for real-time status updates.

Self-Hosting & Configuration

  • Deploy via Docker with environment variables for SECRET_KEY and database connection
  • Configure SMTP settings for email alerts and add integration webhooks in the UI
  • Set ALLOWED_HOSTS and SITE_ROOT for proper URL generation behind a reverse proxy
  • Use PostgreSQL for production or SQLite for small deployments
  • Enable Prometheus metrics endpoint for monitoring Healthchecks itself

Key Features

  • 25+ notification channels including Slack, Telegram, Discord, PagerDuty, and webhooks
  • Cron expression and interval-based scheduling with configurable grace periods
  • Job duration measurement by tracking start and completion pings
  • Badge API for embedding status indicators in README files and dashboards
  • Team management with projects and read-only access for stakeholders

Comparison with Similar Tools

  • Uptime Kuma — Monitors service availability; Healthchecks monitors job execution schedules
  • Cronitor — Commercial SaaS; Healthchecks is fully open source and self-hostable
  • Dead Man's Snitch — SaaS cron monitor; Healthchecks offers the same model for free self-hosted
  • Grafana Alerting — Metric-based alerts; Healthchecks uses a simpler ping-based dead man's switch
  • Gatus — HTTP endpoint monitoring; Healthchecks focuses on periodic job completion tracking

FAQ

Q: How do I integrate with an existing cron job? A: Append a curl command to your cron entry: && curl -fsS http://hc-host/ping/uuid. The check turns red if the ping stops arriving.

Q: Can it monitor jobs that run on different servers? A: Yes. Each check has a unique ping URL accessible from anywhere. Jobs on any server can ping the same Healthchecks instance.

Q: Does it support measuring how long a job takes? A: Yes. Send a start ping before the job and a success ping after. Healthchecks calculates and displays the duration.

Q: What happens during Healthchecks downtime? A: Missed pings are not recorded. When Healthchecks comes back, overdue checks will trigger alerts based on their last known ping time.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产