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

@ -33,6 +33,7 @@ import "C"
const (
defIgnoredMountPoints = "^/(dev)($|/)"
defIgnoredFsTypes = "^devfs$"
MNT_RDONLY = 0x1
)
@ -55,6 +56,10 @@ func (c *filesystemCollector) GetStats() (stats []filesystemStats, err error) {
device := C.GoString(&mnt[i].f_mntfromname[0])
fstype := C.GoString(&mnt[i].f_fstypename[0])
if c.ignoredFsTypesPattern.MatchString(fstype) {
log.Debugf("Ignoring fs type: %s", fstype)
continue
}
var ro float64
if (mnt[i].f_flags & MNT_RDONLY) != 0 {