Dear All, I’m facing some problems with a query and nothing seems to resolve them.
The data is collected via snmp plugin and stored as follows in the same bucket:
accessPoint,agent_host=xxxxxxx.it,aiAPMACAddress=fc:7f:f1:xx:xx:xx,bucket=test,host=xxxxxxx.it aiAPCPUUtilization=2i,aiAPHwopmode=0i,aiAPIPAddress="172.16.39.28",aiAPMemoryFree=482865152i,aiAPModel=".1.3.6.1.4.1.14823.1.2.111",aiAPModelName="505",aiAPName="xxxxxxx",aiAPRole="cluster slave",aiAPSerialNum="xxxxxxx",aiAPStatus=1i,aiAPTotalMemory=975437824i,aiAPUptime=1037295000i 1676966297000000000
and
radio,agent_host=xxxxxxx.it,aiRadioAPMACAddress=fc:7f:f1:xx:xx:xx,aiRadioIndex=1,bucket=test,host=xxxxxxx.it aiRadioChannel="6",aiRadioClientNum=6i,aiRadioMACAddress="fc:7f:f1:xx:xx:xx",aiRadioMode="access",aiRadioNoiseFloor=90i,aiRadioPhyEvents=579244039i,aiRadioRxBad=17312214i,aiRadioRxDataBytes=549056379i,aiRadioRxDataFrames=6052184i,aiRadioRxMgmtFrames=15196713i,aiRadioRxTotalFrames=31532585i,aiRadioStatus=1i,aiRadioTransmitPower=20i,aiRadioTxDataBytes=3602496616i,aiRadioTxDataFrames=7625904i,aiRadioTxDrops=236350i,aiRadioTxMgmtFrames=2979498i,aiRadioTxTotalFrames=10604670i,aiRadioUtilization4=12i,aiRadioUtilization64=12i 1676966298000000000
The final objective would be to make a state timeline of the data stored in the radio measurement (especially aiRadioChannel and aiRadioUtilization64): my thought on this is to add in the second measurement the aiAPName from the first one by matching the mac addesses: although called differently, aiRadioAPMACAddress and aiAPMACAddress are the same thing.
My current query is this:
import "join"
util = from(bucket: "test")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "radio")
|> filter(fn: (r) => r["_field"] == "aiRadioUtilization64")
|> filter(fn: (r) => r["aiRadioIndex"] == "1")
|> group()
ap = from(bucket: "test")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "accessPoint")
|> filter(fn: (r) => r["_field"] == "aiAPName")
|> group()
join.left(
left: util,
right: ap,
on: (l, r) => l.aiRadioAPMACAddress == r.aiAPMACAddress,
as: (l, r) => ({l with ap: r._value}),
)
|> keep(columns: ["_value","_time","_field","ap"])
|> group(columns: ["ap"])
|> aggregateWindow(every: 2m, fn: mean)
This works fine in the grafana explore section and dashboard, but only if the time range is set to below 1h, anything above 1h will return internal error: panic: arrow/array: index out of range
Am I doing something wrong?
Daniele