tutorial

Monitoring OhMyForm with Vigilmon

OhMyForm is your self-hosted open-source form and survey builder with GDPR compliance — but Node.js process crashes, database connectivity loss, and email delivery failures are invisible without external monitoring. Here's how to monitor every critical OhMyForm component with Vigilmon.

OhMyForm is a self-hosted, GDPR-compliant form and survey builder built on Node.js, running on port 3000 by default. It handles form submissions, email notifications to respondents and administrators, file uploads, analytics aggregation, and an admin dashboard — all on your own infrastructure. When the Node.js process crashes, the database connection drops, or email delivery silently fails, form submissions are lost and survey respondents receive no confirmation. Vigilmon provides the uptime monitoring layer OhMyForm doesn't ship with, so you know about failures before your survey respondents do.

What You'll Set Up

  • Web server availability monitor (port 3000)
  • Form submission API health check
  • Email notification delivery service probe
  • Database connectivity monitor
  • File upload handling probe
  • Analytics aggregation service heartbeat
  • Admin dashboard response time monitor

Prerequisites

  • OhMyForm running and accessible on port 3000 (or your configured port)
  • Node.js process managed by PM2 or systemd
  • A free Vigilmon account

Step 1: Monitor the OhMyForm Web Server

The main application endpoint confirms the Node.js process is alive and serving requests:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your OhMyForm URL: http://YOUR_SERVER_IP:3000 or https://YOUR_DOMAIN.
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Under Response body contains, enter OhMyForm or form to confirm the correct application is responding and not an error page.
  7. Click Save.

A 502 Bad Gateway means the Node.js process has crashed and your reverse proxy (nginx, Caddy) can no longer reach it. A 503 Service Unavailable usually means the process is alive but overwhelmed. Both require immediate attention.


Step 2: Monitor the Form Submission API

The form submission API is the critical path for every response OhMyForm collects. If this endpoint breaks, all form submissions silently fail — respondents may see a success page while their data is never stored:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the API health path: http://YOUR_SERVER_IP:3000/api/v1 or http://YOUR_SERVER_IP:3000/api.
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 2 minutes.
  5. Click Save.

For a more targeted probe that validates the submission route is registered and handling requests:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter a specific form's submission endpoint: http://YOUR_SERVER_IP:3000/api/v1/forms/YOUR_FORM_ID.
  3. Set Expected HTTP status to 200.
  4. Under Response body contains, enter "title" or "fields" to confirm the form schema is returned.
  5. Set Check interval to 5 minutes.
  6. Click Save.

Use a non-critical test form's ID for this probe so production form schema reads don't generate noise in your analytics.


Step 3: Monitor Email Notification Delivery

OhMyForm sends confirmation emails to form respondents and notification emails to administrators. Email delivery failures are entirely silent — the submission is stored, but nobody receives confirmation. Set up a probe for your email transport:

For SMTP-based email delivery, probe your SMTP server's port:

  1. Click Add MonitorTCP Port.
  2. Enter your SMTP server hostname/IP.
  3. Set Port to 587 (STARTTLS) or 465 (SMTPS).
  4. Set Check interval to 5 minutes.
  5. Click Save.

Also set up a cron heartbeat that sends a test email through OhMyForm's configured transport:

#!/bin/bash
# Test SMTP connectivity from the OhMyForm server
SMTP_HOST="your-smtp-server"
SMTP_PORT=587
TIMEOUT=10

# Check if SMTP port is reachable and accepting connections
if nc -z -w "$TIMEOUT" "$SMTP_HOST" "$SMTP_PORT" 2>/dev/null; then
  curl -s https://vigilmon.online/heartbeat/YOUR_EMAIL_HEARTBEAT_ID
fi

Add a Cron Heartbeat in Vigilmon with a 10-minute interval.


Step 4: Monitor Database Connectivity

OhMyForm stores all form definitions, submissions, and user accounts in MongoDB. A lost database connection causes form submissions to fail at the persistence layer — the Node.js API may still return 200 responses while silently discarding data:

Set up a server-side database connectivity probe:

#!/bin/bash
# Test MongoDB connectivity used by OhMyForm
MONGO_STATUS=$(mongosh --quiet --eval "db.runCommand({ping:1}).ok" \
  mongodb://ohmyform_user:PASSWORD@localhost:27017/ohmyform 2>/dev/null)

if [ "$MONGO_STATUS" -eq 1 ] 2>/dev/null; then
  curl -s https://vigilmon.online/heartbeat/YOUR_DB_HEARTBEAT_ID
fi

Add a Cron Heartbeat in Vigilmon:

  1. Click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 5 minutes.
  3. Copy the heartbeat URL into the script above.
  4. Add to crontab: */5 * * * * /usr/local/bin/check-ohmyform-db.sh
  5. Click Save.

If MongoDB becomes unreachable (out of disk space, authentication failure, replica set election in progress), Vigilmon alerts after 5 minutes without a ping.


Step 5: Monitor File Upload Handling

OhMyForm supports file upload fields in forms. If the upload storage directory fills up or the multer middleware breaks, file upload submissions fail while text-only submissions continue to work — a subtle failure mode that's easy to miss:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the OhMyForm upload endpoint: http://YOUR_SERVER_IP:3000/api/v1/files.
  3. Set Method to GET.
  4. Set Expected HTTP status to 200, 401, or 404 — any response confirms the Node.js process is routing requests to the files handler.
  5. Set Check interval to 5 minutes.
  6. Click Save.

Also monitor the upload storage directory:

#!/bin/bash
# Check upload storage is writable and not critically full
UPLOAD_DIR="/path/to/ohmyform/uploads"
USAGE=$(df "$UPLOAD_DIR" | awk 'NR==2 {print $5}' | tr -d '%')

if [ "$USAGE" -lt 90 ]; then
  TEST_FILE="$UPLOAD_DIR/.vigilmon-probe"
  touch "$TEST_FILE" 2>/dev/null && rm "$TEST_FILE" 2>/dev/null
  if [ $? -eq 0 ]; then
    curl -s https://vigilmon.online/heartbeat/YOUR_UPLOAD_STORAGE_HEARTBEAT_ID
  fi
fi

Add a Cron Heartbeat with a 15-minute interval.


Step 6: Monitor Analytics Aggregation Service

OhMyForm aggregates form submission analytics for dashboard reporting. This background process runs asynchronously and can stall silently — the form submission API continues to work, but the analytics dashboard shows stale data:

#!/bin/bash
# Query OhMyForm analytics endpoint for a test form
ANALYTICS=$(curl -s -o /dev/null -w "%{http_code}" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  http://YOUR_SERVER_IP:3000/api/v1/admin/aggregate)

if [ "$ANALYTICS" -eq 200 ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_ANALYTICS_HEARTBEAT_ID
fi

In Vigilmon:

  1. Click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 30 minutes.
  3. Copy the heartbeat URL into the script.
  4. Add to crontab: */30 * * * * /usr/local/bin/check-ohmyform-analytics.sh
  5. Click Save.

Step 7: Monitor the Admin Dashboard

The admin dashboard is the primary interface for form managers and administrators. A slow or non-responsive admin panel indicates Node.js memory pressure, a slow database query, or background process interference:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter: http://YOUR_SERVER_IP:3000/admin.
  3. Set Expected HTTP status to 200 or 302 (redirect to login).
  4. Under Response time threshold, set an alert if response exceeds 2000 ms — admin dashboard slowness often precedes broader application degradation.
  5. Set Check interval to 5 minutes.
  6. Click Save.

Also monitor the Node.js process health directly using PM2's API if you use PM2:

#!/bin/bash
# Check OhMyForm PM2 process status
PM2_STATUS=$(pm2 jlist 2>/dev/null | python3 -c "
import json,sys
procs = json.load(sys.stdin)
app = next((p for p in procs if p['name']=='ohmyform'), None)
print('online' if app and app['pm2_env']['status']=='online' else 'offline')
" 2>/dev/null)

if [ "$PM2_STATUS" = "online" ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_PM2_HEARTBEAT_ID
fi

Add a Cron Heartbeat with a 2-minute interval.


Step 8: Configure Alerts and Maintenance Windows

  1. Go to Alert Channels in Vigilmon and add email, Slack, or a webhook endpoint.
  2. For the web server and form submission API monitors, set Consecutive failures before alert to 1 — any disruption immediately affects form respondents.
  3. For database and analytics monitors, set to 2 to account for brief MongoDB replication lag or scheduled index operations.
  4. For response time alerts on the admin dashboard, alert only after 3 consecutive slow responses to avoid noise from occasional slow queries.
  5. Use Maintenance windows during OhMyForm updates:
# Open a 15-minute maintenance window before updating
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "YOUR_MONITOR_ID", "duration_minutes": 15}'

# Stop, update, and restart OhMyForm
pm2 stop ohmyform
git pull && npm install --production
pm2 start ohmyform

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web server | http://HOST:3000 | Node.js process crash, port unreachable | | Form submission API | /api/v1 or specific form | Submission route broken, API error | | SMTP port | TCP port 587/465 | Email transport unavailable | | Email heartbeat | Heartbeat URL | Transient SMTP connectivity failure | | MongoDB | DB connectivity heartbeat | Database connection lost | | File upload | /api/v1/files + storage | Upload handler broken, disk full | | Analytics service | Heartbeat URL | Aggregation job stalled | | Admin dashboard | /admin response time | Application slowness, memory pressure | | PM2 process | PM2 heartbeat | Process crash not caught by HTTP monitor |

OhMyForm puts GDPR-compliant form data collection entirely in your hands — but that also means form submission failures, lost email notifications, and stale analytics are your responsibility to detect. With Vigilmon watching every layer from the Node.js process through database connectivity and email transport, you catch infrastructure failures before they become lost survey responses and unhappy respondents.

Monitor your app with Vigilmon

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

Start free →