SCIENTIFIC-LINUX-USERS Archives

May 2016

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stephen Berg (Contractor)" <[log in to unmask]>
Reply To:
Stephen Berg (Contractor)
Date:
Thu, 5 May 2016 08:38:42 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (80 lines)
On 05/05/2016 07:57 AM, olli hauer wrote:
> On 2016-05-05 14:22, Stephen Berg (Contractor) wrote:
>> Had this problem for quite awhile now, still haven't found a solution.
>>
>> We use NFS automounts quite extensively here.  Lot's of filesystems that show up (to the user's) as /u/<blah>.  On the system where the filesystem actually lives it will be available as /u/<blah> and also /export/<blah>.  If the /u/<blah> mount point is mounted on a system where it's hosted df doesn't show the /export/<blah> mount point and the check_mk service to monitor that filesystem goes into an UNKN state.
>>
>> I think it's because the agent see the bind mount and ignores the actual mount point in it's df output.
>>
>> If I look in /proc/mounts I see:
>>
>> /dev/mapper/732254-common mounted on /export/new_common
>>
>> and
>>
>> /dev/mapper/732254-common mounted on /common
>>
>> That's what I expect to see, but running df I only see the filesystem mounted on /common.  That's where check_mk gets messed up since it inventoried the filesystem as being on /export/new_common.
>>
>> Is there anyway to get df to ignore automounted mount points and only show the actual mount point?  I've looked through the man page and can't find any option to get that to happen.
>>
>>
> Long time ago since I played with check_mk, but I remember the agent was a simple shell script.
>
> looking up the agent code in the check_mk git ...
> http://git.mathias-kettner.de/git/?p=check_mk.git;a=blob_plain;f=agents/check_mk_agent.linux;hb=refs/heads/master
>
> echo '<<<df>>>'
> # The exclusion list is getting a bit of a problem. -l should hide any remote FS but seems
> # to be all but working.
> excludefs="-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs -x prl_fs"
> ...
>
> There a is a special handling for the nfs mounts, where you can try to fix / change the reporting
>
> # Check NFS mounts by accessing them with stat -f (System
> # call statfs()). If this lasts more then 2 seconds we
> # consider it as hanging. We need waitmax.
> if type waitmax >/dev/null
> ...
>
Actual NFS mounts are handled correctly.  It's the local filesystems 
that get munged up in a df output that causes the issue.  The mount 
changes when the filesystem is referenced via the local mountpoint 
versus the automount mountpoint.

For instance: my desktop system hosts my home directory, my home 
directory is also available to the rest of the network via NFS and an 
automount definition.  When I'm logged in the local filesystem check is 
in an unknown state because df only shows the automount mountpoint.

check_mk_agent shows:
<<<df>>>
/dev/mapper/VG-home    xfs         52403200 15188064  37215136 29% 
/home/berg

<<<mounts>>>
/dev/mapper/VG-home /export/home xfs rw,relatime,attr2,inode64,noquota 0 0
/dev/mapper/VG-home /home/berg xfs rw,relatime,attr2,inode64,noquota 0 0

df shows:

/dev/mapper/VG-home                         52403200  15189168 37214032  
29% /home/berg

df should show me the filesystem as it's actually mounted on /export/home.

I really think the problem is how df works.  Seems like a few years ago 
if the filesystem were a local filesystem also available via automount 
it would be a bind mount via the automounter and a local mount for the 
actual filesystem.  Back then check_mk could ignore the bind mount and 
everything worked nicely.


-- 
Stephen Berg
Systems Administrator
NRL Code: 7320
Office: 228-688-5738
[log in to unmask]

ATOM RSS1 RSS2