Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Add recorded PVE RRD fixtures and decode-alignment tests
[email protected]0b392659cdb2
diff --git a/pkg/proxmox/issue1634_rrd_fixture_test.go b/pkg/proxmox/issue1634_rrd_fixture_test.gonew file mode 100644index 0000000000..42131578ed--- /dev/null+++ b/pkg/proxmox/issue1634_rrd_fixture_test.go@@ -0,0 +1,274 @@+package proxmox++import (+ "context"+ "encoding/json"+ "net/http"+ "os"+ "path/filepath"+ "reflect"+ "sort"+ "testing"+)++// Issue #1634: LXC memory rendered as 0% because GuestRRDPoint declared+// memused/memavailable columns that real PVE guest rrddata responses never+// contain (they exist only in node RRD). Every test mocked the fictional+// columns, so CI validated the assumption instead of the API. The tests in+// this file decode recorded responses (see testdata/rrd/README.md) through+// the real client and fail whenever a parsing struct references a column+// absent from every recorded response.++// knownDeadGuestRRDFields are GuestRRDPoint columns that no recorded guest+// response (PVE 8 or PVE 9) contains. They only ever decode to nil; the+// consumers in internal/monitoring treat them as absent evidence (#1634).+// Removing them from GuestRRDPoint is a monitoring-subsystem runtime change+// (governance guard) tracked separately. Do not add entries here — a new+// struct field must reference a column present in the recorded fixtures.+var knownDeadGuestRRDFields = map[string]string{+ "memused": "exists only in node RRD; guest responses report cache-inclusive mem/maxmem",+ "memavailable": "exists only in PVE 9 node RRD; never present for guests",+}++func rrdFixturePath(name string) string {+ return filepath.Join("testdata", "rrd", name)+}++// rrdFixtureColumns returns the union of column names across all rows of a+// recorded fixture.+func rrdFixtureColumns(t *testing.T, name string) map[string]bool {+ t.Helper()++ raw, err := os.ReadFile(rrdFixturePath(name))+ if err != nil {+ t.Fatalf("read fixture %s: %v", name, err)+ }++ var envelope struct {+ Data []map[string]json.RawMessage `json:"data"`+ }+ if err := json.Unmarshal(raw, &envelope); err != nil {+ t.Fatalf("parse fixture %s: %v", name, err)+ }+ if len(envelope.Data) == 0 {+ t.Fatalf("fixture %s has no rows", name)+ }++ columns := make(map[string]bool)+ for _, row := range envelope.Data {+ for key := range row {+ columns[key] = true+ }+ }+ return columns+}++// jsonFieldTags returns the JSON key for every exported field of a struct+// type, with tag options such as ",omitempty" stripped.+func jsonFieldTags(t *testing.T, typ reflect.Type) []string {+ t.Helper()++ var tags []string+ for i := 0; i < typ.NumField(); i++ {+ tag := typ.Field(i).Tag.Get("json")+ if tag == "" || tag == "-" {+ t.Fatalf("%s.%s has no json tag; RRD point fields must map to API columns", typ.Name(), typ.Field(i).Name)+ }+ if comma := indexByte(tag, ','); comma >= 0 {+ tag = tag[:comma]+ }+ tags = append(tags, tag)+ }+ sort.Strings(tags)+ return tags+}++func indexByte(s string, b byte) int {+ for i := 0; i < len(s); i++ {+ if s[i] == b {+ return i+ }+ }+ return -1+}++// newRRDFixtureClient serves each fixture at its real API path so the+// recorded bytes travel through the actual client request/decode path.+func newRRDFixtureClient(t *testing.T) *Client {+ t.Helper()++ fixtureByPath := map[string]string{+ "/api2/json/nodes/pve9/lxc/108/rrddata": "pve9_lxc_rrddata.json",+ "/api2/json/nodes/pve9/qemu/100/rrddata": "pve9_qemu_rrddata.json",+ "/api2/json/nodes/pve9/rrddata": "pve9_node_rrddata.json",+ "/api2/json/nodes/pve8/lxc/101/rrddata": "pve8_guest_rrddata.json",+ "/api2/json/nodes/pve8/qemu/100/rrddata": "pve8_guest_rrddata.json",+ "/api2/json/nodes/pve8/rrddata": "pve8_node_rrddata.json",+ }++ return newTestClient(t, func(w http.ResponseWriter, r *http.Request) {+ fixture, ok := fixtureByPath[r.URL.Path]+ if !ok {+ http.NotFound(w, r)+ return+ }+ raw, err := os.ReadFile(rrdFixturePath(fixture))+ if err != nil {+ t.Errorf("read fixture %s: %v", fixture, err)+ http.Error(w, "missing fixture", http.StatusInternalServerError)+ return+ }+ w.Header().Set("Content-Type", "application/json")+ if _, err := w.Write(raw); err != nil {+ t.Errorf("write fixture %s: %v", fixture, err)+ }+ })+}++func TestGuestRRDPointColumnsExistInRecordedResponses(t *testing.T) {+ recorded := make(map[string]bool)+ for _, fixture := range []string{"pve9_lxc_rrddata.json", "pve9_qemu_rrddata.json", "pve8_guest_rrddata.json"} {+ for column := range rrdFixtureColumns(t, fixture) {+ recorded[column] = true+ }+ }++ tags := jsonFieldTags(t, reflect.TypeOf(GuestRRDPoint{}))+ for _, tag := range tags {+ if recorded[tag] {+ continue+ }+ if _, dead := knownDeadGuestRRDFields[tag]; dead {+ continue+ }+ t.Errorf("GuestRRDPoint field %q is absent from every recorded guest rrddata response; do not parse columns the PVE API does not send (#1634)", tag)+ }++ // Keep the allowlist honest: entries must still be struct fields, and+ // must still be absent from the recordings.+ tagSet := make(map[string]bool, len(tags))+ for _, tag := range tags {+ tagSet[tag] = true+ }+ for column := range knownDeadGuestRRDFields {+ if !tagSet[column] {+ t.Errorf("knownDeadGuestRRDFields entry %q is no longer a GuestRRDPoint field; remove it from the allowlist", column)+ }+ if recorded[column] {+ t.Errorf("knownDeadGuestRRDFields entry %q now appears in recorded responses; remove it from the allowlist and re-record fixtures", column)+ }+ }+}++func TestNodeRRDPointColumnsExistInRecordedResponses(t *testing.T) {+ recorded := make(map[string]bool)+ for _, fixture := range []string{"pve9_node_rrddata.json", "pve8_node_rrddata.json"} {+ for column := range rrdFixtureColumns(t, fixture) {+ recorded[column] = true+ }+ }++ for _, tag := range jsonFieldTags(t, reflect.TypeOf(NodeRRDPoint{})) {+ if !recorded[tag] {+ t.Errorf("NodeRRDPoint field %q is absent from every recorded node rrddata response; do not parse columns the PVE API does not send (#1634)", tag)+ }+ }+}++func TestGuestRRDDecodeAgainstRecordedResponses(t *testing.T) {+ client := newRRDFixtureClient(t)+ ctx := context.Background()++ fetches := []struct {+ name string+ fetch func() ([]GuestRRDPoint, error)+ }{+ {"pve9 lxc", func() ([]GuestRRDPoint, error) { return client.GetLXCRRDData(ctx, "pve9", 108, "hour", "AVERAGE", nil) }},+ {"pve9 qemu", func() ([]GuestRRDPoint, error) { return client.GetVMRRDData(ctx, "pve9", 100, "hour", "AVERAGE", nil) }},+ {"pve8 lxc", func() ([]GuestRRDPoint, error) { return client.GetLXCRRDData(ctx, "pve8", 101, "hour", "AVERAGE", nil) }},+ {"pve8 qemu", func() ([]GuestRRDPoint, error) { return client.GetVMRRDData(ctx, "pve8", 100, "hour", "AVERAGE", nil) }},+ }++ for _, tc := range fetches {+ t.Run(tc.name, func(t *testing.T) {+ points, err := tc.fetch()+ if err != nil {+ t.Fatalf("fetch: %v", err)+ }+ if len(points) == 0 {+ t.Fatal("no points decoded from recorded response")+ }++ var sawMaxMem bool+ for _, p := range points {+ if p.Time == 0 {+ t.Fatalf("point decoded without time: %+v", p)+ }+ if p.MaxMem != nil && *p.MaxMem > 0 {+ sawMaxMem = true+ }+ // The #1634 mechanism: these columns never arrive for+ // guests, so the fields can only ever be nil.+ if p.MemUsed != nil {+ t.Fatalf("MemUsed decoded from a recorded guest response (time=%d); guest RRD does not carry memused", p.Time)+ }+ if p.MemAvailable != nil {+ t.Fatalf("MemAvailable decoded from a recorded guest response (time=%d); guest RRD does not carry memavailable", p.Time)+ }+ }+ if !sawMaxMem {+ t.Fatal("no point carried maxmem; fixture should include populated rows")+ }+ })+ }+}++func TestNodeRRDDecodeAgainstRecordedResponses(t *testing.T) {+ client := newRRDFixtureClient(t)+ ctx := context.Background()++ t.Run("pve9", func(t *testing.T) {+ points, err := client.GetNodeRRDData(ctx, "pve9", "hour", "AVERAGE", nil)+ if err != nil {+ t.Fatalf("fetch: %v", err)+ }+ if len(points) == 0 {+ t.Fatal("no points decoded from recorded response")+ }+ var sawTotal, sawUsed, sawAvail, sawNetIn, sawNetOut bool+ for _, p := range points {+ sawTotal = sawTotal || (p.MemTotal != nil && *p.MemTotal > 0)+ sawUsed = sawUsed || (p.MemUsed != nil && *p.MemUsed > 0)+ sawAvail = sawAvail || (p.MemAvailable != nil && *p.MemAvailable > 0)+ sawNetIn = sawNetIn || p.NetIn != nil+ sawNetOut = sawNetOut || p.NetOut != nil+ }+ if !sawTotal || !sawUsed || !sawAvail || !sawNetIn || !sawNetOut {+ t.Fatalf("PVE 9 node RRD should populate every NodeRRDPoint field (total=%v used=%v avail=%v netin=%v netout=%v)",+ sawTotal, sawUsed, sawAvail, sawNetIn, sawNetOut)+ }+ })++ t.Run("pve8", func(t *testing.T) {+ points, err := client.GetNodeRRDData(ctx, "pve8", "hour", "AVERAGE", nil)+ if err != nil {+ t.Fatalf("fetch: %v", err)+ }+ if len(points) == 0 {+ t.Fatal("no points decoded from recorded response")+ }+ var sawTotal, sawUsed bool+ for _, p := range points {+ sawTotal = sawTotal || (p.MemTotal != nil && *p.MemTotal > 0)+ sawUsed = sawUsed || (p.MemUsed != nil && *p.MemUsed > 0)+ // memavailable was added in PVE 9; PVE 8 node RRD never+ // carries it, which is why the field must stay optional.+ if p.MemAvailable != nil {+ t.Fatalf("MemAvailable decoded from a recorded PVE 8 node response (time=%d)", p.Time)+ }+ }+ if !sawTotal || !sawUsed {+ t.Fatalf("PVE 8 node RRD should populate memtotal/memused (total=%v used=%v)", sawTotal, sawUsed)+ }+ })+}diff --git a/pkg/proxmox/testdata/rrd/README.md b/pkg/proxmox/testdata/rrd/README.mdnew file mode 100644index 0000000000..62105682fc--- /dev/null+++ b/pkg/proxmox/testdata/rrd/README.md@@ -0,0 +1,45 @@+# Recorded Proxmox RRD API fixtures++Real `rrddata` responses recorded from Proxmox VE hosts, wrapped in the+`{"data": [...]}` envelope exactly as the HTTP API returns them. They exist so+that the decode tests in `issue1634_rrd_fixture_test.go` validate our parsing+structs against what PVE actually sends, not against hand-written mocks+(issue #1634 happened because every test mocked `memused`/`memavailable`+columns that real guest responses never contain).++## PVE 9 fixtures (recorded live)++Captured 2026-07-27 from a live two-node cluster running pve-manager 9.2.3+via `pvesh get ... --output-format json` on node `minipc`, then trimmed to a+dozen rows while preserving the full column set of the original response.++- `pve9_lxc_rrddata.json` — `/nodes/minipc/lxc/108/rrddata --timeframe hour --cf AVERAGE`+ (running container). Note memory is reported as cache-inclusive `mem`/`maxmem`;+ there is no `memused`/`memavailable` in guest RRD.+- `pve9_qemu_rrddata.json` — `/nodes/minipc/qemu/100/rrddata --timeframe year --cf AVERAGE`.+ The only QEMU VM on the cluster was stopped, so the hour window carried no+ memory samples; the year window includes rows from when it last ran. The+ column schema (`pve-vm-9.0`) is identical across timeframes. Two sparse rows+ (stopped periods) are kept deliberately: PVE omits keys for absent samples+ rather than sending nulls. `memhost` is the PVE 9 QEMU host-side memory+ column; it also is not `memused`/`memavailable`.+- `pve9_node_rrddata.json` — `/nodes/minipc/rrddata --timeframe hour --cf AVERAGE`.+ Node RRD is the only place `memtotal`/`memused`/`memavailable` exist.++## PVE 8 fixtures (recovered from pre-migration RRD files)++The same host was upgraded from PVE 8; the upgrade renames the old RRD+databases (`pve2-vm/<vmid>.old`, `pve2-node/<node>.old`) instead of deleting+them. These fixtures were recovered 2026-07-27 from those files with+`RRDs::fetch(..., "AVERAGE")` and serialized the same way+`PVE::RRD::create_rrd_data` does (columns with NaN samples omitted), i.e. the+shape a PVE 8 API would have returned for the recorded data. The column sets+are the data-source names of the actual PVE 8 RRD schemas, not a guess.++- `pve8_guest_rrddata.json` — from `pve2-vm/100.old`. PVE 8 serves both+ `/lxc/{vmid}/rrddata` and `/qemu/{vmid}/rrddata` from this same `pve2-vm`+ schema, so one guest fixture covers both endpoints. No pressure columns, no+ `memhost`, and — as on PVE 9 — no `memused`/`memavailable`.+- `pve8_node_rrddata.json` — from `pve2-node/minipc.old`. PVE 8 node RRD has+ `memtotal`/`memused` but no `memavailable` (added in PVE 9), which is why+ `NodeRRDPoint.MemAvailable` must stay an optional pointer.diff --git a/pkg/proxmox/testdata/rrd/pve8_guest_rrddata.json b/pkg/proxmox/testdata/rrd/pve8_guest_rrddata.jsonnew file mode 100644index 0000000000..6291be21b3--- /dev/null+++ b/pkg/proxmox/testdata/rrd/pve8_guest_rrddata.json@@ -0,0 +1,118 @@+{+ "data": [+ {+ "cpu": 0.00369421533613487,+ "disk": 0,+ "diskread": 0,+ "diskwrite": 5051.73333333333,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "mem": 765132800,+ "netin": 1497.31,+ "netout": 467.38,+ "time": 1755964320+ },+ {+ "cpu": 0.00296391898040815,+ "disk": 0,+ "diskread": 0,+ "diskwrite": 10600.8380952381,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "mem": 765132800,+ "netin": 2294.13,+ "netout": 360.603333333333,+ "time": 1755964380+ },+ {+ "cpu": 0.00303400941707342,+ "disk": 0,+ "diskread": 0,+ "diskwrite": 9674.3619047619,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "mem": 765132800,+ "netin": 1118.88,+ "netout": 0.1,+ "time": 1755964440+ },+ {+ "cpu": 0.00320026348438257,+ "disk": 0,+ "diskread": 0,+ "diskwrite": 7864.32,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "mem": 765132800,+ "netin": 857.005,+ "netout": 0.9,+ "time": 1755964500+ },+ {+ "cpu": 0.00298084572885927,+ "disk": 0,+ "diskread": 0,+ "diskwrite": 12712.7703703704,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "mem": 795753422.432432,+ "netin": 824.213513513514,+ "netout": 0,+ "time": 1755964560+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964620+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964680+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964740+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964800+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964860+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964920+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 10737418240,+ "maxmem": 4294967296,+ "time": 1755964980+ }+ ]+}diff --git a/pkg/proxmox/testdata/rrd/pve8_node_rrddata.json b/pkg/proxmox/testdata/rrd/pve8_node_rrddata.jsonnew file mode 100644index 0000000000..28c7421826--- /dev/null+++ b/pkg/proxmox/testdata/rrd/pve8_node_rrddata.json@@ -0,0 +1,184 @@+{+ "data": [+ {+ "cpu": 0.0234422684897398,+ "iowait": 0.555264645792154,+ "loadavg": 4.895,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 5607787997.86667,+ "netin": 14707.8823809524,+ "netout": 11795.8847619048,+ "roottotal": 19037854105.6,+ "rootused": 8952650137.6,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964380+ },+ {+ "cpu": 0.0586569770723241,+ "iowait": 0.683809165758212,+ "loadavg": 6.46916666666667,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 5606268518.4,+ "netin": 15450.7776190476,+ "netout": 13214.3319047619,+ "roottotal": 19037902165.3333,+ "rootused": 8963725721.6,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964440+ },+ {+ "cpu": 0.0584745143201504,+ "iowait": 0.796556811319609,+ "loadavg": 7.53966666666667,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 5837733273.6,+ "netin": 14640.5416666667,+ "netout": 12436.05,+ "roottotal": 19037924010.6667,+ "rootused": 9017670587.73333,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964500+ },+ {+ "cpu": 0.048050341724633,+ "iowait": 0.784173287103309,+ "loadavg": 7.71783333333333,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 5080054101.33333,+ "netin": 15422.585,+ "netout": 14769.5383333333,+ "roottotal": 19038011392,+ "rootused": 9070752563.2,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964560+ },+ {+ "cpu": 0.0533577375067524,+ "iowait": 0.657853502973259,+ "loadavg": 6.1975,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3417442030.93333,+ "netin": 400637.391666667,+ "netout": 12983.065,+ "roottotal": 19038039790.9333,+ "rootused": 9095429051.73333,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964620+ },+ {+ "cpu": 0.0987798792996064,+ "iowait": 0.219260092548435,+ "loadavg": 4.18833333333333,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3473908599.46667,+ "netin": 14879795.335,+ "netout": 59595.8616666667,+ "roottotal": 19037939302.4,+ "rootused": 9468715554.13333,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964680+ },+ {+ "cpu": 0.0162533484995338,+ "iowait": 0.835622311473289,+ "loadavg": 6.19066666666667,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3530094318.93333,+ "netin": 12833.9066666667,+ "netout": 10996.065,+ "roottotal": 19037945856,+ "rootused": 9689567505.06667,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964740+ },+ {+ "cpu": 0.127911449404265,+ "iowait": 0.4147355724441,+ "loadavg": 5.4345,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3546340556.8,+ "netin": 12946.515,+ "netout": 11008.595,+ "roottotal": 19037961147.7333,+ "rootused": 9813539771.73333,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964800+ },+ {+ "cpu": 0.100670027816615,+ "iowait": 0.329680922418426,+ "loadavg": 3.73083333333333,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3481038165.33333,+ "netin": 13308.9366666667,+ "netout": 12620.0533333333,+ "roottotal": 19037836629.3333,+ "rootused": 9820152354.13333,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964860+ },+ {+ "cpu": 0.0156362567855241,+ "iowait": 0.187721843137218,+ "loadavg": 2.8255,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3418315980.8,+ "netin": 13015.85,+ "netout": 11060.265,+ "roottotal": 19037865028.2667,+ "rootused": 9821273019.73333,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964920+ },+ {+ "cpu": 0.0397587161026538,+ "iowait": 0.336049269717243,+ "loadavg": 2.55,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3394105207.46667,+ "netin": 14113.4133333333,+ "netout": 11575.6016666667,+ "roottotal": 19037895611.7333,+ "rootused": 9846349277.86667,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755964980+ },+ {+ "cpu": 0.185616262186609,+ "iowait": 0.0795701212541105,+ "loadavg": 2.47588235294118,+ "maxcpu": 4,+ "memtotal": 16540225536,+ "memused": 3432138390.58824,+ "netin": 14398.3941176471,+ "netout": 15476.4176470588,+ "roottotal": 19037814784,+ "rootused": 9906421760,+ "swaptotal": 0,+ "swapused": 0,+ "time": 1755965040+ }+ ]+}diff --git a/pkg/proxmox/testdata/rrd/pve9_lxc_rrddata.json b/pkg/proxmox/testdata/rrd/pve9_lxc_rrddata.jsonnew file mode 100644index 0000000000..3e2e7b9413--- /dev/null+++ b/pkg/proxmox/testdata/rrd/pve9_lxc_rrddata.json@@ -0,0 +1,232 @@+{+ "data": [+ {+ "cpu": 0.000130919798327219,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 337035946.666667,+ "netin": 316,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168420+ },+ {+ "cpu": 0.000136875624950681,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 336094549.333333,+ "netin": 315.933333333333,+ "netout": 3.03333333333333,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168480+ },+ {+ "cpu": 0.000123435057120165,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 334523733.333333,+ "netin": 305.333333333333,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168540+ },+ {+ "cpu": 0.000123558548689792,+ "disk": 9109372928,+ "diskread": 1160.53333333333,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 334526464,+ "netin": 298.433333333333,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168600+ },+ {+ "cpu": 0.000113170184718027,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 334538069.333333,+ "netin": 313.5,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168660+ },+ {+ "cpu": 0.000198437183973322,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 334529877.333333,+ "netin": 306.616666666667,+ "netout": 3.03333333333333,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168720+ },+ {+ "cpu": 0.000127113825262286,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 334529194.666667,+ "netin": 302.433333333333,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168780+ },+ {+ "cpu": 0.000151463740150457,+ "disk": 9109372928,+ "diskread": 186.181818181818,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 334534656,+ "netin": 329.039393939394,+ "netout": 3.03333333333333,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168840+ },+ {+ "cpu": 0.000467164983019213,+ "disk": 9109372928,+ "diskread": 86.8848484848485,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 336417928.533333,+ "netin": 407.493939393939,+ "netout": 3970.38333333333,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168900+ },+ {+ "cpu": 0.000130978143257014,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 337024341.333333,+ "netin": 321.9,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785168960+ },+ {+ "cpu": 0.0001759198630618,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 337030417.066667,+ "netin": 308.666666666667,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785169020+ },+ {+ "cpu": 0.000126828713602557,+ "disk": 9109372928,+ "diskread": 0,+ "diskwrite": 0,+ "maxcpu": 4,+ "maxdisk": 67645734912,+ "maxmem": 8589934592,+ "mem": 337024341.333333,+ "netin": 297.75,+ "netout": 0,+ "pressurecpufull": 0,+ "pressurecpusome": 0,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1785169080+ }+ ]+}diff --git a/pkg/proxmox/testdata/rrd/pve9_node_rrddata.json b/pkg/proxmox/testdata/rrd/pve9_node_rrddata.jsonnew file mode 100644index 0000000000..2dc2ada1ab--- /dev/null+++ b/pkg/proxmox/testdata/rrd/pve9_node_rrddata.json@@ -0,0 +1,268 @@+{+ "data": [+ {+ "arcsize": 1610934106.66667,+ "cpu": 0.185322399620351,+ "iowait": 0.000552583403434387,+ "loadavg": 0.776666666666667,+ "maxcpu": 4,+ "memavailable": 9810897578.66666,+ "memtotal": 16535748608,+ "memused": 6724851029.33333,+ "netin": 75773.9833333333,+ "netout": 249650.6,+ "pressurecpusome": 1.99333333333333,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370996224,+ "rootused": 9164816384,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168420+ },+ {+ "arcsize": 1613284600,+ "cpu": 0.250813096478794,+ "iowait": 0.000675876606920072,+ "loadavg": 0.823333333333333,+ "maxcpu": 4,+ "memavailable": 9734325589.33333,+ "memtotal": 16535748608,+ "memused": 6801423018.66667,+ "netin": 90488.4333333333,+ "netout": 264515.3,+ "pressurecpusome": 2.49333333333333,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370865152,+ "rootused": 9164816384,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168480+ },+ {+ "arcsize": 1615660569.33333,+ "cpu": 0.220434173208144,+ "iowait": 0.000687574171102389,+ "loadavg": 0.775,+ "maxcpu": 4,+ "memavailable": 9764693333.33333,+ "memtotal": 16535748608,+ "memused": 6771055274.66667,+ "netin": 87607.8333333333,+ "netout": 251841.816666667,+ "pressurecpusome": 2.1,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370952533.3333,+ "rootused": 9164903765.33333,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168540+ },+ {+ "arcsize": 1612893292,+ "cpu": 0.18881261112952,+ "iowait": 0.000803268506721318,+ "loadavg": 0.415,+ "maxcpu": 4,+ "memavailable": 9832389290.66666,+ "memtotal": 16535748608,+ "memused": 6703359317.33333,+ "netin": 93762.4666666667,+ "netout": 259983.2,+ "pressurecpusome": 1.885,+ "pressureiofull": 0,+ "pressureiosome": 0.0166666666666667,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370865152,+ "rootused": 9164947456,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168600+ },+ {+ "arcsize": 1613019893.33333,+ "cpu": 0.181972010720532,+ "iowait": 0.000594162654301446,+ "loadavg": 0.22,+ "maxcpu": 4,+ "memavailable": 9842569898.66666,+ "memtotal": 16535748608,+ "memused": 6693178709.33333,+ "netin": 98048.7166666667,+ "netout": 267648.066666667,+ "pressurecpusome": 2.02166666666667,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370865152,+ "rootused": 9164947456,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168660+ },+ {+ "arcsize": 1614294597.33333,+ "cpu": 0.186366859717786,+ "iowait": 0.000688431650381206,+ "loadavg": 0.39,+ "maxcpu": 4,+ "memavailable": 9833670656,+ "memtotal": 16535748608,+ "memused": 6702077952,+ "netin": 76481.55,+ "netout": 252038.483333333,+ "pressurecpusome": 1.70166666666667,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370865152,+ "rootused": 9164991146.66666,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168720+ },+ {+ "arcsize": 1617081922.66667,+ "cpu": 0.226105696054578,+ "iowait": 0.000723746946788671,+ "loadavg": 0.416666666666667,+ "maxcpu": 4,+ "memavailable": 9792015018.66666,+ "memtotal": 16535748608,+ "memused": 6743733589.33333,+ "netin": 87631.3666666667,+ "netout": 256119.916666667,+ "pressurecpusome": 2.04833333333333,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370865152,+ "rootused": 9165078528,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168780+ },+ {+ "arcsize": 1612167420,+ "cpu": 0.222507805550871,+ "iowait": 0.000667973276425825,+ "loadavg": 0.635,+ "maxcpu": 4,+ "memavailable": 9813929301.33333,+ "memtotal": 16535748608,+ "memused": 6721819306.66667,+ "netin": 86194.8333333333,+ "netout": 255208.433333333,+ "pressurecpusome": 2.20666666666667,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370843306.6667,+ "rootused": 9165078528,+ "swaptotal": 4294963200,+ "swapused": 1229058048,+ "time": 1785168840+ },+ {+ "arcsize": 1621917484,+ "cpu": 0.225179198755978,+ "iowait": 0.000905332792066052,+ "loadavg": 0.616666666666667,+ "maxcpu": 4,+ "memavailable": 9815702186.66666,+ "memtotal": 16535748608,+ "memused": 6720046421.33333,+ "netin": 84511.7666666667,+ "netout": 259387.233333333,+ "pressurecpusome": 2.885,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370865152,+ "rootused": 9165187754.66666,+ "swaptotal": 4294963200,+ "swapused": 1229047125.33333,+ "time": 1785168900+ },+ {+ "arcsize": 1614728610.66667,+ "cpu": 0.188653485035522,+ "iowait": 0.000923865478270116,+ "loadavg": 0.756666666666666,+ "maxcpu": 4,+ "memavailable": 9812810410.66666,+ "memtotal": 16535748608,+ "memused": 6722938197.33333,+ "netin": 95800.3,+ "netout": 270419.6,+ "pressurecpusome": 1.95666666666667,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370843306.6667,+ "rootused": 9165209600,+ "swaptotal": 4294963200,+ "swapused": 1229041664,+ "time": 1785168960+ },+ {+ "arcsize": 1618040693.46667,+ "cpu": 0.187075466701466,+ "iowait": 0.000597816626859568,+ "loadavg": 0.495166666666667,+ "maxcpu": 4,+ "memavailable": 9814780108.8,+ "memtotal": 16535748608,+ "memused": 6720968499.2,+ "netin": 75166.3666666667,+ "netout": 247268.75,+ "pressurecpusome": 2.01316666666667,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370753740.8,+ "rootused": 9165229260.8,+ "swaptotal": 4294963200,+ "swapused": 1229041664,+ "time": 1785169020+ },+ {+ "arcsize": 1615051000,+ "cpu": 0.25281828543495,+ "iowait": 0.00071367098104992,+ "loadavg": 0.545,+ "maxcpu": 4,+ "memavailable": 9764272810.66666,+ "memtotal": 16535748608,+ "memused": 6771475797.33333,+ "netin": 95849.0833333333,+ "netout": 265225.183333333,+ "pressurecpusome": 2.28333333333333,+ "pressureiofull": 0,+ "pressureiosome": 0,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "roottotal": 14370821461.3333,+ "rootused": 9165340672,+ "swaptotal": 4294963200,+ "swapused": 1229041664,+ "time": 1785169080+ }+ ]+}diff --git a/pkg/proxmox/testdata/rrd/pve9_qemu_rrddata.json b/pkg/proxmox/testdata/rrd/pve9_qemu_rrddata.jsonnew file mode 100644index 0000000000..febc764450--- /dev/null+++ b/pkg/proxmox/testdata/rrd/pve9_qemu_rrddata.json@@ -0,0 +1,218 @@+{+ "data": [+ {+ "cpu": 0.0070435117676127,+ "disk": 0,+ "diskread": 0,+ "diskwrite": 26717.8315500686,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 8589934592,+ "mem": 2609766106.42524,+ "memhost": 1466588109.50233,+ "netin": 1309.50975994513,+ "netout": 35664.5184087792,+ "pressurecpufull": 0.0256090534979424,+ "pressurecpusome": 0.0352105624142661,+ "pressureiofull": 0.373332647462277,+ "pressureiosome": 0.374239368998628,+ "pressurememoryfull": 0.002480109739369,+ "pressurememorysome": 0.00268587105624143,+ "time": 1768327200+ },+ {+ "cpu": 0.00817986574809649,+ "disk": 0,+ "diskread": 4095.65997445722,+ "diskwrite": 25788.6671046209,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 8589934592,+ "mem": 801337882.483094,+ "memhost": 1054266526.52864,+ "netin": 527.367032925865,+ "netout": 203.081969056742,+ "pressurecpufull": 0.0722997832727941,+ "pressurecpusome": 0.0896186511725581,+ "pressureiofull": 3.09115858000203,+ "pressureiosome": 3.19030014749263,+ "pressurememoryfull": 0.0812492149586069,+ "pressurememorysome": 0.0900206013892854,+ "time": 1768500000+ },+ {+ "cpu": 0.00743592563637497,+ "disk": 0,+ "diskread": 41737.3764451565,+ "diskwrite": 28462.8072246382,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 8589934592,+ "mem": 749245017.132752,+ "memhost": 945750869.208331,+ "netin": 546.977186744997,+ "netout": 174.057351160957,+ "pressurecpufull": 0.0423529134327944,+ "pressurecpusome": 0.0539520658634872,+ "pressureiofull": 3.97327359426261,+ "pressureiosome": 4.02457541771572,+ "pressurememoryfull": 0.000880497582832213,+ "pressurememorysome": 0.000880497582832213,+ "time": 1768521600+ },+ {+ "cpu": 0.00719519728753605,+ "disk": 0,+ "diskread": 6953.71851851852,+ "diskwrite": 34710.0728888889,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 8589934592,+ "mem": 954879501.274074,+ "memhost": 1133117113.41037,+ "netin": 479.422282407407,+ "netout": 175.886680555556,+ "pressurecpufull": 0.0205805555555556,+ "pressurecpusome": 0.0349935185185185,+ "pressureiofull": 1.57173611111111,+ "pressureiosome": 1.58027638888889,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1768543200+ },+ {+ "cpu": 0.00672444312585721,+ "disk": 0,+ "diskread": 4.55111111111111,+ "diskwrite": 31628.9517037037,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 8589934592,+ "mem": 1027115556.97778,+ "memhost": 1210582303.95259,+ "netin": 551.55875,+ "netout": 181.058296296296,+ "pressurecpufull": 0.00313009259259259,+ "pressurecpusome": 0.00603888888888889,+ "pressureiofull": 0.913043518518518,+ "pressureiosome": 0.916687037037037,+ "pressurememoryfull": 0,+ "pressurememorysome": 0,+ "time": 1768564800+ },+ {+ "cpu": 0.00694733057945825,+ "disk": 0,+ "diskread": 16.8041025641026,+ "diskwrite": 32352.1247179487,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 7081597264.37542,+ "mem": 1050091655.3521,+ "memhost": 1210851182.49354,+ "netin": 789.476041486425,+ "netout": 182.984432703003,+ "pressurecpufull": 0.0178379269146789,+ "pressurecpusome": 0.0268558068635933,+ "pressureiofull": 3.72159850451119,+ "pressureiosome": 3.73816749062745,+ "pressurememoryfull": 4.78927203065134e-05,+ "pressurememorysome": 4.78927203065134e-05,+ "time": 1768586400+ },+ {+ "cpu": 0.00606272352505413,+ "disk": 0,+ "diskread": 903.205925925926,+ "diskwrite": 26740.8497777778,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 2147483648,+ "mem": 850249554.109629,+ "memhost": 1038515467.70963,+ "netin": 522.095069444444,+ "netout": 76.4288518518518,+ "pressurecpufull": 0.00162037037037037,+ "pressurecpusome": 0.0024212962962963,+ "pressureiofull": 0.137992592592593,+ "pressureiosome": 0.138677777777778,+ "pressurememoryfull": 0.000222222222222222,+ "pressurememorysome": 0.000222222222222222,+ "time": 1769882400+ },+ {+ "cpu": 0.00612745609687171,+ "disk": 0,+ "diskread": 4587.91822222222,+ "diskwrite": 31532.544,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 2147483648,+ "mem": 983056945.682962,+ "memhost": 1213134521.12593,+ "netin": 542.801106481481,+ "netout": 77.1043703703704,+ "pressurecpufull": 0.00119027777777778,+ "pressurecpusome": 0.00212546296296296,+ "pressureiofull": 0.159712962962963,+ "pressureiosome": 0.160296296296296,+ "pressurememoryfull": 0.000467592592592593,+ "pressurememorysome": 0.000467592592592593,+ "time": 1769904000+ },+ {+ "cpu": 0.00654042843370228,+ "disk": 0,+ "diskread": 62.1795555555556,+ "diskwrite": 28606.994962963,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 2147483648,+ "mem": 1069402482.72592,+ "memhost": 1304262822.73185,+ "netin": 431.889777777778,+ "netout": 75.8139166666666,+ "pressurecpufull": 0.0198055555555556,+ "pressurecpusome": 0.0326898148148148,+ "pressureiofull": 0.130621296296296,+ "pressureiosome": 0.130676851851852,+ "pressurememoryfull": 0.000888888888888889,+ "pressurememorysome": 0.000888888888888889,+ "time": 1769925600+ },+ {+ "cpu": 0.0060755954836333,+ "disk": 0,+ "diskread": 2102.71568883094,+ "diskwrite": 29187.0706649283,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 2147483648,+ "mem": 1084913038.4744,+ "memhost": 1358929772.80278,+ "netin": 433.353142655367,+ "netout": 76.0639504563233,+ "pressurecpufull": 0.000826271186440678,+ "pressurecpusome": 0.00150315080399826,+ "pressureiofull": 0.160981638418079,+ "pressureiosome": 0.16194209039548,+ "pressurememoryfull": 0.000790960451977401,+ "pressurememorysome": 0.000790960451977401,+ "time": 1769947200+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 2147483648,+ "time": 1785132000+ },+ {+ "disk": 0,+ "maxcpu": 2,+ "maxdisk": 32212254720,+ "maxmem": 2147483648,+ "time": 1785153600+ }+ ]+}