Skip to main content

Monitoring

Two ways to get numbers out of the miner:

HTTP APIReport code
Use whenthe machine is on your network or VPN, or a script needs itthe machine is behind NAT, or you want a number in a spreadsheet
Securitybinds 127.0.0.1, optional Bearer tokenopens no port; you copy the code yourself
Dataeverything, updated every seconda snapshot at the moment it was written
Many machinesone endpoint eachpaste several codes at once

HTTP API​

Enabled by --http-port; the installer turns it on at 18080.

curl -s 127.0.0.1:18080/1/summary
curl -s 127.0.0.1:18080/2/summary | python3 -m json.tool
PathContent
/1/summary, /summarycompact single-line JSON, XMRig shape
/1/statusconnection state
/2/summary, /2/statussame data, pretty-printed
/json_rpcsame as /1/summary, for older clients
zmrig ... --http-port 18080 --http-access-token "$TOKEN"
curl -s -H "Authorization: Bearer $TOKEN" 127.0.0.1:18080/1/summary

A missing token returns 401 with JSON, an unknown path 404 with JSON, HEAD works for health checks, and every response carries Cache-Control: no-store.

{"id":"zmrig","worker_id":"vps-sg-02","uptime":3600,"version":"6.32.1",
"kind":"miner","ua":"zmrig/6.32.1","algo":"rx/0","paused":false,
"donate_level":0,
"connection":{"pool":"wss://relay.example.com:443","uptime":3600,"failures":0,"tls":true},
"hashrate":{"total":[814.2,810.5,805.1],"highest":902.7},
"hugepages":[1168,1168],"cpu":{"threads":2},
"results":{"shares_good":42,"shares_total":42,"hashes_total":2931842,"error_log":[]}}

The API is read-only: there is no endpoint that changes a wallet or restarts anything. Even so, do not bind it to 0.0.0.0 without a token and a firewall — it reveals the worker name, the pool and your address.

Health: still running, or still earning?​

That is a different question from "is the service active", and it is where money disappears quietly: a pool that rejects every share leaves a miner that is running, connected, printing hashrate, and earning nothing.

The miner judges itself once a second and reports one of five states:

StateMeaningWhat happens
warmingbuilding the dataset, or pausednothing (pausing is a feature)
okhashrate near this session's best, shares acceptednothing
degradedbelow 80 % of the 10-minute peak (heat, a noisy neighbour)warning
stalledthe process is alive but not hashingerror
rejectedshares were sent and none were acceptederror
sudo ./oneclick.sh status
# hashrate: 1042.6 H/s (10s/60s/15m)
# shares: 184/0/0 accepted
# health: ok

stalled or rejected for 15 minutes makes the process exit with code 3, and Restart=always turns that into a clean start. The trade is explicit: 16–30 seconds of lost hashrate instead of hours of earning zero.

zmrig ... --no-health-restart # never exit on its own
zmrig ... --health-restart=1800 # wait longer before giving up (seconds)
zmrig ... --health-warmup=300 # ignore the first 5 minutes

The state is also in the health field of a report code, so a fleet table can show the machines that are running and earning nothing.

Report codes​

One measurement, one line:

$ sudo ./oneclick.sh report --power 45
ZMRIG1.eyJ2IjoxLCJpZCI6InZwc… # about 380–520 characters

It takes 25–30 seconds: 15–20 s to build the dataset, 10 s of warm-up, 15 s of measurement, then a power sample. oneclick.sh report stops the service first — the running miner holds the huge pages, and a second dataset does not fit.

FieldMeaning
id, cpu, cores, thrmachine name, CPU model, physical cores, mining threads
algo, modealgorithm, auto/fast/light
hs[0..3]hashrate over 10 s, 60 s, 15 min, session best
hphuge pages granted / needed
shares, hash, upaccepted, rejected, failed; total hashes; uptime in seconds
pw, pwsrcwatts and where they came from: rapl/hwmon (CPU package), user (wall meter), none
pool, ts, verpool, timestamp, miner version

A code contains no wallet address, no pool token, no public IP. It is base64url-encoded JSON and you can read it yourself:

cut -d. -f2 report.txt | tr '_-' '/+' | base64 -d | python3 -m json.tool

While mining, let the miner keep the file fresh:

--report-file /var/lib/zmrig/report.txt --report-interval 60

The installer enables that for the zmrig engine, so a later sudo cat /var/lib/zmrig/report.txt is enough.

From one code to a fleet​

  1. Give each machine its own --report-id (or --rig-id).
  2. Let the miner write its report file.
  3. Paste the codes into the profitability calculator, one per line.
  4. The calculator totals hashrate, watts, kWh, power cost, revenue and profit, and exports JSON.

There is no intermediate server. For 24/7 monitoring, scrape the API into Prometheus or Netdata over your own VPN; do not expose it to the internet.