title: "Monitor nginx across multiple hosts" description: "Watch the nginx process on every web server in your fleet; alert once when any one goes missing." last_updated: "2026-05-24"

Monitor nginx across multiple hosts

You have ten web servers running nginx. If any one of them loses nginx — crashed, killed by the OOM killer, hung during a config reload — you want to know about it in Slack, fast, without setting up ten separate alerts.

This recipe wires the BoxWatch agent on each box to watch the nginx process and routes the alerts to one shared Slack channel.

What you'll end up with

  • One Slack message within roughly a minute of any host losing nginx.
  • A dashboard view of "is nginx running everywhere?" at a glance.
  • Optional: a web-tier server group to slice the dashboard.

Prerequisites

  • BoxWatch account on the Pro plan or higher. Hobby caps you at 10 watched processes per server, which is fine here, but Pro is where multi-process and group features come into their own. See plan tiers.
  • The BoxWatch agent installed on each web server. If you haven't yet, follow Installing the agent. One-liner:
    curl -fsSL https://boxwatch.app/install.sh | sudo bash -s -- YOUR_AGENT_KEY

Step 1: Add nginx as a watched process on each server

Via the dashboard

For each web server:

  1. Open the server's detail page (Dashboard → Servers → web-01).
  2. Scroll to Watched processes.
  3. Click Add process.
  4. Enter nginx as the process name. Leave CPU and memory thresholds at their defaults.
  5. Save.

That's it per server. Repeat for the other nine.

Process matching is by exact name via pgrep -x. The agent looks for a process literally called nginx — not nginx: master, not /usr/sbin/nginx. Just nginx. That's how nginx names its master process in ps, so the default works without tuning. See Process monitoring for the full matching rules.

Via the API (faster for ten boxes)

Grab an API key, then loop:

POST/servers/:id/processes
Auth: bearer
export TOKEN="bw_..."
 
for SERVER_ID in 1 2 3 4 5 6 7 8 9 10; do
  curl -fsS -X POST "https://api.boxwatch.app/servers/$SERVER_ID/processes" \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"process_name": "nginx"}'
  echo
done

The server IDs are visible in the dashboard URL (/dashboard/servers/4242) or via GET /servers. Each call returns the new watched-process row.

Step 2: Route alerts to your ops Slack

Each BoxWatch account has one Slack incoming-webhook URL. Once set, every process-down alert (and every other alert type) posts to that channel.

  1. Dashboard → Account → Notifications.
  2. Paste your Slack incoming-webhook URL (https://hooks.slack.com/services/T.../B.../...).
  3. Test to send a one-off message.
  4. Save.

Now any process_down event on any of the ten web servers becomes a Slack post.

See Slack alerts for the message format and how to scope channels per alert type.

Step 3 (bonus): group your web servers

Ten servers is the point where the flat dashboard starts to crowd. Group them:

  1. Dashboard → Servers → Groups → New group.
  2. Name it web-tier.
  3. Assign all ten web servers.
  4. Save.

Now the Servers view has a filter dropdown that scopes everything (CPU panels, process status, alert history) to that group. See Server groups.

How fast is the alert?

The agent pushes status every 60 seconds on Pro, every minute on Scale, and every 60 minutes on Hobby. So:

  • Pro/Team: alert lands in Slack within ~60-90 seconds of nginx dying.
  • Hobby: up to an hour. Not what you want here.
  • Scale: roughly the same as Pro for this kind of check, because process death is detected on the next push cycle.

The alert is sent on the state transition from updown, not on every push. Once you've been alerted, BoxWatch goes quiet until nginx comes back or you ack the alert.

What this doesn't catch

Process monitoring tells you whether nginx exists. It does not tell you whether nginx is useful. If nginx is running but returning 502s to every request, the process check stays green.

For that, layer an HTTP uptime check on the same servers — see Multi-region URL monitoring or the Uptime docs. The two together — "is the process alive?" and "does the URL return 200?" — are most of what you want from a web-tier alarm.

Common gotchas

  • The agent name doesn't match. Some distros run nginx via systemd with a wrapper that shows up in ps differently. SSH in and run pgrep -x nginx — if it returns a PID, BoxWatch will too. If not, your process name is something else (e.g. nginx: master is sometimes the visible one), and you'll need to use that exact string.
  • Flapping during reload. nginx -s reload briefly stops and restarts the master. Most of the time it's fast enough that the agent's one-minute sample catches a running process either side. If you do see false alerts during deploys, maintenance windows suppress alerts for a configured time.
  • Hobby plan won't scale here. A one-hour push cadence isn't real-time monitoring. Upgrade to Pro before you rely on this in production.
Was this page helpful?