Add ignored fs types
This commit is contained in:
parent
df8dcd27e2
commit
3fe5e7f8fa
3 changed files with 21 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue