Skip to content

AFS-Agentics/svstat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svstat — Lightweight Service Status Dashboard

svstat

Simple service monitoring, zero dependencies
FeaturesQuick StartConfigurationAPIDeployment

Go version License MIT Status: Beta

svstat is a minimal, self-contained service status dashboard that monitors your HTTP and TCP services and renders a real-time status page. Written in Go with zero external runtime dependencies — just a single binary and a YAML config file.


Features

  • HTTP health checks — Monitor REST APIs, web apps, and HTTP endpoints with configurable expected status codes
  • TCP health checks — Monitor databases, caches, and raw TCP services (PostgreSQL, Redis, MySQL, etc.)
  • Real-time dashboard — Dark-themed, mobile-responsive HTML dashboard with auto-refresh every 10 seconds
  • JSON API — Machine-readable /api/status endpoint for integration with monitoring tools
  • Concurrent checks — Services are checked in parallel with configurable intervals
  • Single binary — No Node.js, no Python, no database. Just ./svstat and you're done
  • Graceful shutdown — Clean SIGINT/SIGTERM handling
  • Customizable — Configure port, services, check intervals, and timeouts

Quick Start

Download

# Clone the repo
git clone https://github.com/AFS-Agentics/svstat.git
cd svstat

# Build
go build -o svstat .

# Or run directly
go run .

Configure

Edit services.yaml with your services:

services:
  - name: "My API"
    url: "https://api.example.com/health"
    type: http
    expected_code: 200
    interval: 30
  - name: "My Database"
    url: "localhost:5432"
    type: tcp
    interval: 60
    timeout: 5

Run

# Using the default config
PORT=8080 ./svstat

# Open in browser
open http://localhost:8080

Configuration

services.yaml

Field Type Required Default Description
name string Display name for the service
url string URL (HTTP) or host:port (TCP) to check
type string http or tcp
expected_code int HTTP only 200 Expected HTTP status code
interval int no 30 Check interval in seconds
timeout int no 10 Request timeout in seconds

Environment Variables

Variable Default Description
PORT 8080 HTTP server port

API

GET /

Renders the HTML status dashboard.

GET /api/status

Returns JSON with all service statuses.

[
  {
    "name": "My API",
    "url": "https://api.example.com/health",
    "type": "http",
    "status": "up",
    "response_time_ms": 145,
    "last_checked": "2026-06-19T01:00:00Z",
    "error": ""
  }
]

Status values: up, down, checking.

GET /api/status/{name}

Returns JSON for a single service by name.

GET /health

Application health check — returns {"status": "ok"}.

Deployment

As a systemd service

[Unit]
Description=svstat Service Status Dashboard
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/svstat
Environment=PORT=8080
Restart=always
RestartSec=10
WorkingDirectory=/etc/svstat

[Install]
WantedBy=multi-user.target

Using Docker (manual)

FROM golang:1.21-alpine AS build
WORKDIR /app
COPY . .
RUN go build -o svstat .

FROM alpine:3.19
COPY --from=build /app/svstat /usr/local/bin/
COPY services.yaml /etc/svstat/
EXPOSE 8080
CMD ["svstat"]

Behind nginx

server {
    listen 80;
    server_name status.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Example: Monitoring Multiple Services

services:
  - name: "Production API"
    url: "https://api.production.com/health"
    type: http
    expected_code: 200
    interval: 15
    timeout: 5

  - name: "Staging API"
    url: "https://staging.example.com/healthz"
    type: http
    expected_code: 200
    interval: 30

  - name: "PostgreSQL"
    url: "db.internal:5432"
    type: tcp
    interval: 30
    timeout: 3

  - name: "Redis Cache"
    url: "redis.internal:6379"
    type: tcp
    interval: 60
    timeout: 2

Development

# Run tests
go test ./... -v

# Build
go build -o svstat .

# Run with race detector
go run -race .

License

MIT © AFS Agentics


Built by AFS Agentics

About

Lightweight service status dashboard — Monitor HTTP/TCP services with a real-time dashboard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors