tutorial

Monitoring Hauk with Vigilmon: Uptime & Heartbeat Alerts for Self-Hosted Location Sharing

How to monitor a self-hosted Hauk real-time location sharing server with Vigilmon — covering web server availability, PHP/nginx health, SQLite connectivity, SSL certificate alerts, and heartbeat monitoring.

Hauk is a self-hosted, open-source real-time location sharing server built on PHP and SQLite. It powers mobile apps (iOS and Android) that share live GPS position with friends and family — without routing your location through Google Maps or Apple's servers. But because Hauk runs on your own infrastructure, a crashed PHP-FPM process, a locked SQLite database, or an expired SSL certificate means the mobile apps silently stop updating. Your family loses track of your location with no warning. Vigilmon gives you external monitoring that watches Hauk from outside your server and alerts you the moment the service goes offline.

What You'll Build

  • A Vigilmon HTTP monitor on Hauk's web server endpoint
  • A keyword assertion confirming the server is genuinely responding
  • An SSL certificate expiry alert (required for mobile HTTPS connections)
  • A Vigilmon heartbeat to confirm the location sharing service stays running
  • Alert rules tuned for a real-time safety-critical service

Prerequisites

  • A running Hauk instance on PHP/Apache or PHP/Nginx
  • A domain with a valid TLS certificate (required — mobile apps reject self-signed certs)
  • A free account at vigilmon.online

Step 1: Identify Your Hauk Server URL

Hauk doesn't ship with a dedicated /health endpoint, but the root URL returns the Hauk web interface. Use that as your primary availability check.

curl -I https://your-hauk-domain.com/

A healthy Hauk server returns HTTP 200. If PHP-FPM has crashed, Nginx returns a 502 Bad Gateway. If the service is completely unreachable, the connection times out.

HTTPS is mandatory: Hauk's mobile clients connect over HTTPS. If your SSL certificate expires, the iOS and Android apps immediately stop syncing. Vigilmon's SSL monitoring is therefore critical, not optional.


Step 2: Create a Vigilmon HTTP Monitor

  1. Log in to VigilmonAdd Monitor → HTTP.
  2. URL: https://your-hauk-domain.com/
  3. Check interval: 60 seconds.
  4. Response timeout: 15 seconds (PHP startup can be slower than Node.js or Go).
  5. Expected status: 200.
  6. Click Save.

Vigilmon will probe your Hauk web server from an external location every 60 seconds. If PHP-FPM crashes, the Nginx upstream times out, or your VPS goes down, Vigilmon detects it within one to two minutes.


Step 3: Add a Keyword Assertion

A 200 status from Nginx only confirms the web server is running — not that PHP-FPM is processing requests or that Hauk's code is executing correctly. Add a keyword assertion to verify the response body:

In the monitor settings under Assertions:

  • Keyword: Hauk
  • Must be present: yes

This catches situations where Nginx returns a 200-wrapped error page, PHP-FPM returns an empty body during restart, or the document root is misconfigured and returns an unexpected page.


Step 4: Monitor SSL Certificate Expiry

This is the most operationally critical monitor for Hauk. Mobile apps use HTTPS exclusively, and an expired certificate causes silent failures — the app stops updating without a meaningful error message to the end user.

  1. Open your HTTP monitor → SSL Certificate.
  2. Enable Alert before expiry and set the threshold to 30 days (more lead time than average because mobile users may not have an easy way to debug certificate errors).

Renew with Certbot or your ACME client before the alert fires:

sudo certbot renew --quiet
sudo systemctl reload nginx

If you're using Caddy, certificate renewal is automatic. Keep the Vigilmon SSL alert as a safety net for any renewal failures.


Step 5: Set Up a Vigilmon Heartbeat

A heartbeat monitor inverts the polling model: instead of Vigilmon checking your server, your server pings Vigilmon on a schedule. If the ping stops arriving, Vigilmon alerts you. This is ideal for catching scenarios where the PHP process or SQLite becomes unresponsive without fully crashing the web server.

Create the heartbeat:

  1. In Vigilmon → Add Monitor → Heartbeat.
  2. Name: Hauk service heartbeat
  3. Expected interval: every 5 minutes.
  4. Grace period: 2 minutes.
  5. Copy the generated heartbeat URL.

Send the heartbeat from your server using cron:

# /etc/cron.d/hauk-heartbeat
*/5 * * * * www-data curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-HEARTBEAT-ID

Or, for a more robust check that also verifies SQLite is accessible:

# /etc/cron.d/hauk-heartbeat
*/5 * * * * www-data \
  php -r "try { new PDO('sqlite:/var/www/hauk/host/hauk.sq3'); echo 'ok'; } catch(Exception \$e) { exit(1); }" && \
  curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-HEARTBEAT-ID

This heartbeat only pings Vigilmon when PHP can successfully open the SQLite database. If SQLite is locked or corrupted, the heartbeat stops and Vigilmon alerts you within 7 minutes.


Step 6: Monitor the PHP-FPM Service Indirectly

Hauk's web server availability check in Step 2 covers PHP-FPM crashes indirectly (Nginx returns 502 when FPM is down), but you can also monitor the FPM status page if it's enabled:

location /fpm-status {
  fastcgi_pass unix:/run/php/php8.2-fpm.sock;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  include fastcgi_params;
  allow 127.0.0.1;
  deny all;
}

For most self-hosters, the root URL check plus the heartbeat covers the same ground without additional configuration.


Step 7: Configure Alerting

In Vigilmon under Settings → Notifications, configure your alert channels:

| Trigger | Channel | Notes | |---|---|---| | HTTP monitor returns non-200 | Email + SMS | PHP-FPM or Nginx down; restart with systemctl restart php8.2-fpm | | Response timeout (> 15 s) | Email | Server under load or SQLite lock; check top | | Keyword Hauk missing | Email | Nginx serving wrong document root | | SSL certificate expires < 30 days | Email + SMS | Mobile apps will break; renew immediately | | Heartbeat misses 2 pings | Email + SMS | Service or SQLite unresponsive; SSH in |

Alert after: 2 consecutive failures for the HTTP monitor (reduces false positives from transient network hops). Alert after 1 miss for the SSL and heartbeat monitors — those need immediate action.


What Vigilmon Catches That Server Logs Miss

| Scenario | Server logs | Vigilmon | |---|---|---| | PHP-FPM OOM crash | FPM error log | HTTP monitor fires within 60–120 s | | SQLite locked by stale process | PHP error log | Heartbeat stops; alert fires within 7 min | | SSL certificate expired | Not in web logs | SSL alert fires 30 days before expiry | | Mobile apps silently stop updating | No server-side log | HTTP monitor detects external unreachability | | VPS network partition | Logs inaccessible | External Vigilmon still detecting unreachable | | Nginx misconfiguration after update | Nginx error log | Keyword assertion catches wrong response |


Hauk is a privacy-first location sharing tool that your family or teammates depend on for real-time safety. Vigilmon adds the external visibility layer that catches outages before the people relying on your location notice the app has stopped updating.

Start monitoring your Hauk server in under 5 minutes — register free at vigilmon.online.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →