Page 1 of 2

OSX version of check_nfs_mounts?

Posted: Wed Oct 30, 2013 5:04 pm
by forrie
We have a few OSX systems for which I must monitor for active NFS mounts, similar to check_nfs_mounts.sh on regular linux systems. OSX does things different, so it doesn't have /proc or /etc/mtab. OSX is admittedly not my area of specialty -- and I'm trying to find a way to monitor the NFS mounts so that Nagios can work properly.

Does anyone have any tips on how to accomplish this with OSX 10.9 (or 10.8)?


Thank you.

Re: OSX version of check_nfs_mounts?

Posted: Wed Oct 30, 2013 5:08 pm
by abrist
How about:

Code: Select all

 /etc/fstab

?

Re: OSX version of check_nfs_mounts?

Posted: Wed Oct 30, 2013 5:15 pm
by forrie
No, to check that they are actively mounted and operational. Not just configured.

Re: OSX version of check_nfs_mounts?

Posted: Thu Oct 31, 2013 9:41 am
by slansing
Have you tried manually editing the plugin to fit your mount points??

Re: OSX version of check_nfs_mounts?

Posted: Thu Oct 31, 2013 10:58 am
by forrie
Look at the plugin code. It calls to /proc and /etc/mtab -- as I explained above, these are not present in the OSX system. At least, I'm not aware of it stores this same information elsewhere.

Re: OSX version of check_nfs_mounts?

Posted: Thu Oct 31, 2013 11:13 am
by abrist
I am not a mac guy either. One way I check mounts in gentoo is:

Code: Select all

mount -v
Or:

Code: Select all

mount -v|grep nfs
Does this work in ifruit land?

Re: OSX version of check_nfs_mounts?

Posted: Thu Oct 31, 2013 3:08 pm
by forrie
The person that set up the mounts has them in autofs, so the output looks like:

Code: Select all

/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
map -static on /Network/prod/mezz (autofs, automounted, nobrowse)
map -static on /Network/test/mezz (autofs, automounted, nobrowse)
map -static on /Network/mezz (autofs, automounted, nobrowse)
map -static on /Network/dev/mezz (autofs, automounted, nobrowse)
/dev/disk1 on /Volumes/CF92 (msdos, local, nodev, nosuid, noowners)
/dev/disk2 on /Volumes/CF77 (msdos, local, nodev, nosuid, noowners)
In Linux, at least, you can check the active filesystems and their type in /proc and /etc/mtab

Since OSX is sorta BSD-ish (maybe less so these days) I figure there must be some facility in there -- that the microkernel refers to.

Re: OSX version of check_nfs_mounts?

Posted: Fri Nov 01, 2013 11:31 am
by sreinhardt
Not quite as clean, but have you tried using df -h or something similar and grepping for the specific mount point? Would this fit your needs of making sure its mounted and available?

Re: OSX version of check_nfs_mounts?

Posted: Thu Nov 07, 2013 5:06 pm
by forrie
df -h does not indicate the mount point type (ie: nfs).

I was hoping to discover some equivalent in OSX that stores this data, similar to mtab or /proc. That would be more accurate. But it's looking like Apple really changed things so much that nobody seems to know.

Re: OSX version of check_nfs_mounts?

Posted: Fri Nov 08, 2013 1:13 pm
by lmiltchev
Did you create the mount point using the Disk Utility or you mounted it manually as root? If you did the latter, you *should* see something like: "192.x.x.x:/xxx/xxx on /xxx/xxx/xxx (nfs)", when you run the mount command.