Inicio rápido
1. Obtén tu clave API
Inicia sesión en el dashboard en app.cronitorex.com → Perfil → Clave API.
2. Envía un ping
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 }'Deberías ver {"status":"success"} y el evento aparecerá en el dashboard en cuestión de segundos.
3. Envuelve un job real
#!/bin/bashAPI="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\"}"
# tu job real aquí/usr/local/bin/backup.shEXIT=$?
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}"O usa el cliente de script shell incluido.