Alerts
This content is for the 1.0.0 version. Switch to the latest version for up-to-date documentation.
An alert rule watches one metric on a paired PocketCmd Server and sends a push notification when the value goes above or below a threshold. The server evaluates every rule itself, so alerts arrive while the app is closed.
Alerts require PocketCmd Pro. If Pro lapses, your rules are kept and come back when Pro is active again.
Alerts work only on metrics the server collects, which are the metric commands your team approved; the server has no built-in metrics. Cards that run a shell command over SSH on a dashboard cannot carry alerts; their Configure Alert entry is disabled with the note “Only available for team server metrics”.
Add an alert
Section titled “Add an alert”- Open a dashboard and tap a card that reads a metric from a paired server.
- Choose Configure Alert.
- Enter a name (the default is the card’s label followed by “Alert”), choose Above or Below, and enter the threshold.
- Tap Add another alert for more rules on the same metric. Each metric takes up to three.
- Save.
The rules are written into the server’s monitoring configuration. On a team server you need the Add alert rules permission; admins and the owner hold it implicitly. See Teams.
The first time you save an alert, the app asks for notification permission and registers the device with the server for push. On Android this is the only time PocketCmd asks for notification permission.
How the server evaluates rules
Section titled “How the server evaluates rules”The server runs each metric command on its own interval (5 seconds to 6 hours, 30 seconds by default; see Monitoring) and checks every new sample against the metric’s rules.
| Situation | What happens |
|---|---|
| The value crosses the threshold | A push is sent, unless the same rule already sent one in the last 10 minutes |
| The value stays past the threshold | The rule sends again at most once an hour |
| The value returns to normal | The rule re-arms; the next crossing alerts again, subject to the 10-minute floor |
The 10-minute floor stops a metric that flaps around its threshold from sending a stream of notifications.
There are no severity levels. Every alert is recorded and shown the same way.
Push delivery
Section titled “Push delivery”Alerts are delivered through PocketCmd’s push relay to APNs and FCM. A device receives them once you allow notifications for PocketCmd, which the app asks for when you set up your first alert: the device then registers with the server for push. If you don’t allow notifications, nothing is sent to that device. See Monitoring.
- Each alert goes to every registered device whose user holds the Receive alerts permission for that metric.
- Push alerts are delivered to iOS and Android only. The desktop apps do not register for push.
- The notification title names the metric and the server. The body gives the measured value and the threshold.
If notifications don’t arrive, check that they are allowed for PocketCmd in the system settings and that your team role includes Receive alerts.
Rules and history
Section titled “Rules and history”Settings › Alerts & Notifications has two tabs.
Rules lists your alert rules by server. Rules whose dashboard card was deleted appear under Detached rules; they no longer fire on any card and can be deleted.
History lists the alerts this device received, newest first, with the server, metric, value and threshold. Filter by All or Unacknowledged. Tap an entry to acknowledge it, or use Acknowledge All. Clear All deletes the history. Entries older than 30 days are removed automatically.
History is per device: it records the pushes this device received, so a device without push registration shows no history.