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
/-/healthendpoint - 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:
- Log in to Vigilmon and click New Monitor → HTTP.
- Set URL to
https://git.yourdomain.com/(orhttp://your-server:3000/if not proxied). - Set Check interval to 60 seconds.
- Set Expected status code to
200. - 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:
- Click New Monitor → HTTP in Vigilmon.
- Set URL to
https://git.yourdomain.com/-/health. - Set Expected status code to
200. - Under Advanced → Keyword check, configure:
- Keyword present:
OK
- Keyword present:
- 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:
- Click New Monitor → Port in Vigilmon.
- Set Host to
git.yourdomain.com. - Set Port to
22(or your configured SSH port, e.g.,2222). - Set Check interval to 60 seconds.
- 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:
- Click New Monitor → Heartbeat.
- Set Expected interval to
5 minutes. - Set Grace period to
10 minutes. - Copy the ping URL and add it to your cron job.
- 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.
- Open your web UI HTTP monitor from Step 1.
- Go to Advanced → SSL certificate monitoring.
- Enable Alert when certificate expires within and set it to
30 days. - 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.