Skip to content

About

Node JS Server Status Checker

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Server Status Monitor

A simple, standalone Node.js + Express application that monitors other services and hosts (HTTP, TCP, ICMP ping, and game servers) and displays their status in a lightweight web dashboard.

Features

  • ✅ HTTP/HTTPS checks — verifies a URL responds with the expected status code.
  • ✅ TCP checks — verifies a host:port is accepting connections.
  • ✅ ICMP ping checks — verifies a host is reachable (uses ping -n on Windows, ping -c on Unix).
  • ✅ Game server checks — queries Minecraft, Source-engine (Counter-Strike 2, CS:GO, Garry's Mod, TF2, L4D, etc.), general Steam titles (Rust, ARK, Valheim, Project Zomboid, etc.) and BYOND/SS13 servers, showing live player counts, maps, MOTD, version, gamemode and round info.
  • ✅ Lightweight dashboard — a zero-dependency frontend that auto-refreshes every 10 seconds.
  • ✅ JSON API — useful for scripting and integrations.

Requirements

Installation

cd server-monitor
npm install

Configuration

Edit servers.json to add the services you want to monitor.

{
  "checkIntervalMs": 30000,
  "timeoutMs": 5000,
  "servers": [
    { "name": "Example Website", "type": "http", "target": "https://example.com", "expectedStatusCode": 200 },
    { "name": "Google DNS", "type": "tcp", "target": "8.8.8.8", "port": 53 },
    { "name": "Cloudflare", "type": "ping", "target": "1.1.1.1" }
  ]
}

Cards can optionally show a custom caption (note) and an actionable link (link + linkLabel). When a link isn't supplied, the dashboard auto-builds a connect link for game/web targets (e.g. steam://connect/host:port, http(s)://host), so the address is openly accessible:

{
  "name": "Source - Garry's Mod",
  "type": "game",
  "game": "source",
  "target": "play.example.com",
  "port": 27015,
  "note": "Community sandbox server",
  "link": "steam://connect/play.example.com:27015",
  "linkLabel": "Connect (Steam)"
}

Game servers

To monitor a game server, use type: "game" and set a game sub-type. Game queries return live player counts, map, MOTD and version in addition to up/down status.

Minecraft (default port 25565): by default this is a simple TCP reachability check — the server counts as up if it accepts a connection on the port. Add "detailed": true to use the full Minecraft Server List Ping instead (shows player counts, MOTD, version, and only reports up when a valid status reply is received).

{
  "name": "My Minecraft Server",
  "type": "game",
  "game": "minecraft",
  "target": "play.example.com",
  "port": 25565
}
{
  "name": "My Minecraft Server",
  "type": "game",
  "game": "minecraft",
  "target": "play.example.com",
  "port": 25565,
  "detailed": true
}

Source-engine (Valve A2S_INFO over UDP — Counter-Strike 2, CS:GO, Garry's Mod, TF2, Left 4 Dead, etc., default port 27015):

{
  "name": "My CS2 Server",
  "type": "game",
  "game": "source",
  "target": "play.example.com",
  "port": 27015
}

Most Source servers share the query port with the game port, but some hosts separate the two (e.g. a query port like 27015 with a game port like 27016). Use the query port here. If a server is down, type: "tcp" with the same port is also a valid lightweight fallback.

Gamemode: A2S_INFO does not expose a dedicated gamemode field. For Garry's Mod the response's folder field (the mod directory, e.g. "garrysmod") and its game/product string (e.g. "[L] Sandbox", "TTT", "darkrp") are surfaced as gamemode and game in the status result, so the dashboard can show which gamemode is running.

General Steam (A2S_INFO over UDP — Rust, ARK, Valheim, Project Zomboid, Don't Starve Together, 7 Days to Die, etc.). Use game: "steam" with an optional steamAppId or gameKey, or simply use a Steam game keyword as the game value. Well-known default query ports are applied when port is omitted:

{
  "name": "My Rust Server",
  "type": "game",
  "game": "steam",
  "gameKey": "rust",
  "target": "play.example.com"
}
{
  "name": "My ARK Server",
  "type": "game",
  "game": "steam",
  "steamAppId": 346110,
  "target": "play.example.com"
}

A Steam game keyword can also be used directly as the game value (e.g. game: "rust", game: "tf2", game: "cs2"). Because nearly every Steam multiplayer title exposes A2S_INFO, the same generic query underlies both game: "source" and game: "steam" — the only difference is the default port lookup and surfacing the friendly game label.

BYOND / SS13 (default port 1337): by default this is a simple TCP reachability check — the server counts as up if it accepts TCP on the port. Add "detailed": true to use the world.Topic("?status") query instead (parses the SS13 topic key/value reply and surfaces players, map, mode, round — and only reports up when a valid status reply is received).

{
  "name": "My SS13 Server",
  "type": "game",
  "game": "byond",
  "target": "play.example.com",
  "port": 1337,
  "detailed": true
}

The monitor is tuned for Space Station 13 (tgstation and its derivatives). These servers answer ?status with the classic BYOND topic reply — a null-delimited set of key=value pairs (version, mode, players, round_id, map_name, station_name, host, ...) — which the monitor parses directly. Some codebases reply with JSON instead; both formats are supported. It surfaces players, mapName, round, mode, admins, version and serverName. If a server responds to the topic but the status API is disabled, the monitor reports no status data (world status API disabled?).

Options

Setting Type Description
checkIntervalMs number How often to run checks (milliseconds). Default 30000.
timeoutMs number Per-check timeout (milliseconds). Default 5000.
servers.name string Display name in the dashboard.
servers.type string http, tcp, ping, or game.
servers.target string URL, hostname, or IP. For game checks a URI scheme (e.g. byond://, steam://) and an embedded port are accepted and stripped automatically (e.g. byond://host:1337).
servers.port number Required for tcp and game checks (defaults: Minecraft 25565, Source 27015).
servers.expectedStatusCode number Expected HTTP status code (default 200).
servers.game string Game protocol for game checks: minecraft, source, steam, a Steam keyword (e.g. rust, tf2, cs2), or byond.
servers.steamAppId number Steam AppID used to pick a default query port and friendly label for game: "steam" (e.g. 252490 for Rust).
servers.gameKey string Short keyword used to pick a default query port/label for game: "steam" (e.g. "rust", "ark", "valheim").
servers.detailed boolean For minecraft/byond only. Default false = simple TCP reachability check ("does it answer on the port"). Set true to use the full protocol query (player counts, MOTD/version, map/round).
servers.note string Optional custom caption shown on the card.
servers.link string Optional URL/scheme link shown on the card. If omitted, an auto connect link is built for game/web targets.
servers.linkLabel string Optional label for the link button (e.g. Connect (Steam)).
servers.hideLink boolean Set true to hide the Connect/link button on a card. The Copy button (if any) still shows.

Running

npm start

Then open http://localhost:3002 in your browser.

For development with auto-restart:

npm run dev

API Endpoints

Method Path Description
GET /api/status Returns all current statuses as JSON.
GET /api/status/:name Returns a single server's status by name.
POST /api/refresh Forces an immediate re-check of all services.
GET / Serves the dashboard.

Example response

{
  "generatedAt": "2026-08-24T15:05:00.000Z",
  "total": 3,
  "up": 2,
  "down": 1,
  "servers": [
    {
      "name": "Example Website",
      "type": "http",
      "target": "https://example.com",
      "ok": true,
      "latencyMs": 180,
      "message": "HTTP 200",
      "checkedAt": "2026-08-24T15:05:00.000Z"
    },
    {
      "name": "Minecraft - My Server",
      "type": "game",
      "target": "play.myserver.com",
      "ok": true,
      "latencyMs": 34,
      "message": "online",
      "players": 12,
      "maxPlayers": 40,
      "motd": "Welcome!",
      "version": "1.21.1",
      "checkedAt": "2026-08-24T15:05:00.000Z"
    }
  ]
}

Project Structure

server-monitor/
├── server.js        # Express app, API and static dashboard serving
├── monitor.js       # HTTP / TCP / ping check engine + game dispatch
├── game.js          # Minecraft & Source-engine game query handlers
├── servers.json     # Config: services to monitor
├── public/          # Web dashboard
│   ├── index.html
│   ├── styles.css
│   └── app.js
├── package.json
└── README.md

License

MIT

About

Node JS Server Status Checker

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages