Skip to content
cronitorex.com

Quick Start

1. Get your API key

Log in to the dashboard at app.cronitorex.com → Profile → API Key.

2. Send a ping

Terminal window
curl -X POST http://api.cronitorex.com/ping \
-H "Authorization: Bearer $CRONITOREX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event_type": "ping",
"monitor": "my-first-job",
"status": "complete",
"duration": 12.4
}'

You should see {"status":"success"} and the event appear in the dashboard within seconds.

3. Wrap a real job

#!/bin/bash
API="http://api.cronitorex.com/ping"
export CRONITOREX_API_KEY="your-api-key-here"
MON="my-backup"
curl -sf $API -H "Authorization: Bearer $CRONITOREX_API_KEY" \
-d "{\"event_type\":\"ping\",\"monitor\":\"$MON\",\"status\":\"run\"}"
# your actual job here
/usr/local/bin/backup.sh
EXIT=$?
STATUS="complete"
[ $EXIT -ne 0 ] && STATUS="fail"
curl -sf $API -H "Authorization: Bearer $CRONITOREX_API_KEY" \
-d "{\"event_type\":\"ping\",\"monitor\":\"$MON\",\"status\":\"$STATUS\",\"exit_code\":$EXIT}"

Or use the bundled shell script client.