server_stats
Fetch a snapshot of the server’s health: how long it has run, how much disk and memory it uses, and how many accounts it stores. Use it for an admin dashboard.
Request
Section titled “Request”{ "cmd": "server_stats"}No fields besides cmd.
Response
Section titled “Response”{ "cmd": "server_stats", "uptime": 86400, "storage": { "channels": 5242880, "users": 20480, "config": 2048, "threads": 1048576 }, "storage_total": 6313984, "channels": { "general": { "bytes": 4194304, "messages": 18250 }, "announcements": { "bytes": 1048576, "messages": 312 } }, "memory_bytes": 52428800, "language": "OSL 1.4.0", "members": 128, "banned": 3}| Field | Description |
|---|---|
uptime |
Whole seconds since this process started. |
storage |
Bytes used by each top-level entry in the database directory. A .json file is listed without its extension, so users.json appears as users. Hidden entries are skipped. |
storage_total |
Sum of all storage values, in bytes. |
channels |
One entry per channel that has a message folder: bytes on disk and the number of stored messages. Thread messages are stored separately, under threads, and aren’t counted here. |
memory_bytes |
Process memory use, in bytes. |
language |
Runtime label, OSL followed by the OSL version. |
members |
Every stored account, including people who have left. |
banned |
Accounts that have the banned role. |
Nobody else receives anything. The server reads the disk on every call, so avoid polling it rapidly on large servers.
Permissions
Section titled “Permissions”Requires manage_server.
Errors
Section titled “Errors”Only the generic authentication and permission errors described in the protocol model.
