Code: Select all
# service autofs stop
Redirecting to /bin/systemctl stop autofs.service
# service autofs start
Redirecting to /bin/systemctl start autofs.service
# findmnt -Dno TARGET | wc -l
11
# findmnt -Dno TARGET
/dev
/dev/shm
/run
/sys/fs/cgroup
/
/home
/tmp
/opt
/boot
/var
/net/nas/brlhome
# /opt/nagios/libexec/check_disk -w 20% -c 10% -l -X cifs
DISK CRITICAL - free space: / 19273 MB (94% inode=99%); /dev 1883 MB (100% inode=99%); /dev/shm 1892 MB (100% inode=99%); /run 1884 MB (99% inode=99%); /sys/fs/cgroup 1892 MB (100% inode=99%); /home 1493 MB (97% inode=99%); /tmp 2005 MB (98% inode=99%); /opt 2003 MB (98% inode=99%); /boot 52 MB (26% inode=99%); /var 9683 MB (94% inode=99%); <snip>lots of remote filesystems managed by automount</snip>
# findmnt -Dno TARGET | wc -l
59
# /opt/nagios/libexec/check_disk -w 20% -c 10% -l -X cifs
DISK OK - free space: / 19273 MB (94% inode=99%); /dev 1883 MB (100% inode=99%); /dev/shm 1892 MB (100% inode=99%); /run 1884 MB (99% inode=99%); /sys/fs/cgroup 1892 MB (100% inode=99%); /home 1493 MB (97% inode=99%); /tmp 2005 MB (98% inode=99%); /opt 2003 MB (98% inode=99%); /boot 52 MB (26% inode=99%); /var 9683 MB (94% inode=99%);| /=1196MB;16376;18423;0;20470 /dev=0MB;1506;1694;0;1883 /dev/shm=0MB;1513;1702;0;1892 /run=8MB;1513;1702;0;1892 /sys/fs/cgroup=0MB;1513;1702;0;1892 /home=32MB;1220;1373;0;1526 /tmp=32MB;1630;1834;0;2038 /opt=34MB;1630;1834;0;2038 /boot=144MB;156;176;0;196 /var=546MB;8184;9207;0;10230
# findmnt -Dno TARGET | wc -l
59
The second time check_disk is run it only reports on the file systems I expect it to, so the problem is not immediately obvious an issue relating to check_disk. But even though check_disk is now performing okay I have lots of NFS mounts I don't want which causes other problems.
I deally after running check_disk the first time, or any subsequent time, the findmnt command should return the original 11 devices only. This used to work fine on RHEL6 and I notice that there is also an interesting difference in the output of the mount command; RHEL6 returns active mounts and RHEL7 returns all possible mounts. There is also this comment within the RHEL7 mount(8) man page:
I think that may be relevant to this problem, but I'm not 100% sure.The listing and help.
The listing mode is maintained for backward compatibility only.
For more robust and definable output use findmnt(8), especially in your scripts.
Has anyone else faced this problem? Has anyone got a solution? (BTW, reducing the autofs timeout is not a viable solution).
Thanks in advance for any assistance.