Skip to Content
🎉 EZMON v0.1.19 is released. Visit ezmon.web.id →
InstallationEvaluator Setup (Cron)

Evaluator Setup (Cron)

Starting with EZMON v0.1.14+, the backend evaluator architecture has been consolidated directly into the Next.js Serverless API Route (/api/internal/evaluate). This eliminates the need to manage separate Cloudflare Worker infrastructure.

The Evaluator executes the following critical background tasks every 1 minute:

  1. Agent Offline Detection: Checks offline_deadline_at and creates open incidents when agents pass their deadline.
  2. Agent Recovery Detection: Automatically resolves open incidents when agents recover online.
  3. Cloud Monitors Evaluation: Evaluates HTTP, SSL/TLS, and Keyword endpoints in parallel.
  4. Automated Retention Cleanup: Purges aged records (metric_buckets > 7 days, alert_events > 7 days, cloud_check_results > 30 days).

🔒 Evaluator Authentication

The evaluator endpoint is protected using the CRON_SECRET secret key set in your Next.js Hub environment variables. Incoming requests must supply the authorization header:

Authorization: Bearer YOUR_CRON_SECRET

🛠️ Cron Job Setup Options

Choose one of the periodic trigger methods below:

Setup via cron-job.org

  1. Create a free account at cron-job.org .
  2. Create a New Cronjob:
    • URL: https://your-hub.vercel.app/api/internal/evaluate
    • Execution Schedule: Every 1 minute (* * * * *)
    • HTTP Method: POST
  3. Add a Header under the Advanced section:
    • Key: Authorization
    • Value: Bearer YOUR_CRON_SECRET

🧪 Verifying the Evaluator

You can verify whether the evaluator is functioning correctly by issuing a manual cURL request:

curl -X POST https://your-hub.vercel.app/api/internal/evaluate \ -H "Authorization: Bearer YOUR_CRON_SECRET"

Successful Response (200 OK):

{ "ok": true, "evaluatedAgents": 5, "newOfflineCount": 0, "recoveredCount": 0, "cloudChecksEvaluated": 3 }

If you receive a 401 Unauthorized status, ensure your cURL Authorization header matches the CRON_SECRET environment variable configured on Vercel.

Last updated on