Refactor node_exporter to support collectors.

A collector is a type matching 'Collector' interface.

The following collectors where added:
- NativeCollector wrapping the original functionality (attributes, load)
- GmondCollector scraping ganglia's gmond (based on gmond_exporter)
- MuninCollector scraping munin (based on munin_exporter)
This commit is contained in:
Johannes 'fish' Ziemke 2013-05-07 16:40:10 +02:00
commit 588ef8b62a
9 changed files with 782 additions and 224 deletions

22
main.go Normal file
View file

@ -0,0 +1,22 @@
package main
import (
"flag"
"github.com/prometheus/node_exporter/exporter"
"log"
)
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)
}
exporter.Loop()
}