tutorial

Gogs Monitoring with Vigilmon: Web UI, Health API, SSH & Database Uptime

Monitor your self-hosted Gogs Git service with Vigilmon — check web UI availability, poll the built-in health endpoint, monitor SSH server availability, verify database connectivity, and get SSL alerts.

Your team pushed a hotfix at 2 AM and the push failed with a connection refused error. Gogs had been running fine — until the PostgreSQL connection pool hit its limit after a long-running migration, and the web service started refusing new requests. The SSH port stayed open, but web operations returned 503s. Nobody found out until the morning standup.

Gogs is a self-hosted, lightweight Git service written in Go. It is fast, resource-efficient, and runs on everything from a Raspberry Pi to a production VPS. But lightweight also means you own the entire stack: the Go web server, the SSH daemon, the database (MySQL, PostgreSQL, or SQLite), and the reverse proxy. Vigilmon monitors every layer externally — no agents, no sidecars — so you know about failures before your developers do.

This tutorial sets up complete monitoring for a Gogs instance.

What You'll Build

  • A Vigilmon HTTP monitor on the Gogs web UI
  • A monitor on Gogs' built-in /-/health endpoint
  • An SSH port availability check
  • SSL certificate alerts for HTTPS deployments

Prerequisites

  • A running Gogs instance (any supported database backend)
  • A free account at vigilmon.online

Step 1: Monitor the Gogs Web UI

Gogs serves its web interface on a configurable port (default 3000, often proxied to 80/443). The root path returns the Gogs dashboard or the login page depending on configuration. A 200 response confirms the Go process and database are both healthy.

Test the endpoint:

curl -I http://your-server:3000/

Expected:

HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
x-frame-options: SAMEORIGIN

Set up the Vigilmon monitor:

  1. Log in to Vigilmon and click New Monitor → HTTP.
  2. Set URL to https://git.yourdomain.com/ (or http://your-server:3000/ if not proxied).
  3. Set Check interval to 60 seconds.
  4. Set Expected status code to 200.
  5. Save.

Step 2: Monitor the Built-In Health Endpoint

Gogs exposes a /-/health endpoint that returns a lightweight status check. This is faster and more precise than the full UI load, and it's designed specifically for uptime monitoring.

Test it:

curl https://git.yourdomain.com/-/health

Expected response:

OK

Or for newer Gogs versions, a JSON response. If the database is unreachable or the application is in a bad state, this endpoint returns a non-200 status.

Set up the health endpoint monitor:

  1. Click New Monitor → HTTP in Vigilmon.
  2. Set URL to https://git.yourdomain.com/-/health.
  3. Set Expected status code to 200.
  4. Under Advanced → Keyword check, configure:
    • Keyword present: OK
  5. Save.

This monitor is lighter than the web UI check and fires faster when the database connection pool is exhausted or the application is in a degraded state.


Step 3: Monitor SSH Availability

Git operations over SSH bypass the Gogs web server entirely. Your developers who use git@git.yourdomain.com:org/repo.git will be affected by SSH outages that the HTTP monitor completely misses. Gogs' SSH daemon listens on port 22 (or a custom port configured in app.ini).

Set up an SSH port monitor:

  1. Click New Monitor → Port in Vigilmon.
  2. Set Host to git.yourdomain.com.
  3. Set Port to 22 (or your configured SSH port, e.g., 2222).
  4. Set Check interval to 60 seconds.
  5. Save.

Vigilmon's port monitor establishes a TCP connection to confirm the SSH daemon is accepting connections. This is separate from key authentication — it confirms the port is open and the service is listening.


Step 4: Database Connectivity via the Health Endpoint

Gogs' database backend (MySQL, PostgreSQL, or SQLite) is not directly exposed, but the /-/health endpoint exercises the database connection on every request. If the database is down, the health endpoint returns a non-200 response.

For SQLite users: SQLite database file corruption or disk-full conditions cause Gogs to return 500 errors. The Step 2 health monitor catches these automatically.

For MySQL/PostgreSQL users: connection pool exhaustion returns 500s or 503s. If you want an additional database-layer check:

# On the Gogs server — PostgreSQL example
*/5 * * * * pg_isready -h localhost -U gogs && curl -fsS https://vigilmon.online/api/heartbeat/<your-heartbeat-id> > /dev/null 2>&1

Set up the heartbeat in Vigilmon:

  1. Click New Monitor → Heartbeat.
  2. Set Expected interval to 5 minutes.
  3. Set Grace period to 10 minutes.
  4. Copy the ping URL and add it to your cron job.
  5. Save.

Step 5: SSL Certificate Alerts

If Gogs is proxied behind Nginx or Caddy with a Let's Encrypt certificate, an expired certificate breaks HTTPS web access and git clone/push over HTTPS. SSH operations continue to work, but web-based operations and CI/CD pipelines using HTTPS remotes fail immediately.

  1. Open your web UI HTTP monitor from Step 1.
  2. Go to Advanced → SSL certificate monitoring.
  3. Enable Alert when certificate expires within and set it to 30 days.
  4. Save.

Step 6: Alert Channels

Go to Notifications → New Channel in Vigilmon:

  • Email — alert your team immediately
  • Webhook — post to Slack or trigger a PagerDuty incident

A typical Gogs alert:

🔴 DOWN: git.yourdomain.com/-/health
Expected keyword "OK" not found — status 503
Region: EU-West
Triggered: 2026-01-15 02:07 UTC

Recovery:

✅ RECOVERED: git.yourdomain.com/-/health
Downtime: 4 minutes

What You've Built

| Scenario | How Vigilmon catches it | |---|---| | Gogs web process crash | Web UI HTTP monitor detects non-200 or no response | | Database connection pool exhausted | Health endpoint returns 503, keyword monitor fires | | SSH daemon stopped | Port monitor on port 22 detects connection refused | | SQLite corruption / disk full | Health endpoint returns 500, monitor fires | | Reverse proxy (Nginx) down | Web UI monitor detects 502 or connection refused | | SSL certificate expiry | Certificate expiry alert fires 30 days before | | Server host offline | All monitors fire simultaneously | | Database server offline (MySQL/PG) | Health endpoint returns non-200, heartbeat stops |


Gogs' Go-native efficiency makes it ideal for resource-constrained deployments — but a single-process architecture means one failure can take down everything simultaneously. Vigilmon's multi-layer monitoring catches web, SSH, and database failures independently, so you always know exactly where the problem is.

Start monitoring your Gogs server today — register free at vigilmon.online.

Monitor your app with Vigilmon

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

Start free →