Hi,
so im trying to build a Proxmox monitor with Grafana & InfluxDB and I’ve got this query here:
SELECT (mean("mem")/last(maxmem))*100 FROM "system" WHERE ("object" = 'lxc') AND ("nodename" =~ /^$node$/)
This is what I tried so far, but it keeps saying “No data”:
A:
from(bucket: "my_bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "system")
|> filter(fn: (r) => r["_field"] == "mem")
|> filter(fn: (r) => r["object"] == "lxc" and r["nodename"] == "${node}")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
B:
from(bucket: "my_bucket")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "system")
|> filter(fn: (r) => r["_field"] == "maxmem")
|> filter(fn: (r) => r["object"] == "lxc" and r["nodename"] == "${node}")
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
C:
($A / $B) * 100
I’ve been searching for hours now, but could not quite find a solution on how to divide these two fields. Maybe somebody could help me?
Thanks in advance!