Add ignored fs types

This commit is contained in:
Dominik Schulz 2016-03-15 14:01:08 +01:00 committed by Sharif Nassar
commit 3fe5e7f8fa
3 changed files with 21 additions and 2 deletions

View file

@ -26,6 +26,7 @@ import (
const (
defIgnoredMountPoints = "^/(sys|proc|dev)($|/)"
defIgnoredFsTypes = "^(sys|proc)fs$"
ST_RDONLY = 0x1
)
@ -47,6 +48,10 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
log.Debugf("Ignoring mount point: %s", mpd.mountPoint)
continue
}
if c.ignoredFsTypesPatter.MatchString(mpd.fsType) {
log.Debugf("Ignoring fs type: %s", mpd.fsType)
continue
}
buf := new(syscall.Statfs_t)
err := syscall.Statfs(mpd.mountPoint, buf)
if err != nil {