5 ignorefs = ["NFS", "nfs", "nfs4", "nfsd", "afs", "binfmt_misc", "proc", "smbfs",
6 "autofs", "iso9660", "ncpfs", "coda", "devpts", "ftpfs", "devfs",
7 "mfs", "shfs", "sysfs", "cifs", "lustre_lite", "tmpfs", "usbfs",
8 "udf", "fusectl", "fuse.snapshotfs", "rpc_pipefs"]
11 FileSystem.mounts.each do |m|
12 if ((not ignorefs.include?(m.fstype)) && (m.options !~ /bind/))
13 mountpoints[m.device] = { 'type' => m.fstype, 'mount' => m.mount }
17 def check_ext3(dev, mnt)
18 output=%x{tune2fs -l #{dev}}
19 if output =~ /FS Error count:\s*(\d+)/ and $1.to_i > 0
20 return "#{dev} (#{mnt}) has #{$1} errors"
25 mountpoints.keys.each do |m|
28 if mountpoints[m]['type'] =~ /ext/
29 temp = check_ext3(m, mountpoints[m]['mount'])
33 if temp && (temp.length > 0)
39 puts output.join("\n")
42 puts "OK: All filesystems ok."