Skip to content

monitor Command

The monitor command wraps a command with automatic start/success/fail pings.

Terminal window
# Using slug (requires authentication)
pakyas monitor <slug> -- <command> [args...]
# Using check ID (no authentication required)
pakyas monitor --public_id <uuid> -- <command> [args...]
Terminal window
# Basic usage with slug
pakyas monitor backup-db -- ./backup.sh
# Using check ID (no API key required)
pakyas monitor --public_id "$PAKYAS_PUBLIC_ID" -- ./backup.sh
# With arguments
pakyas monitor db-sync -- pg_dump -h localhost mydb > backup.sql
# With environment variables
pakyas monitor report-gen -- env VAR=value ./generate-report.sh
  1. Sends /start ping to Pakyas
  2. Runs the command
  3. Captures exit code and stderr
  4. Sends success (/) or failure (/<exit_code>) ping
  5. Includes truncated stderr in failure payload (max 10KB)
FlagDescription
--public_id <uuid>Check public ID - skips authentication and slug resolution
--no-externalDisable external monitors
--migration-modeAllow external success to override Pakyas failure
--external-timeout-msTimeout for external monitor requests (default: 5000)
VariableDescription
PAKYAS_PUBLIC_IDCheck UUID for --public_id flag (no auth required)

The command exits with:

  • The wrapped command’s exit code (if Pakyas ping succeeded)
  • Exit code 3 if Pakyas ping failed (monitoring infrastructure failure)