How to query Temperature

Hello Team,

I am monitoring switch details using prometheus setup and storing that data in influx.
Now here I want to query Temperature, CPU, Memory details at Grafana Dashboard.
field for Temperature - PSU1Temp1
field for memory - memory
field for cpu - systemStats

Please find the attachments of Dashboard.

Any help would be appreciated.

Thank you.

Hello and welcome @zakir,
Thanks for your question. I’m not that familiar with Grafana and I’m unclear about why you think this is an Influx question? It sounds like a Grafana question. Maybe it’s more appropriate to ask on their community site?

Thanks for the reply Anaisdg,

Basically if I want to see the temperature, CPU and Memory details, how should I have to write a query ?

Database - telegraf
measurement - snmp
fieldkey - PSU1Temp1
fieldkey - memTotalFree
fielkey - memory

Any help would be appreciated.

Thank you.

when I am passing snmpwalk command at my VM I can see some integers, please look the attachment.

And in influx database when I am selecting * from snmp, I can’t those details here.

Thank you.


And in influx database when I am selecting * from snmp, I can’t those details here.
[/quote]

Any suggestion please.

Hello @zakir,

Your queries would look like:
SELECT "memory", "memTotalFree", "PSU1Temp1" FROM "telegraf"."autogen"."sno" WHERE time > :dashboardTime:

Or

from(bucket: "telegraf")
  |> range(start: -24d)
  |> filter(fn: (r) => r._measurement == "snmo" and r._field == "PSU1Temp1" or 
r._field == "memTotalFree"  or r._field == "memory" )

Depending on whether you’re using influxql (with 1.7) or flux (1.7.6 and greater). I recommend using the UI. It’s probably the easiest way to get started using flux.
Alternatively, you might find this blog helpful.

Thanks for your reply Anaisdg,

I will try this query and update you.

Thank you.

Hello Anaisdg,

I tried with the above queries but no success.

This is influx query performing at Grafana Dashboard, I change filed memory to memTotalFree
SELECT last(“memTotalFree”) FROM “snmp” WHERE (“agent_host” = ‘100.64.255.3’) AND timeFilter GROUP BY time(__interval) fill(previous)
result = 0%

SELECT mean(“memTotalFree”) FROM “snmp” WHERE (“agent_host” = ‘100.64.255.3’) AND timeFilter GROUP BY time(__interval) fill(null)
result = 2345444%

I am not able to query it properly.

Anaisdg any suggestions?

Thank you.

SELECT mean(“memTotalFree”) FROM “snmp” WHERE (“agent_host” = ‘100.64.255.3’) AND timeFilter GROUP BY time(__interval) fill(null)