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