Ignore cifs network mounts (FS starting with //)
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
a36d4e0fe2
commit
febd8e24ca
1 changed files with 8 additions and 3 deletions
|
@ -5,19 +5,20 @@ import sys
|
|||
|
||||
CRIT = 90.0
|
||||
MOUNT_BLACKLIST = ['/dev', '/efi', '/proc', '/run', '/sys', '/tmp']
|
||||
FS_BLACKLIST = ['//', 'cgroup', 'tmpfs']
|
||||
|
||||
|
||||
def main():
|
||||
output = subprocess.check_output([
|
||||
'sh', '-c', 'df -a -B 1 | awk \'{ printf "%s\\t%d\\t%d\\n", $6, $2, $4 }\''
|
||||
'sh', '-c', 'df -a -B 1 | awk \'{ printf "%s\\t%d\\t%d\\t%s\\n", $6, $2, $4, $1 }\''
|
||||
]).decode('utf-8')
|
||||
|
||||
fs = {}
|
||||
for line in output.split('\n'):
|
||||
if len(line) == 0 or line[0] != '/':
|
||||
continue
|
||||
(mountpoint, total, available) = line.split('\t')
|
||||
fs[mountpoint] = (total, available)
|
||||
(mountpoint, total, available, filesystem) = line.split('\t')
|
||||
fs[mountpoint] = (total, available, filesystem)
|
||||
|
||||
color = '#50fa7b'
|
||||
|
||||
|
@ -28,6 +29,10 @@ def main():
|
|||
if mount.startswith(b):
|
||||
skip = True
|
||||
|
||||
for b in FS_BLACKLIST:
|
||||
if data[2].startswith(b):
|
||||
skip = True
|
||||
|
||||
if skip:
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in a new issue