2017-01-25 45 views
5

我使用telegraf將snmp數據推入我的InfluxDB並通過Grafana對其進行可視化。InfluxDB中多處不返回結果

現在我遇到了一個奇怪的問題考慮下面的系列(最有可能只是一個在我身邊missunderstanding ...)

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 

我目前使用的grafana下面的查詢來獲取數據(工作正常):

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 

我現在只需要選擇一個單一的接口的數據(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 

但是這不會返回任何結果,雖然應該有很多。

我真的很感激任何暗示什麼問題是...

乾杯

回答

0

注意自己:總是仔細檢查可用的系列。

上面貼的系列是舊系列,沒有新的數據被telegraf添加,因此沒有結果返回。正確的(當前)系列被命名爲:

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 

並且正常工作。 不好意思:)