nlamirault / pihole_exporter

Prometheus exporter for PiHole metrics
Apache License 2.0
76 stars 20 forks source link

top sources/ads/queries doesn't work #11

Open evanrich opened 5 years ago

evanrich commented 5 years ago

PiHole metrics: &pihole.Metrics{DomainsBeingBlocked:138713, DNSQueriesToday:58771, AdsBlockedToday:20601, AdsPercentageToday:35.053001, DomainsOverTime:pihole.DomainsOverTime{Stats:map[string]string(nil)}, AdsOverTime:pihole.AdsOverTime{Stats:map[string]string(nil)}, TopQueries:map[string]float64(nil), TopAds:map[string]float64(nil), TopSources:map[string]float64(nil), QueryA:0, QueryAAAA:0, QueryPTR:0, QuerySOA:0, Eight844:0, Eight888:0} source="exporter.go:128"

above is the log output i get when querying 127.0.0.1:9311/metrics . It doesn't seem to output sources/ads/queries. I looked at https://github.com/povilasv/pihole_exporter and it seems he changed from float64 to int...is this the reason?

rrix commented 5 years ago

it looks like the topItems and getQuerySources API requires authentication now, which the exporter doesn't provide for:

https://discourse.pi-hole.net/t/pi-hole-api/1863