tutorial

Monitoring Friendica with Vigilmon

Friendica is the most protocol-compatible federated social platform — connecting to Mastodon, Diaspora, email, and more — but its PHP worker queue can stall silently. Here's how to monitor your Friendica node with Vigilmon.

Friendica is the most feature-rich open-source federated social networking platform, built with PHP and MySQL. Unlike most Fediverse software that speaks only ActivityPub, Friendica supports ActivityPub, the Diaspora protocol, DFRN, and email-style federation — enabling your node to connect with Mastodon, Diaspora pods, Pleroma instances, email users, and more from a single account. Friendica is known for its long-form post support, advanced contact management, and comprehensive privacy controls. Its PHP-based daemon worker (worker.php) processes the federation queue, media cleanup, and contact updates — and like any background worker system, it can stall after server issues without taking the web UI down. Vigilmon gives you uptime monitoring for the Friendica login page, API availability checks, NodeInfo federation endpoint monitoring, SSL certificate alerts, and heartbeat monitoring for the PHP worker daemon.

What You'll Set Up

  • HTTP uptime monitor for the Friendica login page
  • API availability check for the /api/config endpoint
  • NodeInfo federation metadata check via /nodeinfo/2.0
  • SSL certificate expiry alerts for your Friendica node
  • Heartbeat monitoring for Friendica's PHP daemon worker queue

Prerequisites

  • Friendica node running behind an Nginx or Apache reverse proxy on port 80/443
  • Access to the Friendica admin panel for API configuration
  • A free Vigilmon account

Step 1: Monitor the Friendica Login Page

The Friendica web interface serves a login page at / for unauthenticated visitors. Monitoring this URL gives you basic web server availability — confirming the PHP-FPM process pool is running and Nginx/Apache is forwarding requests.

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

Friendica returns a 200 with the login page HTML at the root path. If your node redirects unauthenticated visitors to /login, add that path explicitly:

https://friendica.yourdomain.com/login

A non-200 response here means either PHP-FPM has crashed, the database is inaccessible during page generation, or your web server configuration has broken.


Step 2: Monitor the /api/config API Endpoint

Friendica exposes a REST API compatible with the Mastodon and GnuSocial API specifications. The /api/config endpoint returns JSON configuration data about your node, including software name, version, and public settings. A successful response confirms the API layer is functional.

  1. In Vigilmon, click Add MonitorHTTP / HTTPS.
  2. Enter URL: https://friendica.yourdomain.com/api/config
  3. Set Method to GET.
  4. Set Expected HTTP status to 200.
  5. Set Expected response body contains to "friendica" (always present in the version string).
  6. Click Save.

The API endpoint requires no authentication for read-only configuration data. Slow response times here (above 2–3 seconds) often indicate a MySQL connection pool issue or a slow query on a large Friendica database.


Step 3: Monitor the /nodeinfo/2.0 Federation Metadata Endpoint

NodeInfo is a standard protocol that Fediverse servers implement to publish their software name, version, and usage statistics. Other federated servers query /nodeinfo/2.0 to discover how to federate with your node. If this endpoint is broken, remote servers may fail to establish new federation connections with your node.

  1. In Vigilmon, click Add MonitorHTTP / HTTPS.
  2. Enter URL: https://friendica.yourdomain.com/nodeinfo/2.0
  3. Set Method to GET.
  4. Set Expected HTTP status to 200.
  5. Set Expected response body contains to "friendica" (present in the software.name field of the NodeInfo response).
  6. Click Save.

A working NodeInfo response looks like this:

{
  "version": "2.0",
  "software": {
    "name": "friendica",
    "version": "2024.03"
  },
  "protocols": ["activitypub", "diaspora", "dfrn"],
  "usage": { ... }
}

If this endpoint fails while the login page is working, the issue is likely in Friendica's routing layer or a misconfigured .htaccess / Nginx location block for the NodeInfo path.


Step 4: SSL Certificate Alerts

Friendica nodes should always run over HTTPS — Friendica federates cryptographically signed ActivityPub activities, and an expired certificate will cause other servers to reject all incoming and outgoing federation with your node, immediately silencing you across the Fediverse.

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

Federation breakage from an expired SSL certificate is especially damaging for Friendica nodes because Friendica supports multiple federation protocols — an expired cert can simultaneously break ActivityPub, Diaspora, and DFRN federation. A 21-day alert window gives you enough time to investigate and renew before any federation is affected.


Step 5: Heartbeat Monitoring for the PHP Worker Queue

Friendica uses a PHP-based daemon worker (worker.php) to process all background tasks: federation delivery, incoming activity processing, media cleanup, and contact profile updates. If the daemon stalls or exits unexpectedly, your Friendica node continues serving the web UI normally while federation silently stops. Posts you write won't be delivered to followers on other servers, and posts from contacts on remote servers won't arrive.

Friendica provides an admin API for worker queue monitoring. Use it in a heartbeat script:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 30 minutes (Friendica's daemon processes batches roughly every few minutes, but a 30-minute window catches persistent stalls without being too noisy).
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).

Create a heartbeat script that checks the admin worker queue endpoint before pinging Vigilmon:

#!/bin/bash
# /usr/local/bin/friendica-heartbeat.sh
# Check Friendica admin worker queue and ping Vigilmon if healthy

FRIENDICA_URL="https://friendica.yourdomain.com"
ADMIN_TOKEN="your-friendica-admin-token"
HEARTBEAT_URL="https://vigilmon.online/heartbeat/abc123"

# Query the admin workerqueue endpoint
RESPONSE=$(curl -sf \
  -H "Authorization: Bearer ${ADMIN_TOKEN}" \
  "${FRIENDICA_URL}/api/admin/workerqueue" 2>/dev/null)

# Ping Vigilmon only if we got a valid response
if echo "${RESPONSE}" | grep -q '"total"'; then
  curl -s "${HEARTBEAT_URL}"
fi

Schedule the script with cron:

# /etc/cron.d/friendica-heartbeat
# Run every 30 minutes
*/30 * * * * www-data /usr/local/bin/friendica-heartbeat.sh

If the admin API is unreachable or returns an unexpected response, the heartbeat ping is suppressed and Vigilmon alerts after 30 minutes.

Alternatively, you can check the Friendica process directly by verifying the worker daemon PID file exists and the process is running:

#!/bin/bash
# Simpler variant: check that the Friendica worker daemon is running
if pgrep -f "php.*worker.php" > /dev/null; then
  curl -s https://vigilmon.online/heartbeat/abc123
fi

Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add your preferred channel: email, Slack, Discord webhook, or PagerDuty.
  2. Set Consecutive failures before alert to 2 on the web UI monitor — PHP-FPM can briefly spike during high-load conditions and recover without intervention.
  3. Set Consecutive failures before alert to 1 on the NodeInfo monitor — a failed NodeInfo check directly impacts other servers' ability to federate with you.
  4. Use Maintenance windows in Vigilmon during Friendica upgrades, which may involve database migrations requiring a brief maintenance mode.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Login page | https://friendica.yourdomain.com/ | PHP-FPM crash, MySQL down | | API config | /api/config (GET) | API layer failure, slow DB queries | | NodeInfo | /nodeinfo/2.0 (GET) | Federation discovery broken | | SSL certificate | Friendica domain | Let's Encrypt renewal failure | | Cron heartbeat | Heartbeat URL | PHP worker daemon stall, queue backlog |

Friendica's multi-protocol federation capability — spanning ActivityPub, Diaspora, DFRN, and email — makes it the most interoperable node you can run in the Fediverse. With Vigilmon watching the web UI, API endpoints, NodeInfo metadata, SSL certificate, and PHP worker daemon, you get comprehensive observability across all the systems that keep your Friendica node connected to the wider federated social web.

Monitor your app with Vigilmon

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

Start free →