2013-05-07 16:40:10 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"log"
|
2014-02-07 17:09:39 +01:00
|
|
|
|
|
|
|
"github.com/prometheus/node_exporter/exporter"
|
2013-05-07 16:40:10 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
configFile = flag.String("config", "node_exporter.conf", "config file.")
|
|
|
|
memprofile = flag.String("memprofile", "", "write memory profile to this file")
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
exporter, err := exporter.New(*configFile)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatalf("Couldn't instantiate exporter: %s", err)
|
|
|
|
}
|
2014-02-07 17:09:39 +01:00
|
|
|
log.Printf("Registered collectors:")
|
|
|
|
for _, c := range exporter.Collectors {
|
|
|
|
log.Print(" - ", c.Name())
|
|
|
|
}
|
2013-05-07 16:40:10 +02:00
|
|
|
exporter.Loop()
|
|
|
|
}
|