tutorial

Monitoring LibreTranslate with Vigilmon

LibreTranslate is a self-hosted machine translation API for privacy-sensitive text — but if translation models fail to load or the API silently exhausts CPU resources, your app stops translating. Here's how to monitor LibreTranslate with Vigilmon.

LibreTranslate is an open-source, self-hosted machine translation REST API built on Argos Translate. It supports 30+ languages and provides a privacy-preserving alternative to Google Translate, DeepL, and Amazon Translate for applications that cannot send text to external services — legal documents, confidential business communications, private health records, or enterprise CMS systems that need backend translation without data leaving your infrastructure. It runs on port 5000 by default and serves both a REST API and a browser-based web UI. But translation model loading takes time, and a CPU-exhausted or model-starved LibreTranslate instance fails silently — returning errors or timing out instead of translated text. Vigilmon keeps continuous watch on your LibreTranslate API health, translation functionality, and model availability.

What You'll Set Up

  • HTTP monitor for the LibreTranslate /languages health endpoint (port 5000)
  • Functional translation endpoint monitor via POST /translate
  • Web UI availability monitor
  • SSL certificate alerts for HTTPS reverse-proxied deployments
  • Cron heartbeat for language model availability

Prerequisites

  • LibreTranslate running (Docker, pip install, or pre-built package)
  • Translation models downloaded and loaded (check GET /languages returns non-empty)
  • A free Vigilmon account

Step 1: Monitor the LibreTranslate API Health Endpoint

The GET /languages endpoint returns a JSON array of all loaded translation languages. It's the most reliable health signal: a 200 response with a non-empty array confirms that LibreTranslate is running and that translation models have finished loading.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the URL: http://your-server:5000/languages
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Under Keyword check, enter English — the English language entry is always present when the core model is loaded.
  7. Click Save.

A healthy response looks like:

[
  {"code": "en", "name": "English"},
  {"code": "es", "name": "Spanish"},
  {"code": "fr", "name": "French"},
  ...
]

An empty array ([]) indicates LibreTranslate started but models haven't finished downloading or have been deleted from the model directory. A connection timeout typically means the process has crashed or is unresponsive under load.


Step 2: Monitor the Translation Endpoint Functionally

The /languages check confirms the server is up and models are loaded, but it doesn't confirm the translation engine itself is functional. CPU exhaustion, a corrupt model file, or an internal Argos Translate error can cause the server to respond to health checks while failing translation requests. Monitor the /translate endpoint directly.

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the URL: http://your-server:5000/translate
  3. Set Method to POST.
  4. Set Request body to:
    {"q": "hello", "source": "en", "target": "es"}
    
  5. Set Content-Type header to application/json.
  6. Set Check interval to 5 minutes — translation requests consume CPU; avoid checking too frequently.
  7. Set Expected HTTP status to 200.
  8. Under Keyword check, enter translatedText — the response JSON always contains this key on success.
  9. Click Save.

A successful translation response:

{
  "translatedText": "hola",
  "detectedLanguage": null
}

A timeout on this endpoint indicates model loading issues or resource exhaustion (CPU/memory). A 400 response indicates the requested language pair isn't available — check your installed models.

If your LibreTranslate instance requires an API key, add an Authorization header or include "api_key": "your-key" in the request body.


Step 3: Monitor the LibreTranslate Web UI

LibreTranslate ships a browser-based UI at / built with Flask templates and static assets. Monitoring it separately catches issues with static file serving or template rendering that wouldn't affect the API.

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the URL: http://your-server:5000/
  3. Set Check interval to 5 minutes.
  4. Set Expected HTTP status to 200.
  5. Under Keyword check, enter LibreTranslate — the page title always contains this.
  6. Click Save.

This monitor is useful for self-hosted deployments where end users access LibreTranslate directly via the browser UI rather than through an API client.


Step 4: SSL Certificate Alerts for HTTPS Deployments

LibreTranslate is typically reverse-proxied behind nginx when deployed in production. Applications sending text for translation need HTTPS to prevent cleartext interception of potentially sensitive content — legal filings, health records, confidential business communications.

  1. Open the HTTP monitor for your LibreTranslate URL.
  2. Enable Monitor SSL certificate under the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

A standard nginx reverse proxy configuration for LibreTranslate:

server {
    listen 443 ssl;
    server_name translate.yourdomain.com;
    ssl_certificate /etc/letsencrypt/live/translate.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/translate.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:5000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_read_timeout 120s;  # Translation can be slow for long texts
    }
}

Note the extended proxy_read_timeout — LibreTranslate translation of long documents can take 30–60 seconds under load. Set Vigilmon's request timeout to at least 30 seconds on the /translate monitor to avoid false positives on legitimate long-running translations.


Step 5: Heartbeat Monitoring for Language Model Availability

LibreTranslate downloads Argos Translate model packages (.argosmodel files) and installs them to a local directory. Models can be accidentally deleted, fail to update, or be unavailable if the model storage volume fills up. A missing model causes 400 errors for all translation requests involving that language pair.

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 60 minutes.
  3. Copy the heartbeat URL.
  4. Create a script that checks the model count and pings only when the expected languages are present:
#!/bin/bash
# /usr/local/bin/check-libretranslate-models.sh

LANGUAGES_URL="http://localhost:5000/languages"
EXPECTED_MIN=10  # Adjust to the number of languages you've installed

LANG_COUNT=$(curl -sf "$LANGUAGES_URL" | jq 'length')

if [ "${LANG_COUNT:-0}" -ge "$EXPECTED_MIN" ]; then
  curl -sf https://vigilmon.online/heartbeat/your-heartbeat-id
else
  echo "$(date): Only ${LANG_COUNT} languages available, expected ${EXPECTED_MIN}" >> /var/log/libretranslate-check.log
fi
  1. Schedule with cron:
0 * * * * /usr/local/bin/check-libretranslate-models.sh

Also monitor disk space on the model storage path — each Argos Translate model package is 100–300 MB, and a full disk prevents model downloads:

# Add to the script above
DISK_USAGE=$(df /path/to/models --output=pcent | tail -1 | tr -d ' %')
if [ "$DISK_USAGE" -gt 85 ]; then
  echo "$(date): Model disk at ${DISK_USAGE}% — risk of failed model downloads" >> /var/log/libretranslate-check.log
fi

Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or a webhook.
  2. For the /translate monitor, set Consecutive failures before alert to 2 — translation requests can occasionally time out under burst load without indicating a persistent failure.
  3. For the /languages monitor, set Consecutive failures before alert to 1 — a missing health response is always actionable.
  4. If your LibreTranslate instance is used by multiple internal applications, route alerts to a shared channel so all consumers know when translation is unavailable.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Languages health | http://server:5000/languages | Server down, no models loaded | | Translation endpoint | POST http://server:5000/translate | Engine failure, resource exhaustion | | Web UI | http://server:5000/ | Static asset or template failure | | SSL certificate | https://translate.domain.com | Expired cert on reverse proxy | | Model heartbeat | Heartbeat URL | Missing language models, disk full |

LibreTranslate gives your applications privacy-preserving machine translation without sending sensitive text to external APIs — but it requires active monitoring to catch model loading failures, CPU exhaustion, and disk space issues before they silently break every translation request in your pipeline. Vigilmon watches the API health, functional translation, and model availability so you know immediately when your translation service stops working.

Monitor your app with Vigilmon

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

Start free →