tutorial

Monitoring Photoview with Vigilmon

Photoview is a self-hosted photo gallery with facial recognition, but a crashed media scanner or lost storage mount silently breaks your entire library. Here's how to monitor Photoview's availability, GraphQL API, and background services with Vigilmon.

Photoview is a self-hosted photo gallery that automatically scans your media folders, generates thumbnails, and applies facial recognition — all without cloud subscriptions or privacy compromises. But Photoview runs several interdependent services: a Go HTTP server, a GraphQL API, a PostgreSQL database, and a background media scanner. When any of these fails, your gallery becomes inaccessible or silently stops indexing new photos. Vigilmon adds external observability so you know immediately when Photoview is down or degraded.

What You'll Set Up

  • HTTP uptime monitor for the Photoview web interface
  • GraphQL API health check
  • Background media scanner heartbeat
  • SSL certificate expiry alerts
  • Storage mount availability monitoring

Prerequisites

  • Photoview installed and running (Docker Compose recommended)
  • A domain configured for your Photoview instance with HTTPS
  • At least one media library configured and scanned
  • A free Vigilmon account

Step 1: Monitor the Photoview Web Interface

The Photoview frontend is a React application served by the Go backend. An uptime check on the root URL confirms both the web server and static asset serving are functional:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Photoview URL: https://photos.yourdomain.com.
  4. Set Check interval to 5 minutes.
  5. Set Expected HTTP status to 200.
  6. Click Save.

Photoview's root path returns the React app shell. A 200 response means the Go server is running and responding to HTTP requests. Combine this with the API check in the next step for full coverage.


Step 2: Check the GraphQL API

Photoview's backend is a GraphQL API. The frontend communicates exclusively through this API — if it becomes unavailable, the UI loads but shows no photos. Add a dedicated API health check:

  1. In Vigilmon, click Add MonitorHTTP / HTTPS.
  2. Enter: https://photos.yourdomain.com/api/graphql.
  3. Set Method to POST.
  4. Set Request body to the following GraphQL introspection query (a lightweight way to confirm the API is responsive):
{"query": "{ __typename }"}
  1. Set Expected HTTP status to 200.
  2. Set Check interval to 5 minutes.
  3. Under Keyword check, enter __typename to verify the response contains a valid GraphQL response.
  4. Click Save.

The introspection query returns a minimal JSON response without loading any user data, making it an efficient health probe. If the database connection drops and GraphQL queries fail, this monitor catches it before users notice blank photo grids.


Step 3: SSL Certificate Alerts

Photoview is typically served exclusively over HTTPS — browsers block mixed content if the API is on HTTP. An expired certificate makes your entire gallery unreachable:

  1. Open the Photoview web monitor from Step 1.
  2. Enable Monitor SSL certificate.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

If you've configured multiple domains or subdomains for Photoview (e.g. a separate API subdomain), add certificate monitoring for each. A 21-day alert window gives you enough time to investigate renewal failures and manually renew before the gallery goes down.


Step 4: Media Scanner Heartbeat

Photoview's background scanner watches your media directories, detects new photos and videos, generates thumbnails, and runs facial recognition. This scanner runs as an internal goroutine with no HTTP endpoint you can probe externally — but you can monitor it with a Vigilmon heartbeat.

The scanner is triggered on startup and on a configurable periodic schedule. In a Docker Compose deployment, you can verify the scanner is running by checking the container logs or by creating a simple probe script:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set Expected ping interval to match your scan frequency (e.g. 60 minutes for an hourly scan).
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).
  4. Create a host-level cron job that pings the heartbeat after confirming the Photoview container is healthy:
# /etc/cron.d/photoview-heartbeat
0 * * * * root docker inspect --format='{{.State.Health.Status}}' photoview | grep -q healthy && curl -s https://vigilmon.online/heartbeat/abc123

This requires a Docker health check configured in your Compose file. Add one if it's missing:

services:
  photoview:
    image: viktorstrate/photoview:2
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:80/api/graphql", "--post-data", '{"query":"{ __typename }"}']
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s

With this health check in place, Docker marks the container healthy only when the GraphQL API responds. The cron job pings Vigilmon only when the container is healthy — giving you an end-to-end signal.


Step 5: Storage Mount Availability

Photoview's value depends entirely on access to your media files. If your NAS share, external drive, or network mount becomes unavailable, Photoview can still respond to HTTP requests while showing an empty or stale library. Monitor the storage mount directly:

  1. Add a cron job that checks whether your media mount point has files and pings a separate heartbeat:
# /etc/cron.d/photoview-storage
*/15 * * * * root test -d /mnt/photos && test "$(ls -A /mnt/photos)" && curl -s https://vigilmon.online/heartbeat/storage123
  1. In Vigilmon, create a second Cron Heartbeat with Expected ping interval of 30 minutes.

The test -d check confirms the mount point exists and is accessible. The ls -A check confirms it's not empty. If the NFS share unmounts or the external drive disconnects, the test fails, the heartbeat stops, and Vigilmon alerts you within 30 minutes — before you discover photos have stopped syncing.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and connect Slack, email, or a webhook.
  2. Set Consecutive failures before alert to 2 on the web and API monitors — container startup after an automatic restart takes 10–20 seconds and can cause a single probe failure.
  3. Create a Status Page in Vigilmon with all your Photoview monitors for a single-glance health view.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web UI | https://photos.yourdomain.com | Go server down, frontend unreachable | | GraphQL API | /api/graphql POST | API crash, database connection lost | | SSL certificate | Your Photoview domain | Certificate expiry, HTTPS breakage | | Scanner heartbeat | Container health check | Media scanner failure, container crash | | Storage heartbeat | Mount point file check | NAS unmount, drive disconnect |

Self-hosting Photoview keeps your family photos private and your library fast. Vigilmon keeps Photoview itself healthy — so the only surprise is who shows up in the facial recognition sidebar, not a 3am outage that wipes out your weekend photo uploads.

Monitor your app with Vigilmon

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

Start free →