Skip to content

[Bug] Node Network In/Out always 0 — /cluster/resources?type=node doesn't expose netin/netout #419

@SpyrosPsarras

Description

@SpyrosPsarras

Describe the bug

Dashboard "Network In / Network Out" columns for Proxmox nodes are always 0.

Root cause: the Proxmox API endpoint PegaProx queries (/cluster/resources?type=node) does not include netin/netout fields — those only exist on type=vm records. The inline code comment at pegaprox/core/manager.py:971 claims otherwise; it is incorrect.

Location in source (v0.9.10.2)

pegaprox/core/manager.py lines 971–980:

# MK: /nodes/{node}/status doesn't have netin/netout, only /cluster/resources does
net_by_node = {}
try:
    res_url = f"https://{host}:{self.api_port}/api2/json/cluster/resources?type=node"
    res_r = self._create_session().get(res_url, timeout=10)
    if res_r.status_code == 200:
        for nr in res_r.json().get('data', []):
            net_by_node[nr.get('node', '')] = {
                'netin': nr.get('netin', 0),
                'netout': nr.get('netout', 0)
            }

Since the node records have no netin/netout, nr.get('netin', 0) always returns 0.

Evidence (Proxmox-side, via pvesh)

pvesh get /cluster/resources --type node returns only these keys:

cgroup-mode, cpu, disk, hastate, id, level, maxcpu, maxdisk,
maxmem, mem, node, status, type, uptime

No netin/netout.

pvesh get /cluster/resources --type vm does include netin, netout (works correctly for VMs).

pvesh get /nodes/{node}/rrddata --timeframe hour returns samples that do carry netin/netout — this is where node throughput actually lives. Example latest sample on our cluster:

netin:  844333.85 (bytes/sec, AVERAGE)
netout: 863012.88 (bytes/sec, AVERAGE)

Steps to Reproduce

  1. Connect PegaProx to any Proxmox VE 9.x cluster
  2. Open the cluster dashboard
  3. Observe the Network In / Network Out columns for the node rows — always 0, regardless of actual node traffic
  4. Confirm from the Proxmox side:
    pvesh get /cluster/resources --type node --output-format json | jq '.[0] | keys'
    netin/netout are not in the returned keys.

Expected behavior

Node Network In / Network Out columns should show the current (or recent-average) throughput for each node's primary network, matching what the Proxmox VE web UI shows on the node summary graph.

Proposed fix

The repo already has a helper for exactly this — PVEManager.get_node_rrddata() at manager.py:11671 ("NS: Added Jan 2026 - Same format as VM rrddata for consistency"). It's just not used by the dashboard net_by_node block.

Sketch:

net_by_node = {}
for node in nodes:
    nname = node['node']
    try:
        rrd_url = (
            f"https://{host}:{self.api_port}/api2/json/nodes/{nname}"
            f"/rrddata?timeframe=hour&cf=AVERAGE"
        )
        rrd_r = self._create_session().get(rrd_url, timeout=10)
        if rrd_r.status_code == 200:
            samples = rrd_r.json().get('data', [])
            # walk back to most recent sample with non-null netin/netout
            for s in reversed(samples):
                if s.get('netin') is not None and s.get('netout') is not None:
                    net_by_node[nname] = {
                        'netin': s['netin'],
                        'netout': s['netout'],
                    }
                    break
    except Exception:
        pass

Notes for the implementer:

  • Units change: rrddata returns a rate (bytes/sec, AVERAGE over the timeframe step), not cumulative bytes. If the UI does its own delta between refreshes assuming cumulative bytes, the value should be treated as a rate directly. End-user effect: panel finally shows real throughput instead of 0.
  • Extra HTTP calls: adds N calls per refresh (1 per node). Mitigation: fold the RRD fetch into the existing fetch_node_details(node) function so it benefits from the GEVENT_POOL parallel path already conditional in manager.py.

Environment

  • PegaProx Version: 0.9.10.2 (also reproduced in 0.9.4 — code path unchanged across releases)
  • Installation Method: Manual (git clone / update.sh archive-based update)
  • OS: Debian 13 trixie (LXC, unprivileged)
  • Browser: Firefox 150
  • Behind Reverse Proxy? No (direct https://host:5000)
  • UI? Modern Layout

Proxmox VE on the managed cluster: 9.1.11 (Debian 13 hosts).

Logs

No errors emitted — the HTTP call to /cluster/resources?type=node succeeds with HTTP 200, and the .get('netin', 0) quietly returns 0 because the key is absent. So nothing surfaces in logs; the symptom is purely the always-zero panel.

Screenshots

N/A — every node row simply shows 0 B/s for both columns. The same panel renders correct values for CPU, RAM, disk, load average; only the two network columns are flat.

Checklist

  • I have searched existing issues to make sure this is not a duplicate (searched for netin, netout, network, cluster/resources — closed Vm network stats. #205 is about VM stats, not nodes)
  • I am using the latest version of PegaProx (0.9.10.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions