On 05/12/2016 10:23 AM, Stephen Berg (Contractor) wrote:
Having an issue with the df command. I need it to show me a filesystem's physical mount point, but since I use NFS and automounts quite a bit it chooses to show me the automount mount point instead. It's screwing up the monitoring software I use, check_mk.

For instance:
/dev/VolGroup/home    /export/home        xfs    defaults    1 2

That gets mounted as shown, but as soon as I login, the automounter will mount it as /home and the check_mk check for that filesystem goes into an unknown state since it can't find it any longer.

I've been unable to find any way to get df to show only physical mount points and ignore automount mount points. I'm seeing this behavior on most all my SL7.2 systems, SL6.7 doesn't seem to have this issue.


Came up with a kludge work-around for this issue. In the check_mk_agent the command used is: excludefs="-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs"
df -PTlk $excludefs | sed 1d

I replaced it with:
grep "/export/" /etc/fstab | awk '{print $2}' | xargs df -PTlk | sed 1d ; df -PTlk / /usr/src /var /boot | sed 1d

That command is all one line, probably gets wrapped after I send this email.

It works for my environment, all my systems are configured in a very similar way. File systems for /, /var, /boot and /usr/src. Any data filesystems are in most every case mounted somewhere under /export. Will probably have to re-do the kludge every time the check_mk_agent gets updated, but that's not a huge deal.


--
Stephen Berg
Systems Administrator
NRL Code: 7320
Office: 228-688-5738
stephen.berg....@nrlssc.navy.mil

Reply via email to