Agents & Metrics
The master is healthy but a registered agent isn't reporting.
Agent does not appear on the dashboard
- On the agent, confirm services are running:
mac status. - Confirm the master is reachable:
curl http://<master-ip>:28080/health. - Check the agent registered.
mac start agentperforms aPOST /api/v1/registerdirectly against the master and printsRegistered with master <ip>.on success. To confirm from the master side:~$ docker logs mac-api-server 2>&1 | grep '/api/v1/register' - From the master, check Prometheus targets:
Targets in the~$ curl -s http://localhost:29090/api/v1/targets | jq '.data.activeTargets[] | {labels, health}'
downstate list a scrape error explaining the failure.
mac start agent fails or the node never registers
mac start agent registers synchronously and aborts if it can't reach the master, so a
node that never appears is usually one of:
MASTER_IPnot set — the CLI printsError: MASTER_IP is required.Set it and retry:On clusters with a shared (NFS) home directory~$ mac env set MASTER_IP=<master-ip> # saved to ~/.mac/env (per-user)~$ mac start agent~/.mac/envis seen by every node — do not put a per-node value there (and never pinNODE_NAME). SetMASTER_IPin the per-node file/etc/mango/mac/envinstead.- Master unreachable —
could not register with master at <ip>. Confirm the API port is open from the agent:curl -m5 http://<master-ip>:28080/healthshould return200. NODE_NAMEempty — rare; set it explicitly withmac env set NODE_NAME=<name>.- Stale containers from an older deployment — if the agent was once started with a raw
docker compose up(Compose projectdeploy) instead of the CLI (projectmac),mac start agentfails withConflict. The container name "/mac-..." is already in use. Remove the leftovers and start again:~$ docker rm -f $(docker ps -aq --filter 'name=^/mac-')~$ mac start agent
Re-registration is idempotent: the master dedupes by hostname (then IP), so re-running
mac start agent reuses the same node and never creates a duplicate, even if the agent's IP
changed.
Agent does not come back online after a reboot
Registration survives reboots — the master keeps the inventory in a persistent volume and
an agent that merely goes offline stays registered (only a clean mac stop agent deregisters
a node). So after a power-cycle a node should return on its own. If it doesn't:
- Docker isn't starting at boot. The agent containers are
restart: unless-stopped, but that only helps once the Docker service itself starts — the package does not enable it:~$ sudo systemctl enable --now docker~$ mac status # containers should be Up - IPv4 forwarding was reset — see Agent shows "offline" although its containers are
healthy below;
ip_forwardcan revert to0at boot or on a NIC carrier event. - You re-ran
mac start agentand it failed — that path needsMASTER_IP(see the previous section). A plain reboot does not re-run it and does not need to.
Agent shows "offline" although its containers are healthy (ip_forward)
Symptom. mac status on the agent shows every container Up (healthy), but the
dashboard lists the node as Offline and most exporters are missing from Prometheus —
yet the NIC bandwidth chart (nic-exporter, port 29500) still works.
Cause. The master scrapes each agent exporter over the host's published Docker-bridge
ports. If the kernel has IPv4 forwarding disabled (net.ipv4.ip_forward = 0), packets that
the host DNATs to an exporter container are never forwarded, so every bridge-networked
exporter is unreachable from the master: sys-exporter (29101), bmc-agent (29102),
dcgm-exporter (29150), rocm-exporter (29200), sw-exporter (29300). The master's health probe
targets sys-exporter (29101); when it times out the node is marked offline and dropped from
the Prometheus targets file. nic-exporter keeps working because it runs on the host
network (no forwarding needed), which makes the failure look selective.
Diagnose.
# From the master: the host-network exporter answers, the bridge ones time out.
~$ curl -m4 -o /dev/null -w '%{http_code}\n' http://<agent>:29500/metrics # 200
~$ curl -m4 -o /dev/null -w '%{http_code}\n' http://<agent>:29101/metrics # 000 (timeout)
# On the agent: forwarding is off, but the exporter is fine locally.
~$ cat /proc/sys/net/ipv4/ip_forward # 0 ⇒ the cause
~$ curl -s -o /dev/null -w '%{http_code}\n' http://<agent-ip>:29101/metrics # 200 from the node itself
Immediate fix.
~$ sudo sysctl -w net.ipv4.ip_forward=1
The node returns to Online on the master's next health poll (≤ 30 s).
Make it durable. Persisting the sysctl is necessary but not sufficient on
Kubernetes / DPU hosts: a runtime network reconfiguration (observed on RoCE NICs gaining
carrier — systemd-networkd ... Link UP / Gained carrier) resets the global flag after
boot, so the /etc/sysctl.d value gets clobbered mid-run.
# 1) Persist across reboot.
~$ echo 'net.ipv4.ip_forward = 1' | sudo tee /etc/sysctl.d/99-mac-ipforward.conf
~$ sudo sysctl --system
# 2) Have systemd-networkd re-assert it on every link (re)configuration. networkd only ever
# turns ip_forward ON, never off, so enabling it on a managed link self-heals the flag
# after a carrier event resets it. Use a drop-in so netplan-generated profiles are kept:
~$ sudo mkdir -p /etc/systemd/network/10-netplan-<iface>.network.d
~$ printf '[Network]\nIPForward=yes\n' | \
sudo tee /etc/systemd/network/10-netplan-<iface>.network.d/ipforward.conf
~$ sudo networkctl reconfigure <iface>
Replace <iface> with the node's primary interface (see networkctl list). On systemd ≥ 256
the key is IPv4Forwarding=yes.
Alternative (MAC-side): running the bridge exporters on the host network — the way
nic-exporteralready does — removes the dependency onip_forwardentirely.
No GPU metrics on a registered NVIDIA node
The dcgm-exporter container relies on the NVIDIA Container Toolkit. Verify:
~$ docker run --rm --gpus all nvidia/cuda:12.4.0-base-ubuntu22.04 nvidia-smi
If this fails, install the toolkit (sudo apt install nvidia-container-toolkit,
sudo nvidia-ctk runtime configure --runtime=docker, sudo systemctl restart docker),
then mac restart agent.
No GPU metrics on a registered AMD node
The rocm-exporter requires /dev/kfd and /dev/dri to be available inside the container.
~$ ls -l /dev/kfd /dev/dri
~$ docker exec mac-rocm-exporter rocm-smi
If rocm-smi cannot see the GPUs, the kernel module (amdgpu) may not be loaded. Confirm
with lsmod | grep amdgpu.
NIC bandwidth chart is flat
- For NVIDIA Mellanox and MangoBoost GPUBoost, RDMA bandwidth is read via
ethtool -S. Inside the container, rundocker exec mac-nic-exporter ethtool -S <iface> | grep -i rdmaand confirm the counters increment under load. - For Broadcom Thor2 (BCM57608), bandwidth is read from the IB hardware counters in
/sys/class/infiniband/<ibdev>/ports/1/hw_counters/{rx,tx}_bytes. The container needs read access to/sys; this is set by default indocker-compose.agent.yml.
Agent Health Endpoints
| Service | URL |
|---|---|
| dcgm-exporter | http://<agent>:29150/metrics |
| rocm-exporter | http://<agent>:29200/metrics |
| nic-exporter | http://<agent>:29500/metrics |
| sys-exporter | http://<agent>:29101/metrics |
| sw-exporter | http://<agent>:29300/metrics |
| bmc-agent | http://<agent>:29102/health |
| sys-manager | http://<agent>:29103/health |
| mango-sdk-agent | http://<agent>:28000/docs (FastAPI docs page; 200 OK ⇒ alive) |