mfscli-c

MooseFS monitoring — CLI, web GUI and metrics exporter in one static C binary. Everything the stock tools do, plus file & chunk inspection they don't have, with none of the runtime tax.

~535 KB  static binary ~13×  smaller than the Go build 0  dependencies 0  runtime / no GC written in C · musl 110/110  identical to the Go output +  file & chunk inspection

01The problem → the solution

The stock MooseFS diagnostic tools are written in Python (mfscli.py) and the dashboard is a C + Python CGI (mfsgui.c, chart.cgi). The Go port already collapsed all of that into a single executable — but paid a fixed ~7 MB for the Go runtime, GC and reflection. mfscli-c keeps every feature and sheds that tax: a ~535 KB static binary, no runtime at all, in the same language as MooseFS itself.

Before

  • Python + modules on every host
  • GUI = compiled C + Python CGI + server-side GIF charts
  • or the Go port: one file, but ~7 MB of runtime baggage
  • no output designed for automation

With mfscli-c

  • one file: scp mfscli node: && ./mfscli
  • built-in web GUI, charts drawn client-side
  • static musl, no runtime / no GC: ~535 KB, runs anywhere
  • native JSON and a Nagios check included
  • mount-less file/chunk inspection the stock tools can't do

02What you get

A faithful C reimplementation of the Go port — every CLI section, the web GUI and the metrics exporter — verified field-for-field against a live MooseFS 4.x master (110/110 checks identical) — and then a few things the stock Python dashboard doesn't have at all.

📦One tiny static binary

~535 KB, statically linked against musl. HTML and fonts are embedded (xxd-style): copy it and run, even on a bare initrd.

🎨Full, readable CLI

All 18 -S sections (info, chunkservers, disks, storage classes, mounts…), threshold colors, box-drawing frames (-f 0..3), sorting and filtering.

🤖Native JSON

-j emits structured JSON for scripts and dashboards — byte-compatible with the Go encoder (ordered keys, shortest-float).

✅Health & Nagios check

-SHE gives a concise health summary; --check returns a Nagios-style status and exit code.

🌐Built-in web GUI

--serve ships a minimal HTTP server with embedded assets: charts drawn client-side, sortable/filterable tables, an Operations tab, a File info search box and /data.json /fileinfo.json /findfile.json /chartdata.json /influx endpoints.

📈Metrics exporter

--export influx emits line-protocol to feed Telegraf → InfluxDB/TimescaleDB → Grafana.

🧭File & chunk inspectionnew

--fileinfo resolves a file to its chunks and the on-disk path of every copy or EC part — like mfsfileinfo -p, but without a mounted client: it talks to the master and chunkservers directly. Copies and erasure-coding parts, in the CLI and in the GUI.

🔎Find a file by namenew

--findfile walks the whole MFS tree for a file by name — exact, case-insensitive, or with shell wildcards (picture_22*) — and prints its path; in the web GUI a search box lists the matches and jumps straight to their chunks and disk locations.

03The CLI in action

Same host, same output as the Go port — from a binary that ldd calls “not a dynamic executable” and weighs 535 KB. Cluster summary, health, JSON and a Nagios check, all dependency-free.

mfscli-c CLI demo

Recorded live against a real MooseFS 4.x master.

04The web GUI (--serve)

The same self-contained dashboard, now served by a tiny hand-written HTTP server in C: tabbed navigation, sortable and filterable tables, client-side charts with selectable ranges, light/dark theme and text scaling.

Status, Chunkservers, Disks, Storage classes, the File info tab — searching a file by name, then resolving its chunks and on-disk paths (including erasure-coding parts) — and Charts. Assets (HTML + 2 woff2) are embedded in the binary.

05Why C: the size story

The ~7 MB of the Go build are not the assets (those are only ~103 KB) — they are the Go runtime, GC, reflection and net/http. C has no runtime, so that fixed tax simply disappears.

BuildSizeWhat's inside
Go, shipped6.93 MBruntime + GC + reflection (json) + net/http
C, static musl, stripped535 KBcode + embedded assets (~103 KB) + musl static
 ↳ of which embedded assets~103 KBgui_index.html + 2× woff2 — identical in both
C, dynamic musl, stripped~0.25 MBshared libc (if you prefer dynamic)
Go binary
6.93 MB
C binary
535 KB

Go build measured June 2026, C build 0.1.0 November 2026. Same features, ~13× smaller, zero runtime — and in the same language as MooseFS upstream.

06Usage

# cluster summary, colored
mfscli -H mfsmaster -SIG

# health summary + chunkservers
mfscli -SHE ; mfscli -SCS

# JSON for automation
mfscli -j -SIG | jq .

# Nagios-style check
mfscli --check # -> exit code 0/1/2

# built-in web GUI
mfscli --serve :9425 # http://host:9425/

# metrics exporter for Telegraf/Grafana
mfscli --export influx

# where are a file's chunks? copies & EC parts, no mount needed
mfscli -H mfsmaster --fileinfo /data/big.bin

# find a file by name across the whole MFS tree
mfscli --findfile big.bin

# build it yourself: one static, stripped binary
make # -> mfscli, ~535 KB, musl, no dependencies

07Download

Version 0.1.0 (November 2026). Free software under the GNU GPL v2: binary and complete source code.

FileSizeWhat it is
mfscli-linux-amd64535 KBstatic binary for x86-64 Linux: download, chmod +x, run
mfscli-c-0.1.0.tar.gz302 KBsource code: make builds the same binary (needs musl-gcc; make CC=gcc LDFLAGS=-s for a dynamic build)
SHA256SUMSchecksums: sha256sum -c SHA256SUMS