diff --git a/dnsmasq.go b/dnsmasq.go index 73d53e8..c784ff9 100644 --- a/dnsmasq.go +++ b/dnsmasq.go @@ -43,6 +43,9 @@ var ( dnsmasqAddr = flag.String("dnsmasq", "localhost:53", "dnsmasq host:port address") + metricsPath = flag.String("metrics_path", + "/metrics", + "path under which metrics are served") ) var ( @@ -193,6 +196,14 @@ func main() { dnsmasqAddr: *dnsmasqAddr, leasesPath: *leasesPath, } - http.HandleFunc("/metrics", s.metrics) + http.HandleFunc(*metricsPath, s.metrics) + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte(` + Dnsmasq Exporter + +

Dnsmasq Exporter

+

Metrics

+ `)) + }) log.Fatal(http.ListenAndServe(*listen, nil)) }