我正在使用telegraf将snmp数据推送到我的InfluxDB并通过Grafana进行可视化.
现在我遇到了一个奇怪的问题(很可能只是我身边的一个误解......)
鉴于以下系列:
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
但这并没有带来任何结果,尽管应该有很多.
我真的很感激任何提示是什么问题......
干杯