Several WHERE in InfluxDB do not return a result

I use telegraf to pop snmp data into my InfluxDB and render it through Grafana.

Now I am faced with some strange problem (most likely, this is just a misunderstanding on my side ...)

Given the following series:

snmp,agent_host=10.20.30.40,host=grafana-dev,hostname=1OG,ifIndex=3,ifName=ath0 snmp,agent_host=10.20.30.40,host=grafana-dev,hostname=1OG,ifIndex=3,ifName=ath1 

I am currently using the following query in grafana to get data (which works fine):

 SELECT non_negative_derivative(mean("ifInOctets"), 1s) *8 AS "In", non_negative_derivative(mean("ifOutOctets"), 1s) *8 AS "Out" FROM "snmp" WHERE "host" = 'grafana-dev' AND "hostname" =~ /^1OG$/ AND time > now() - 6h GROUP BY time(10s), "hostname", "ifName" fill(null)&epoch=ms 

Now I only need to select data for one interface (ifName):

 SELECT non_negative_derivative(mean("ifInOctets"), 1s) *8 AS "In", non_negative_derivative(mean("ifOutOctets"), 1s) *8 AS "Out" FROM "snmp" WHERE "host" = 'grafana-dev' AND "hostname" =~ /^1OG$/ AND "ifName"= 'ath0' AND time > now() - 6h GROUP BY time(10s), "hostname", "ifName" fill(null)&epoch=ms 

But this does not return any results, although there should be a lot.

I would really appreciate the problem ...

Greetings

+5
source share
1 answer

Note: always check the available series.

The series published above is an old series in which new data are not added by telegraph, and therefore the results are not returned. The correct (current) series is called:

 snmp,agent_host=10.20.0.11,host=grafana-dev,hostname=1OG,ifDescr=ath0,ifIndex=6 snmp,agent_host=10.20.0.11,host=grafana-dev,hostname=1OG,ifDescr=ath1,ifIndex=5 

and work great. Excuse for troubling:)

0
source

Source: https://habr.com/ru/post/1263328/


All Articles