Split native collector into it's component parts and make them enablable.
Last login is disabled by default as it's broken on ubuntu 12.04 Interrupts is disabled by default as it's very granular and we'll have total interrupts from /proc/stat Allow ignoring devices from diskstats, ignore ram and loop devices by default. Use glog for logging.
This commit is contained in:
parent
964cdbfcc9
commit
25ea90369c
14 changed files with 747 additions and 516 deletions
|
|
@ -1,22 +1,11 @@
|
|||
package collector
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var verbose = flag.Bool("verbose", false, "Verbose output.")
|
||||
|
||||
func debug(name string, format string, a ...interface{}) {
|
||||
if *verbose {
|
||||
f := fmt.Sprintf("%s: %s", name, format)
|
||||
log.Printf(f, a...)
|
||||
}
|
||||
}
|
||||
|
||||
func splitToInts(str string, sep string) (ints []int, err error) {
|
||||
for _, part := range strings.Split(str, sep) {
|
||||
i, err := strconv.Atoi(part)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue