tutorial

Monitoring FreePBX and Asterisk with Vigilmon

FreePBX powers thousands of business phone systems — but a silent Asterisk crash or expired admin certificate can take down your entire VoIP operation. Here's how to monitor FreePBX web GUI availability, Asterisk SIP health, and cron heartbeats with Vigilmon.

FreePBX is the browser-based management layer that makes Asterisk approachable for businesses — extensions, IVR menus, ring groups, voicemail, and CDR all configured through a PHP/Apache web GUI. But self-hosting your PBX means you own the uptime. When Asterisk crashes, callers hit silence. When the admin certificate expires, remote administration is locked out. When backup cron jobs stop running silently, the next hardware failure becomes a data-loss event. Vigilmon monitors all three failure planes independently: the FreePBX web UI, the Asterisk SIP daemon, and the background job scheduler.

What You'll Set Up

  • HTTP uptime monitor for the FreePBX admin web interface
  • Keyword check on the FreePBX login page to confirm the PHP app is serving correctly
  • TCP probe to Asterisk SIP port 5060 for independent daemon health monitoring
  • TCP probe to Asterisk HTTP/WebSocket ports 8088/8089 for WebRTC application health
  • SSL certificate expiry alerts for HTTPS FreePBX deployments
  • Cron heartbeat for FreePBX backup and scheduled job health

Prerequisites

  • FreePBX installed on Linux (CentOS/AlmaLinux or Debian/Ubuntu) with Asterisk running
  • FreePBX web GUI accessible on port 80 or 443
  • A free Vigilmon account

Step 1: Monitor the FreePBX Web GUI

The FreePBX web interface runs on Apache and PHP. A 200 or 302 response on port 80/443 confirms Apache is running and PHP is loading. Add the base URL monitor first:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your FreePBX URL: http://pbx.yourdomain.com (or https:// if using TLS).
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200 or 302 (FreePBX root redirects to /admin/config.php).
  6. Click Save.

This catches Apache crashes and network-level failures, but it won't tell you whether the PHP application itself is healthy.


Step 2: Keyword-Monitor the FreePBX Admin Login Page

A redirect to /admin/config.php that returns a blank page or PHP error is indistinguishable from a healthy page using status-code-only monitoring. Add a second monitor that fetches the login page and checks for FreePBX-specific content:

  1. Click Add MonitorHTTP / HTTPS.
  2. URL: http://pbx.yourdomain.com/admin/config.php
  3. Set Check interval to 2 minutes.
  4. Enable Keyword check and enter FreePBX (or Powered by) as the expected keyword.
  5. Click Save.

This confirms the correct PHP application is running and not serving a generic error page. If a FreePBX module upgrade breaks the admin panel, the keyword check catches it when a status-code check would still return 200.


Step 3: TCP Probe the Asterisk SIP Port (5060)

The FreePBX web UI and the Asterisk SIP daemon are independent processes. The web GUI can be healthy while Asterisk has crashed — callers experience silence but the admin dashboard looks fine. Add an independent SIP port check:

  1. Click Add MonitorTCP Port.
  2. Enter your FreePBX server's IP or hostname.
  3. Set Port to 5060.
  4. Set Check interval to 1 minute.
  5. Click Save.

A TCP probe to port 5060 confirms Asterisk is accepting connections. Because SIP uses UDP by default, a TCP probe to 5060 tests the dual-stack listener that Asterisk opens when tcpenable=yes is set in sip.conf or pjsip.conf. If your installation uses UDP-only SIP, use the port 5060 probe as an early-warning signal and validate with a full SIP OPTIONS ping from a separate monitoring tool.


Step 4: Monitor Asterisk HTTP and WebSocket Ports (8088/8089)

WebRTC softphone integrations (Zoiper, Jitsi, FreePBX's own UCP phone) use Asterisk's built-in HTTP server on ports 8088 (HTTP) and 8089 (HTTPS/WSS). These run as part of the asterisk process but are configured separately from Apache. Add monitors for each port your WebRTC clients use:

  1. Click Add MonitorTCP Port.
  2. Hostname: your FreePBX server IP or hostname.
  3. Port: 8088 (HTTP WebSocket).
  4. Interval: 2 minutes.
  5. Click Save.

Repeat for port 8089 if you use WSS (secure WebSocket) for WebRTC clients. A TCP connection to 8088/8089 confirms Asterisk's HTTP server module (res_http.so) is loaded and listening — a different failure mode from the SIP stack.


Step 5: SSL Certificate Alerts for HTTPS FreePBX

FreePBX admin should be HTTPS-only in production — an expired certificate locks out remote administration and breaks any WebRTC clients that require a valid TLS connection. Add a certificate expiry monitor:

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

A 21-day window gives you time to investigate Let's Encrypt renewal failures (port 80 challenge blocks are common on PBX servers with aggressive firewall rules) and manually renew before the certificate expires. If you use a commercial certificate, extend the window to 30 days to account for procurement lead time.


Step 6: Heartbeat Monitoring for FreePBX Backups and Cron Jobs

FreePBX relies on Linux cron for scheduled backups, CDR log cleanup, and module update checks. A misconfigured cron or a failed backup job produces no alert — the job simply stops running. Set up a Vigilmon heartbeat to monitor cron health:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Name it FreePBX Backup Heartbeat.
  3. Set the expected ping interval to match your backup schedule (e.g., 1440 minutes for daily backups).
  4. Copy the heartbeat URL (e.g., https://vigilmon.online/heartbeat/abc123).

Add the curl ping to your FreePBX backup script. If you use the FreePBX Backup & Restore module's pre/post-backup hooks, add it to the post-backup script:

#!/bin/bash
# FreePBX post-backup hook script
# Place in: /var/lib/asterisk/scripts/post_backup.sh

# Signal successful backup completion to Vigilmon
curl -s --max-time 10 https://vigilmon.online/heartbeat/abc123

For a general cron-level heartbeat that monitors all FreePBX cron jobs, add the ping at the end of /etc/cron.d/freepbx:

# /etc/cron.d/freepbx
*/5 * * * * asterisk /usr/sbin/fwconsole job --run 2>&1 | /usr/bin/logger -t freepbx_cron
0 3 * * * asterisk /usr/sbin/fwconsole backup --id=1 && curl -s https://vigilmon.online/heartbeat/abc123

If the backup fails (non-zero exit from fwconsole backup), the && prevents the curl ping — Vigilmon alerts after the expected interval passes.


Step 7: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add email, Slack, or a webhook receiver.
  2. For the SIP TCP monitor, set Consecutive failures before alert to 1 — an Asterisk crash is an immediate production issue and should page on-call immediately.
  3. For the web GUI monitor, set Consecutive failures before alert to 2 to absorb brief Apache restarts during module upgrades.
  4. Use Maintenance windows in Vigilmon during FreePBX version upgrades (major Asterisk upgrades restart both Apache and Asterisk and will trigger multiple monitors simultaneously):
# Before upgrading FreePBX
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "YOUR_MONITOR_ID", "duration_minutes": 30}'

Summary

| Monitor | Target | What It Catches | |---|---|---| | HTTP availability | http(s)://pbx.domain.com | Apache crash, network failure | | Keyword check | /admin/config.php — "FreePBX" | PHP application error, broken module | | TCP port 5060 | FreePBX server | Asterisk SIP daemon crash | | TCP port 8088/8089 | FreePBX server | Asterisk HTTP/WebSocket failure | | SSL certificate | HTTPS admin URL | Certificate expiry, renewal failure | | Cron heartbeat | Backup heartbeat URL | Backup job failure, cron misconfiguration |

FreePBX gives you enterprise PBX capabilities on commodity hardware — but self-hosting means phone system reliability is your responsibility. With Vigilmon monitoring the web GUI, the Asterisk daemon, and the backup scheduler independently, you get early warning across all three failure planes before callers experience dropped calls or before a hardware failure finds you without a recent backup.

Monitor your app with Vigilmon

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

Start free →