A zero-dependency C99 storage inspector for SCORPIOX BOT nodes. One binary,
three modes, no runtime dependencies, no outbound network requests.
It answers two questions a node owner actually asks:
Everything is read from the local kernel interfaces. Nothing is sent anywhere.
| Mode | Output |
|---|---|
--meta | {"name":"disks","desc":"Local storage"} - discovery metadata |
?action=mounts | Every real mounted filesystem: device, filesystem type, mountpoint, total / used / free / available bytes, utilisation percentage, inode totals and inode pressure |
?action=dirs&root=workspace | A bounded one-level size breakdown of /workspace |
?action=dirs&root=home | The same breakdown for $HOME (%USERPROFILE% on Windows) |
?action=info | Plugin version, platform, pid, capability and limit declaration |
GET (no action) | A responsive HTML dashboard |
Pseudo filesystems (proc, sysfs, cgroup2, devpts, debugfs, ...) and the
kernel-only mountpoints (/sys, /proc, /dev) are filtered out, and a
mountpoint that appears twice in /proc/mounts is only counted once - otherwise
a container's repeated host bind mounts triple the reported capacity.
| Platform | Mount source | Directory walk |
|---|---|---|
| Linux | /proc/mounts + statvfs(3) | opendir / readdir / lstat |
| macOS | getmntinfo(3) | opendir / readdir / lstat |
| Windows | GetLogicalDriveStringsA + GetDiskFreeSpaceExA + GetVolumeInformationA | FindFirstFileA / FindNextFileA |
?action=dirs accepts only root=workspace or root=home. An arbitrary
path is refused with root_not_allowed; an allowlisted root that does not exist
on the node answers root_unavailable. The walk itself is bounded four ways:
The response reports truncated, max_depth, max_scan_entries and scan_ms
so a caller can see that the numbers were cut short rather than trust them.
make # native binary -> ./plugin_disks
make musl # static musl x86_64 -> ./plugin_disks (universal Linux artifact)
make arm64 # static aarch64 -> ./plugin_disks.arm64 (Pi 5 / ARM servers)
make win64 # static PE -> ./plugin_disks.exe
make macos # Apple clang -> ./plugin_disks (run on macOS)
make test # build + offline test suite
On Windows, powershell -ExecutionPolicy Bypass -File build.ps1 produces
plugin_disks.exe and refuses to succeed unless the first two bytes are MZ.
No compiler, no problem: the published binaries live at
https://dist.scorpiox.net/bot-plugins/disks/.
The supported path is one click in SCORPIOX BOT (`Settings -> Menus -> Plugins ->
Marketplace`) or, from a shell on the node, drop the binary into the plugin
directory:
mkdir -p ~/.scorpiox/plugins
cp plugin_disks ~/.scorpiox/plugins/
chmod +x ~/.scorpiox/plugins/plugin_disks
/workspace/.scorpiox/plugins/ is used instead when /workspace exists, because
it survives BotCloud container restarts. The node API discovers the plugin on the
next request - no restart.
Prefer to build it yourself? The source is MIT licensed and compiles in one
command:
cc -O2 -std=c99 -Wall -Wextra -o plugin_disks src/plugin_disks.c
# mounted filesystems
curl -s 'http://127.0.0.1:8150/plugin_disks?action=mounts&pwd=<node-password>'
# top-level sizes inside the home directory
curl -s 'http://127.0.0.1:8150/plugin_disks?action=dirs&root=home&pwd=<node-password>'
# an arbitrary path is refused, by design
curl -s 'http://127.0.0.1:8150/plugin_disks?action=dirs&root=/etc&pwd=<node-password>'
# {"ok":false,"error":"root_not_allowed","allowed_roots":["workspace","home"],...}
action=mounts response:
{
"ok": true,
"action": "mounts",
"plugin": "plugin_disks",
"version": "1.0.0",
"platform": "linux",
"count": 2,
"zero_network": true,
"mounts": [
{
"device": "/dev/nvme0n1p2",
"fstype": "ext4",
"mount": "/",
"total_bytes": 983167959040,
"used_bytes": 930171248640,
"free_bytes": 52996710400,
"avail_bytes": 42979762176,
"pct": 95.6,
"inodes_total": 61038592,
"inodes_used": 8172848,
"inodes_pct": 13.4,
"has_inodes": true
}
]
}
(popen/system are not used anywhere in the source).
--meta. Accepted forms: X-Bot-Password: <pwd>, Authorization: Bearer <pwd>, and ?pwd=<pwd>.
When BOT_PASSWORD is unset the check is a deliberate no-op, which is how the
plugin runs from a developer shell.
symlink out of the root, and cannot run unbounded.
MIT. Copyright (c) 2026 SCORPIOX INC.