# Know the second when a server goes down.

> Get instant push alerts when your servers go down. Connect Grafana, Prometheus, or UptimeRobot via webhook and get alerts on your phone in under a second.

<!-- source: https://pocketalert.app/use-cases/server-monitoring -->

Pocket Alert turns server monitoring alerts into push notifications on your iPhone or Android. Connect Grafana, Prometheus, UptimeRobot, or a plain cron health check to one webhook URL — alerts reach your phone in under a second, with no agent on the box and no email digest to dig through.

## Three steps to your first server alert

1. **Set up Pocket Alert** — Install the pocketalert CLI and run pocketalert auth YOUR_API_KEY, or create a webhook for forwarding.
2. **Wire up monitoring** — Add a cron health check, a Netdata custom_sender, or an Alertmanager webhook_config pointed at the receive URL.
3. **Get paged** — Trigger a test alert and your phone buzzes a moment later. Map fields to fine-tune the content.

## From metric spike to your phone

Point your monitoring at one webhook URL and every alert reaches your phone in under a second.

- **Works with your stack** — Grafana, Prometheus, UptimeRobot, Datadog, and Zabbix reach your phone once they fire a webhook.
- **Sub-second delivery** — Push arrives in under a second, ahead of the first user complaint.
- **Field mapping (GJSON)** — Map JSON payload fields to the title and message. The alert name and severity carry through to the notification.
- **Script or webhook** — A cron health check or a forwarded Alertmanager alert both reach your phone the same way.
- **Per-app channels** — Give prod, staging, and homelab their own channels.
- **No agent required** — Pocket Alert consumes the webhooks your monitoring already produces, so the monitored box runs nothing extra.

## Wire up your monitoring

### 1. A bash health check on cron

Install the CLI, authenticate once, then ping the service and push if it does not answer.

```
sudo mv pocketalert /usr/local/bin/ && chmod +x /usr/local/bin/pocketalert
pocketalert auth YOUR_API_KEY
```

```
#!/usr/bin/env bash
URL=https://api.example.com/health
if ! curl -fsS --max-time 10 "$URL" >/dev/null; then
  pocketalert send -t "API DOWN on $(hostname)" -m "$URL did not respond"
fi
```

Run it every minute from cron.

```
* * * * * /usr/local/bin/check-health.sh
```

### 2. Or a Netdata alarm hook

Add a `custom_sender()` to `health_alarm_notify.conf` (edit via `sudo ./edit-config health_alarm_notify.conf`) so every Netdata alarm posts to the messages API.

```
custom_sender() {
  curl -X POST 'https://api.pocketalert.app/v1/messages' \
    -H 'Token: YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -d "{\"title\":\"${name} is ${status} on ${host}\",\"message\":\"${chart}.${family}: ${value_string}\",\"level\":\"critical\"}"
}
```

### 3. Or forward Alertmanager via a webhook

Create a webhook on the [Webhooks](https://pocketalert.app/webhooks) page with a GJSON template, then add the receive URL to a Prometheus Alertmanager `webhook_config`.

```
curl -X POST 'https://api.pocketalert.app/v1/webhooks' \
  -H 'Token: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Alertmanager","application_id":"qm47b9pzxzxg","message":"%status%: %alerts.0.labels.alertname% — %alerts.0.annotations.summary%"}'
```

```
receivers:
  - name: pocketalert
    webhook_configs:
      - url: 'https://p4a.me/wh/1234abcd'
        send_resolved: true
```

The [docs](https://info.pocketalert.app/api/webhooks/settings.html) list the GJSON paths.

## FAQ

### How do server monitoring alerts work?

Pocket Alert gives each application an incoming webhook URL. Point a monitoring tool such as Grafana, Prometheus Alertmanager, UptimeRobot, Datadog, or Zabbix at that URL, and the alerts it fires turn into push notifications on your phone within a second.

### Can I customize the alert content?

Yes. Map fields from the incoming JSON with GJSON paths to set the notification title and message. An Alertmanager alert keeps its name, status, and severity all the way through.

### Which monitoring tools are supported?

Any tool that fires an HTTP request on an alert works: Grafana, Prometheus Alertmanager, UptimeRobot, Datadog, Zabbix, Netdata, Uptime Kuma, and custom health-check scripts.

### How do I avoid alert fatigue?

Send a push when a server drops and another when it recovers. Per-application channels separate prod, staging, and personal infra, so urgent alerts stay out of a noisy feed.

### Do I need to install an agent on my servers?

There is no agent to install. Pocket Alert receives the webhooks your monitoring already sends, so nothing extra runs on the monitored server.

### Can a server-down alert break through Do Not Disturb at night?

Yes. Send the alert with level: critical and it bypasses Do Not Disturb on Android and cuts through Focus on iPhone as a time-sensitive notification. Keep recovery messages at default — or silent — so only the outage itself makes noise. Levels go from silent (-2) to critical (2) and work in the API, in webhook payloads, and as a per-webhook default.
