Configure Project Alert Rules
Command
Section titled “Command”php artisan uplinkr:project:alertsDescription
Section titled “Description”Updates alert settings for a project. This command allows you to configure when and how alerts are triggered based on probe failures and slow responses.
Options
Section titled “Options”| Option | Type | Required | Default | Description |
|---|---|---|---|---|
--project | string | Yes | - | Name of the project to update alert settings |
--enabled | boolean | No | true | Enable or disable alerts (true/false) |
--failures | integer | Yes | - | Trigger alert after X consecutive failures |
--cooldown | integer | Yes | - | Cooldown period in minutes before triggering another alert |
--threshold | integer | Yes | - | Latency threshold in milliseconds (responses slower than this are considered “slow”) |
--slow | integer | Yes | - | Trigger alert after X consecutive slow responses |
--channels | string | Yes | - | Comma-separated list of notification channels |
--force | flag | No | - | Force execution without confirmation |
Usage Examples
Section titled “Usage Examples”Configure basic alert settings
Section titled “Configure basic alert settings”php artisan uplinkr:project:alerts \ --project=my-project \ --failures=3 \ --cooldown=30 \ --threshold=2000 \ --slow=5 \ --channels=mail,logDisable alerts for a project
Section titled “Disable alerts for a project”php artisan uplinkr:project:alerts \ --project=my-project \ --enabled=false \ --failures=3 \ --cooldown=30 \ --threshold=2000 \ --slow=5 \ --channels=mailForce mode (skip confirmation)
Section titled “Force mode (skip confirmation)”php artisan uplinkr:project:alerts \ --project=my-project \ --failures=3 \ --cooldown=30 \ --threshold=2000 \ --slow=5 \ --channels=mail \ --forceAlert Configuration Explained
Section titled “Alert Configuration Explained”- failures: Number of consecutive failed probes before triggering an alert
- cooldown: Minimum time (in minutes) between alerts for the same issue
- threshold: Response time (in ms) that defines a “slow” response
- slow: Number of consecutive slow responses before triggering an alert
- channels: Laravel notification channels to use (e.g., mail, slack, discord)
Behavior
Section titled “Behavior”- Validates all required parameters
- Prompts for confirmation unless
--forceis used - Updates the project’s alert configuration in settings.json
- All numeric values must be at least 1
Return Codes
Section titled “Return Codes”0(SUCCESS): Alert settings updated successfully1(INVALID): Validation failed or process was aborted2(FAILURE): Failed to update alert settings