monitor Command
The monitor command wraps a command with automatic start/success/fail pings.
# Using slug (requires authentication)pakyas monitor <slug> -- <command> [args...]
# Using check ID (no authentication required)pakyas monitor --public_id <uuid> -- <command> [args...]Examples
Section titled “Examples”# Basic usage with slugpakyas monitor backup-db -- ./backup.sh
# Using check ID (no API key required)pakyas monitor --public_id "$PAKYAS_PUBLIC_ID" -- ./backup.sh
# With argumentspakyas monitor db-sync -- pg_dump -h localhost mydb > backup.sql
# With environment variablespakyas monitor report-gen -- env VAR=value ./generate-report.shWhat It Does
Section titled “What It Does”- Sends
/startping to Pakyas - Runs the command
- Captures exit code and stderr
- Sends success (
/) or failure (/<exit_code>) ping - Includes truncated stderr in failure payload (max 10KB)
| Flag | Description |
|---|---|
--public_id <uuid> | Check public ID - skips authentication and slug resolution |
--no-external | Disable external monitors |
--migration-mode | Allow external success to override Pakyas failure |
--external-timeout-ms | Timeout for external monitor requests (default: 5000) |
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
PAKYAS_PUBLIC_ID | Check UUID for --public_id flag (no auth required) |
Exit Codes
Section titled “Exit Codes”The command exits with:
- The wrapped command’s exit code (if Pakyas ping succeeded)
- Exit code 3 if Pakyas ping failed (monitoring infrastructure failure)
See Also
Section titled “See Also”- External Monitors - Migration from other services
- ping Command - Manual ping sending